Sunday, March 01, 2009

Static IP configuration on Fedora 10

Until last week Hathway (my ISP in Mumbai) was asking me to do DHCP discovery for IP address. After the n/w stopped working yesterday I called their service rep. One of them couldn't resolve it yesterday, so he forwarded me to another guy who turned out to be a funny experience - he gave me all the static IP config valus - and when the network still won't work he started blaming it on computer virus and ultimately rust on my network cable (!) Fortunately for me (and also for him) the modem was little sluggish in picking up the change and the network started working.

I had booted my new computer in Vista (yeah I know! argh!) and it worked fine. Surprisingly my Fedora 10 on Macbook and also the Fedora 10 on desktop won't respond to the static IP information. It took me 4 hours to figure out that there was nothing wrong in my knowledge of the network scripts. I got the clue when I found the system doing DHCP discovery even when I had set it to static IP. I figured it was because of the NetworkManager (seen as that taskbar network icon). When I googled, it became clear that configuring Fedora 10 with static IP is a known problem and the culprit is NetworkManager and/or system-config-network utility. This thread (#14) is pretty much helpful, but the working solution (or workaround) is not definite.

Here is what worked for me (at least for this box).

# Stop NetworkManager
sudo service NetworkManager stop

# Disable NetworkManager service
sudo chkconfig NetworkManager off

# Enable netwok service
sudo chkconfig network on

# Run system-config-network
# Edit the ethernet device under Device tab
# Under "Manual IP Address settings" put static IP Address.
# Leave Subnet mask and Default Gateway blank
# Change to Route tab
# Add route Dest 0.0.0.0 Netmask 0.0.0.0 Gateway
# Add route Dest Netmask Gateway
# Change to DNS tab to put addresses of DNS servers
# Check "Activate device when computer starts" same as ONBOOT=yes (I guess)
# Save the settings

sudo service network restart

At this point network should be working. If it doesn't don't get surprised. The same steps don't help me setup my Macbook Fedora 10 with static IP. Maybe I have screwed it beyond repair. I will wait for the router to arrive, to get my macbook online.



Ads:
Linux Administration Handbook (2nd Edition) (Best tips on Linux administration I found in this book. Own it myself.)
Fedora Bible 2010 Edition: Featuring Fedora Linux 12
Linux Networking Cookbook

9 comments:

Jayesh said...

Looks like some parts in the instructions etween "< >" were eaten by the blogspot editor automatically.

Sorry for that!

Suresh said...

Had the same problem with the latest Ubuntu. I believe the problem is with the new gnome NetworkManager.

Suresh said...

I guess you could try uninstalling the gnome network manager and using wicd instead.

Jayesh said...

wicd does have nice GUI. tried it just now, worked on my wifi; will try later with the static IP. Thanks.

Anonymous said...

Any word on wicd working with static ip in fedora? I've been having the same issue after upgrading to core 10.

Jayesh said...

Tried wicd on my laptop for static configuration. It didn't work. I shows the wired network is connected, but no answer to pings to the gateway server. Very likely I have screwed the wired setting of my laptop F10 beyond repair. Thankfully my PC F10 can connect without any problems.

Anonymous said...

Sorry to hear wicd didn't work =(. Luckily though your work around fixed it for me. Thank you very much!

Anonymous said...

I found a solution! =D Go to System -> Admin. -> Network and edit your device click "Allow all users to enable and disable this device" under Manual IP enter desired address but leave subnet and gateway blank.

Switch to route tab

Add route Dest Netmask Gateway

(I didn't have to put in a 0.0.0.0 entry)

save settings then right click network manager icon in and select "Edit Connections" choose device from list and click edit. Under IPv4 Settings tab enter Address, Netmask, Gateway, and DNS servers. Then hit apply.

I didn't even have to restart, just reconnect to my network and it works perfectly!

Anonymous said...

"I didn't even have to restart, just reconnect to my network and it works perfectly!"

That's where the funny point is. After reconfiguring my Fedora 10 to use static IP, it works perfectly at once. However, if I restart the system, either it forgets all about the config, or the network interface is completely missing.