[Techtalk] ip addreses on redhat

Meredydd meredydd at everybuddy.com
Mon Aug 4 16:08:41 EST 2003


(top-posting for consistency)

That's not actually what Lena was looking for, I don't think. What 
Lena's looking for are the system calls to retrieve the information 
from the kernel, which is what ifconfig does. Those config files are 
used to *set* the IP (or rather, to tell ifconfig to set the IP) - they 
don't store it on the kernel's behalf.

The source code to the net-tools applications, which includes ifconfig, 
is available at http://sites.inka.de/lina/linux/NetTools/

Meredydd

On Monday 04 August 2003 15:48, Neil Fryer wrote:
> Hi All,
>
> AFAIK, RedHat gets it's IP addy's from
> /etc/sysconfig/networking/devices/ifcfg-eth0 on boot up, I could be
> wrong here, but I'm pretty sure this is where the info is obtained
> from.
>
> Kind regards
> Neil Fryer
>
> Lena M wrote:
> >Luke,
> >
> >That's right. I need to know how ifconfig -a gets ip addresses. I
> > would like a program that I'm writing to do the same.
> >
> >Thank you.
> >
> >Lena
> >
> >
> >
> >----- Original Message -----
>
> From: "Luke Woods" <lwoods at netstarnetworks.com>
>
> >To: <techtalk at linuxchix.org>
> >Sent: Monday, August 04, 2003 7:16 AM
> >Subject: RE: [Techtalk] ip addreses on redhat
> >
> >>Hi,
> >>
> >>I believe she might be talking about where the address is stored
> >> after being configured (by ifconfig or the like).
> >>
> >>Network interfaces are kernel resident, the applications make
> >> system calls to change certain parameters of the interface.
> >>
> >>
> >>Quote:
> >>
> >>Is the IP address being assigned statically or dynamically?
> >>
> >>If it's static, the IP address lives in
> >>/etc/sysconfig/network-scripts/ifcfg-ethX  where X is the interface
> >>number.
> >>
> >>If the address is being assigned dynamically, then where it's
> >> stored depends on the dhcp client you're using. The most probable
> >> location is /var/lib/dhcp, but as I said, that location might vary
> >> depending on the client. In any case, it will be stored somewhere
> >> in /var, not /proc
> >>
> >>
> >>_______________________________________________
> >>Techtalk mailing list
> >>Techtalk at linuxchix.org
> >>http://mailman.linuxchix.org/mailman/listinfo/techtalk
> >
> >_______________________________________________
> >Techtalk mailing list
> >Techtalk at linuxchix.org
> >http://mailman.linuxchix.org/mailman/listinfo/techtalk



More information about the Techtalk mailing list