Click to See Complete Forum and Search --> : what file contains IP info?
inkedmn
07-18-2001, 04:19 PM
when a machine recieves an IP address, netmask, etc from a dhcp server (or when it's statically assigned), which would contain that information?
also, does one file contain all of the following? :
-IP address
-Subnet mask
-Default Gateway
-DNS server(s)
-Whether the info is from DHCP or manual entry?
the reason i ask, is i'm going to attempt to code a small GUI app in python that's akin to the output of "winipcfg" in windows 95.
thanks for all your help!
Stuka
07-18-2001, 04:39 PM
A lot of that information can be gotten from ifconfig and/or netstat, but I'm not sure what file it might reside in. That's an interesting question...I wonder if it's on the /proc filesystem...hmmm :confused:
The Kooman
07-19-2001, 12:58 AM
Originally posted by inkedmn:
<STRONG>when a machine recieves an IP address, netmask, etc from a dhcp server (or when it's statically assigned), which would contain that information?
also, does one file contain all of the following? :
-IP address
-Subnet mask
-Default Gateway
-DNS server(s)
-Whether the info is from DHCP or manual entry?
the reason i ask, is i'm going to attempt to code a small GUI app in python that's akin to the output of "winipcfg" in windows 95.
thanks for all your help!</STRONG>
Check out the following files:
/etc/sysconfig/network gives host & domain name
/etc/sysconfig/network-scripts/ifcfg-eth0 (assuming your network interface is ethernet) gives boot protocol (static IP or DHCP), netmask and interface device (eth0)
/etc/resolv.conf gives dns servers
I'm not sure about the gateway - the "route" command will give you that!
inkedmn
07-19-2001, 11:06 AM
cool, thanks for the replies!
Strike
07-19-2001, 12:10 PM
Those files are distribution-specific, and as such, should not be used.
jemfinch
07-19-2001, 02:17 PM
Let me also note that the /proc filesystem is kernel-dependent, and therefore should also not be used.
Jeremy