LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   IP Address Not Being Set Correctly At Startup ie According to sysconfig-eth0 (https://www.linuxquestions.org/questions/linux-networking-3/ip-address-not-being-set-correctly-at-startup-ie-according-to-sysconfig-eth0-579181/)

jogjayr 08-23-2007 05:25 AM

IP Address Not Being Set Correctly At Startup ie According to sysconfig-eth0
 
I have set my IP address as 192.168.0.11 (Fedora 7). This change is reflected in the relevant config files. But whenever i reboot my machine and check the IP using ifconfig, it shows an IP like 169.whatever. I have to set it manually every time. The interface card configuration dialog box, however, still shows the 192. address.
Changing the address by using ifconfig eth0 only works for that session. The IP needs to be reset the next time i boot up.
What could the problem be?

kilgoretrout 08-23-2007 09:37 AM

Post your /etc/sysconfig/network-scripts/ifcfg-eth0 file. That's the configuration file for eth0. The gui tools just automatically edit that file. It's probably setup with dhcp enabled by mistake.

jogjayr 08-26-2007 01:01 AM

I'm at home right now and I'm working on fedora 7 on a computer in college. I can't post the ifcfg-eth0 file right now (since i don't have it right now) but I had recognised that DHCP being enabled might be a prob whn i posted my question. I checked too and i believe it wasn't enabled but i'll post the file in a coupla days, just to be sure, when i go back to college. Anything else that could be wrong, assuming DHCP is disabled? Thanks for the help so far...

soroccoheaven 08-26-2007 01:30 AM

Quote:

Originally Posted by jogjayr (Post 2867854)
I have set my IP address as 192.168.0.11 (Fedora 7). This change is reflected in the relevant config files. But whenever i reboot my machine and check the IP using ifconfig, it shows an IP like 169.whatever. I have to set it manually every time. The interface card configuration dialog box, however, still shows the 192. address.
Changing the address by using ifconfig eth0 only works for that session. The IP needs to be reset the next time i boot up.
What could the problem be?

hello..
if you are getting IP as 169.x.x.x. means your fedora failed to get an IP this may be due to NIC malfunctioning/configuraton essue/IP conflict check the last one if you feels others two are fine and try to get iP by dhcp server.

were you able to connect after manually allocation ?

jogjayr 08-29-2007 01:21 PM

Here is the ifcfg-eth0 file....

# Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:14:85:e7:20:14
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=192.168.0.11
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes


Does this show that dhcp is enabled?? And in response to the other query, yes everything works fine after manual allocation. But since I'm running NFS and NIS, this isn't an acceptable solution. This problem is cropping up on the NIS client. The NIS server works perfectly fine. Its IP is set correctly at startup. Thanks a lot for all the help.

rossonieri#1 08-29-2007 09:34 PM

hi,

change that bootproto=static ---> bootproto=dhcp
and make sure your DHCP server has enough ip address pool to distribute.

HTH.

jogjayr 08-30-2007 12:03 AM

Resolved: Thanks
 
I turned off dhcbd and Network Manager on both client and server. Apparently, Network Manager assigns its own IP address if left on. And dhcbd is the dhcp daemon. Thanks for all the help guys.

jakykong 08-30-2007 02:58 AM

Quote:

Originally Posted by soroccoheaven (Post 2870868)
hello..
if you are getting IP as 169.x.x.x. means your fedora failed to get an IP this may be due to NIC malfunctioning/configuraton essue/IP conflict check the last one if you feels others two are fine and try to get iP by dhcp server.

were you able to connect after manually allocation ?

169.x.x.x is windows' APIPA "Automatic Private IP Adressing" -- basically, if no dhcp server can be reached (in this case, that translates to there is no DHCP server), then a semi-random IP address from the 169.16.0.0 network is selected (i may be wrong about the .16, but being class B, there is a second number), and a simple RARP is used to determine if it's used.

I believe the intention here is to use static IP addressing. That a static IP has been intentionally set tells me he doesn't WANT dhcp at all.

Check your startup scripts for any lines containing dhclient -- it's conceivable that some startup script is calling dhclient, since your configuration seems correct. This truly is blind speculation, but it's worth a shot -- at least we can rule that out.

Unless fedora uses a different init than the standard sysV init, startup scripts are in /etc/init.d, and /etc/rc*.d (although the rc*.d directories usually contain links, not files, it's worth scanning them anyway).

Just run something like:

grep dhclient /etc/*.d/*

and grep will tell you what file it's in.


All times are GMT -5. The time now is 03:21 PM.