Subj : Re: IP address keeps changing...help! To : comp.os.linux From : Stuart Fuller Date : Thu Jul 08 2004 03:59 am 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 .