View Full Version : [ubuntu] Making ethernet static ip automatically
tenmilez
February 20th, 2009, 10:37 PM
No matter what I try whenever I restart my computer the ethernet connection resets to eth0 with default settings. What I want is to have it default to a static ip configuration.
ddnev45
February 20th, 2009, 11:03 PM
I had to edit the /etc/network/interfaces file by hand (as root).
You can do:
man interfaces
in a teminal for all the details; I attached the examples that can be found in: /usr/share/doc/ifupdown/examples/network-interfaces.
The example:
# An example ethernet card setup: (broadcast and gateway are optional)
#
# auto eth0
# iface eth0 inet static
# address 192.168.0.42
# network 192.168.0.0
# netmask 255.255.255.0
# broadcast 192.168.0.255
# gateway 192.168.0.1
sets up eth0 for a static ip (remember to remove the #'s in your actual file).
Iowan
February 21st, 2009, 05:57 PM
Try this (http://www.prash-babu.com/2008/11/how-to-setup-static-ip-address-in-linux.html) one. Another option (http://ubuntuforums.org/showpost.php?p=6774735&postcount=3) is to un-install Network Manager, and re-install the older version.
lensman3
February 21st, 2009, 07:28 PM
I had to uninstall NetworkManager so that it didn't install and run at ALL the run-levels. Then I had to hook up the network script and have it installed at run-level 2,3 & 5. NetworkManager doesn't work at all for static IPs.
The gui interface also had trouble setting the network mask. It set mine to 255.255.255.255, which won't and didn't work. I had to hand edit the file in /etc/system/network_interface to 255.255.255.0.
I had to do the above for a dual Ethernet Linux firewall for both interfaces. I setup the Internet side Ethernet card to use "network" and to get a DHCP address from my providers servers.
Hope this helps. The NetworkManager is not ready for prime time. It needs a static option.
lynnevan
February 21st, 2009, 08:53 PM
No matter what I try whenever I restart my computer the ethernet connection resets to eth0 with default settings. What I want is to have it default to a static ip configuration.
You not the only one w/ this problem. Maybe some clues here?
http://ubuntuforums.org/showthread.php?t=1076221&highlight=kill+dhcp
lynnevan
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.