Ubuntu server static ip getting overwritten
-
Hello,
I'm not sure where the problem lies for this, I've made a post on the ubuntu forums but also posting here.I have a Ubuntu 10.10 server running in an ESXi 4.1 vmware box. Have it configured with a single E1000 network card running through a virtual switch with a hardware based pfSense 2.0 RC3 box serving as a router.
I've tried reinstall ubuntu a couple times and this same problem continues to occur. If I change it's virtual nic to point to my other nic on the server that runs a direct connection to the internet instead of through the pfSense box, and give it a static IP there the problem does not occur. So it leads me to believe it may be something that pfSense is doing.
The problem is when I set a static IP in ubuntu's interfaces file and restart networking, it works fine on the static IP for a few hours. But within 3 to 5 hours it will suddenly revert to using the dynamic IP that pfSense had originally assigned it. The interfaces file still shows the static IP set, but ifconfig shows the dynamic IP.
Now I didn't know that an outside source could overrule the interfaces setting, but apparently it can. Any ideas on what could be causing this and what I can do to fix it. I realize I could turn off DHCP in pfSense and that would most likely fix it, but I don't really want to do that. I have some VMs that are fine running with dynamic IPs for one thing, and when I install a new VM having the dyanmic IP during installation for it to get updates while installing is nice.
Thankyou for any assistance.
-
If that static ip is out of scope no problems should occur
and if that ip is in dhcp scope then you can create reservations(Services:DHCP Server:bottom of page) -
-
Does the Ubuntu system run dhclient on the interface that changes IP address? What does shell command```
ps ax | grep
dhclient3 -e IF_METRIC=100 -pf /var/run/dhclient.eth0.pid -lf /var/lib/dhcp3/dhclient.eth0.leases eth0
thats what is returned by ps ax | grep dhclient (assuming that is what you wanted me to grep for).
Honestly not sure what this process is? If it is causing problems then what would have started it? I didn't do anything to start it I'm fairly sure of that. I've installed Ubuntu 10.10 quite a few times in VM Server and on hard boxes, this is the first time I've ever had a problem with it. And it's doing it over multiple installations on this ESXi 4.1 box.
-
dhclient3 -e IF_METRIC=100 -pf /var/run/dhclient.eth0.pid -lf /var/lib/dhcp3/dhclient.eth0.leases eth0
thats what is returned by ps ax | grep dhclient (assuming that is what you wanted me to grep for).
Sorry about the typo. I've fixed that. You guessed correctly.
Honestly not sure what this process is? If it is causing problems then what would have started it? I didn't do anything to start it I'm fairly sure of that. I've installed Ubuntu 10.10 quite a few times in VM Server and on hard boxes, this is the first time I've ever had a problem with it. And it's doing it over multiple installations on this ESXi 4.1 box.
dhclient is the DHCP client process which attempts to assign an interface an IP address by DHCP. I believe the Ubuntu default is to use DHCP to assign an IP address to an interface. I'm guessing when you assign a static IP to the interface you didn't disable auto configuration on the interface. Do you run a graphical interface on the Ubuntu server?
I run a few Ubuntu systems at home and they all auto configure IP addresses but I've setup the DHCP server to assign each interface a fixed IP address ("static" DHCP).
-
Ubuntu just does that. When you edit the interface config file, change the configuration to static and restart your network stack. The DHCP Client still thinks he has to configure the interfaces. Only solution afaik is reboot or kill the DHCP client.
sudo kill
cat /var/run/dhclient.eth0.pid