Re: IP address keeps changing...help!

From: Stuart Fuller (stufuller_at_usa.net)
Date: 07/08/04


Date: Thu, 08 Jul 2004 02:59:28 -0400

Joe Attardi wrote:

> Hi all,
>
> I'm running a Linux box on my home network mainly for purposes of NAT /
> internet sharing. Everything works fine - eth0 goes to the LAN, with an
> IP of 192.168.0.1, and eth1 goes to the cable modem, with an external
> IP. I'm also running dhcpd on eth0, to give out IP addresses and such to
> computers on my local network.
>
> My problem is - every once in a while, it seems that eth0 will request
> an IP address from dhcpd, so it gets assigned an IP of, say,
> 192.168.0.254. Since the other computers have the default gateway set to
> 192.168.0.1, obviously all the computers lose their connection, and I
> have to manually log in to the box and run the command 'ifconfig eth0
> 192.168.0.1' to set it back.
>
> Here is my /etc/sysconfig/networking/devices/eth0 file:
>
> ONBOOT=yes
> USERCTL=no
> PEERDNS=yes
> TYPE=Ethernet
> IPADDR=192.168.0.1
> DEVICE=eth0
> HWADDR=00:60:97:3b:69:e5
> BOOTPROTO=none
> NETMASK=255.255.255.0
>
> BOOTPROTO is not set to DHCP, and it's clearly set to use 192.168.0.1.
> Even when I restart the networking system (/etc/init.d/network restart),
>
> it still will pull an IP address from the DHCP server after a few hours.
>
> Is there _any_ way I can stop this from happening?

One thing you could do would be to configure your DHCP server to give you
the 192.168.0.1 address. You'd do this by associating your HWADDR with
the desired IP address.

Also, eth0 does not request an IP address. dhcpcd, the DHCP client daemon
does. And, its man page indicates that it defaults to requesting IP
addresses on eth0.

You may have to edit the /etc/sysconfig/network-scripts/ifup script to
force dhcpcd to use eth1 to request addresses.

-- 
        Stu


Relevant Pages

  • Re: Renew IP from DHCP
    ... how can I renew my IP address of my linux PC from the DHCP server? ... can do a ifconfig eth0 down but that way I don't get any ... I have the problem that sometimes my Linux PC doesn't get an IP ... "If you have time to waste, please waste it somewhere else, not here." ...
    (comp.os.linux.networking)
  • Samba nmbd messages in log
    ... I have a Samba server running on my small home network. ... The home network is served off its own NIC (eth0). ... Apr 15 11:24:25 localhost nmbd: Doing a node status request to the domain master browser at IP 192.168.15.100 failed. ...
    (Fedora)
  • DHCP failover to static IP addr
    ... I would like to activate eth0 using dhcp, but if that fails (no dhcp server ... on the network) I would like to assign a static IP address. ...
    (comp.os.linux.networking)
  • Re: Help: configure networking
    ... You need to make sure to make sure that DHCP server doesn't ... generally be only one DHCP server per network segment. ... but running one on eth0 could be a problem ... with your favorite editor and make sure that eth1 is specified in the ...
    (Ubuntu)
  • Re: eth0 failure
    ... be that it screws up the DHCP server in the combined hub/ ADSL router. ... Where is the DHCP conf file on Linux? ... As far as I am aware, am not using dynamic ranges or host identifiers ... but it just wont see eth0 ...
    (comp.os.linux.networking)