Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Folks, I am trying to use fixed IP on few Linux boxes in my LAN which uses DHCP right now.

My ISP router is configured to use DHCP and there already are quite a few laptop users who would want to continue using DHCP. However I want a set of 4-5 desktops to have a fixed IP so that I don't have to go to the machine's physical location and find its IP everytime it reboots. My ISP router's DHCP configuration does not have a bind MAC Address to fixed IP option. One of my colleagues claims that he was able to do that in a Windows 7 machine by specifying the fixed IP in network configuration. The Linux boxes are using Fedora Core 14.

Is there a way I can configure the Linux boxes to use a fixed IP everytime they boot up? I don't want to use a custom DHCP server on one of the boxes because that will be an extra point of failure for the network. Using an extra switch etc will not be favorable either, since it looks like Windows can use fixed IP without requiring that.

PS. I have tried adding a file with static IP data in /etc/sysconfig/network/ as mentioned in some internet forums, also tried "ifconfig eth0 ". This makes the IP stick but the network stops working. I guess the new version of Fedora Core could be a reason these slightly old forum posts are not providing the right direction.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

first result from google search for: static ip fedora 14

http://www.liberiangeek.net/2011/02/configure-a-static-ip-address-in-fedora-14-laughlin/

quickly if you know how to use text editors etc:

as root edit the following file: /etc/sysconfig/network-scripts/ifcfg-Auto_eth0

change the line BOOTPROTO to static

then add the following to the bottom (edit the values for your local network setup - be sure to choose an IP out of the range of addresses that the dhcp server assigns but within the same subnet)

IPADDR=IP_Address
NETMASK=Net_Mask
BROADCAST=Broadcast IP
NETWORK=Network IP
GATEWAY=Gateway IP

save the file then run the following with root privileges or with sudo

/etc/init.d/network restart

then enjoy :)

share|improve this answer
    
This should work. Make sure you edit your DHCP servers configuration to not give out the IP addresses you statically assign. –  sciurus May 3 '11 at 3:17
    
While the file /etc/sysconfig/network-scripts/ifcfg-Auto_eth0 did not existed. I created it with the content mentioned on that page and it worked. –  aditya May 3 '11 at 6:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.