PDA

View Full Version : Networking keeps using DHCP instead of Static IP


thedon
15th March 2007, 01:15 AM
Hey guys and gals. I have a situation and I've been searching around. I think Im doing everything right its just something Im missing. I setup a server and created a root account and now the server boots up into the graphic interface fine. When I go to system\administration\network in the menu and click on my eth0, its checked at automatically optain IP address. When I change it to statically set IP address and give it the info I want..
10.1.1.250
255.255.255.0
10.1.1.1

it looks like it accepts everything. It says it saved information and tells me to restart the network. Which I do and everything is ok. I even check the /etc/sysconfig/network-scripts/ifcfg-eth0 and it shows..

# nVidia Corporation MCP61 Ethernet
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
HWADDR=6c:55:22:66:22:yb
NETMASK=255.255.255.0
IPADDR=10.1.1.250
GATEWAY=10.1.1.1
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes

note I changed the HWADDR just for this post, the real one is what it is.
The problem is, when I reboot the computer at that point, the computer goes back to using DHCP and gets a totally different IP address.
By the way I am inside a company network thats why I am using the 10 addresses.
and the ifcfg-eth0 goes back to a default looking..

DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
HWADDR=6c:55:22:66:22:yb

so what is causing DHCP to be still enabled even when I have told the computer to use my static.

This post maybe mute because I am not intending to use the server inside my company network, but I do want to understand why the fixed IP isnt sticking.

jim
15th March 2007, 01:31 AM
when you installed, did you assign this static ip ?
Looks like your on the right path... you are saving the changes first? then restarting ?

Iron_Mike
15th March 2007, 01:47 AM
Also what happens when you manually edit your /etc/sysconfig/network-scripts/ifcfg-eth0 and manually change the "bootproto=none" save it and restart?? The other check is to put change the USERCTL=yes and see if it will take your changes.....

thedon
15th March 2007, 02:10 AM
Jim when I installed, I didnt setup anything static. I prettymuch didnt have the PC on the network at the time so I skipped the network setup part. I figured I could do it after the fact.

IronMike. I did save the ifcfg-eth0 file each time. Sometimes using the GUI and verified that it looked like what I posted, or other times manually modifying it and doing a more on the file after I saved it to make sure it kept my changes. In fact when it did reboot the first few times, because I made a backup, it used the backup in the details part of the boot.
Later when I only had the one file, it looked as if it was going find, but when everything booted up, the file was back to the default and the IP back to DHCP. But your last suggestion I havent tried, in fact I came home. I wont be able to test til tomorrow, but I am on my second test server here at home. Which also does DHCP from my linksys router. I am about to reboot here to see if the same thing happens at work, then I will try your suggestion and reply back.
Thanks for the replies guys.

Paddyman
15th March 2007, 06:28 AM
You could edit your /etc/sysconfig/network-scripts/ifcfg-eth0 and change BOOTPROTO=dhcp to BOOTPROTO=static and reboot. hope that helps

thedon
15th March 2007, 06:13 PM
Well Guys, I read all the replies and I tried each one. Unfortunately it keeps defaulting back. I did the BOOTPROTO=static just now, that didnt work. I did the USERCTL=yes, that didnt work. Each time I would verify that the file had all the right info before rebooting. But when the server comes back up, it pauses at determining IP address then boots back to a DHCP assigned address, different ones each time, and the file goes back to default.

And at home last night, I was able to make these same types of changes on another box that I installed the same way, and those changes stuck.


Im going to do the software updater later and see if that helps.

Iron_Mike
15th March 2007, 07:48 PM
OK, let's try one more thing. Try turning SElinux off. Go to system ->admin ->security and disable SELinux. Make the changes again to your ifcfg-eth and reboot to check if the changes remain...

lazlow
15th March 2007, 08:01 PM
thedon

I had something similar happen when I was trying bonding (it was a while ago). If I remember correctly there are multiple places the the ifcfg-eth0 gets saved. When I tried a simple network restart everything would return to the default state. Make sure that all the files are changed before you restart the network. Apparently some of the files were not being updated or synced until the coumputer was rebooted.

[fred@127 ~]$ locate ifcfg-eth0
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/networking/devices/ifcfg-eth0
/etc/sysconfig/networking/profiles/default/ifcfg-eth0

Lazlow

thedon
15th March 2007, 10:56 PM
lazlow, I looked at those files and after I make the change using the network gui, all of those files say the same thing. When I reboot and the DHCP takes effect again, the main file in the /etc/sysconfig/network-scripts changes back to default and the rest stay with the settings I want.


Iron Mike, I disabled the SE-Linux and it didnt help.


I also just tried to put the server on my T1 connection, a free IP address that I use for the server its going to replace. This time when it rebooted, it came to the point where it says determining IP, and it started pinging 10.1.2.1 which is in the range of IP addresses that it gets from DHCP, and it kept pinging and finally it came up but the eth0 interface didnt come up. Its inactive.
Furthermore, the only difference between this server and the one I got at home is that this one I installed everything, software development, office computer and web server. The one at home I left off the software development.
I plan on taking it home wiping it out and starting over. Ill see if it works at home on my local router with setting my IP address to something like 192.168.1.121, on the linksys. Then if that stays Ill bring it back.
But any other suggestions in the next 2 hours from this post I can try, otherwise Ill update later on. Thanks everybody for replying.

Iron_Mike
16th March 2007, 02:09 AM
OK, this is getting too screwy. Reboot the computer, login as root from login gui, go to system ->administration ->network. Highlight eth0 and select edit, put check marks in the boxes for "allow user to enable/disable, and set static ip. UNCHECK ALL others. Set the ip, netmask and gateway address.

Click OK and highlight eth1 and select edit, and configure it the same as eth0.

Click ok, and close it, it will ask you to save it, and restart networking answer OK. Now go to system ->administration ->services and put check marks in the top 2 services for NetworkManager and NetworkManagerDispatcher and save it. Now do the same for runlevel 3 and save it. Reboot the computer and login as a regular user. Does it work?

thedon
16th March 2007, 03:31 AM
Iron Mike, I got the computer at home and verified its doing the same thing on my linksys router. I did what you explained above, but I dont have a eth1, I only have eth0 and eth0.bak. But after logging in it was still assigned by my router instead of the static one I chose for here at home. Im just gonna wipe it out and try again.

lazlow
16th March 2007, 03:33 AM
Any chance the nic was identifed incorrectly?

thedon
16th March 2007, 05:23 AM
Any chance the nic was identifed incorrectly?


I was thinking it could have something to do with that. But its a built into the motherboard type nic card. nVidia Corporation MCP61 Ethernet is what the software says. I might try installing a free nic Ihave laying around.

Wayne
16th March 2007, 05:32 AM
Perhaps it's a setting in your router that needs changing if it's assigning an IP address via DHCP? Just a WAG!

Wayne

lazlow
16th March 2007, 05:38 AM
My router has a start ip address and a range. I assume that means if I start at .100 and a range of 50 that I would have ips up to .149. Could the address you are trying to assign be beyond your range?

Lazlow

Wayne
16th March 2007, 05:46 AM
My router has a start ip address and a range. I assume that means if I start at .100 and a range of 50 that I would have ips up to .149. Could the address you are trying to assign be beyond your range?

Lazlow

My Linksys router has a page 'DHCP' and there is a setting:

DHCP サーバ: 有効 無効

DHCP Server: Yes No

From what I understand (The firmware is Japanese) if set to 'Yes' it's going to automatically assign an IP address. So, I wonder if that will over-ride the manual settings on the computer?

Wayne

lazlow
16th March 2007, 06:00 AM
Wayne

Could that translate to enable/disable? That is what my linksys has. I have it DHCP set to enable but still asign my IPs static.
Even if it does it could vary from brand to brand or even firmware to firmware.

Lazlow

Wayne
16th March 2007, 06:01 AM
Wayne

Could that translate to enable/disable? That is what my linksys has. I have it DHCP set to enable but still asign my IPs static.
Even if it does it could vary from brand to brand or even firmware to firmware.

Lazlow

Yep, that's how it should translate :D Yes/No was easier to write :p

Wayne

thedon
16th March 2007, 07:29 AM
Hey guys, I got it working. I saw one Lazlow reply earlier about the nic card. SO I went to my kitchen and looked on the dinner table in there, where there was an old netgear nic thats been sitting there forever. I put it in this computer and disabled the onboard lan. I booted it up, and fedora didnt hesitate at all about the new card. It just used that one instead and on my first reboot with a fixed IP it kept it, no problem. I set it here at home to 192.168.1.121 And it stayed. Im thinking it was just the onboard lan causing the problem. Ill find one of those terminator things and that will be the end of it. Thanks for the help guys I really appreciate it.

Instagram Europe | America Instagram Photos | Asia Travel Photos on Instagram