Static IP addresses fail!

NoOp glgxg at sbcglobal.net
Fri Jul 22 17:33:48 UTC 2011


On 07/22/2011 02:04 AM, don fisher wrote:
...
> Attached is my /etc/network/interfaces file. Using WICD I can get either 
> port to come up using DHCP. But I cannot get eth1 or eth0 to load with a 
> static address (using WICD).
> 
> I used to use ifup and ifdown. But ifup eth1 does nothing. When I 
> execute sudo ifup eth1 I receive the output from ifconfig --help.
> 
> I must have broken something. But I cannot determine what it is. Any 
> errors in my interfaces file?
> 
> Any ideas appreciated? I was just trying to bring up Samba, which was 
> almost trivial the last time (back in the dark ages) when I tried.

This works for me:
====
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.4.9
netmask 255.255.255.0
gateway 192.168.4.1
mtu 1492
====

I just modified /etc/network/interfaces to the above (I had it set to
another address via network manager before modifying) & restarted
networking:

$ sudo /etc/init.d/networking restart

$ ifconfig
eth0      Link encap:Ethernet  HWaddr <snipped>
          inet addr:192.168.4.9  Bcast:192.168.4.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:f1ff:feba:291f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1492  Metric:1
          RX packets:17689 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9697 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:21940759 (21.9 MB)  TX bytes:1244702 (1.2 MB)

And now I modify the file and use the settings that I have in Network
Mangager (static address):

====
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface

auto lo
iface lo inet loopback
====

And start and stop networking via Network Manager:

$ ifconfig
eth0      Link encap:Ethernet  HWaddr <snip>
          inet addr:192.168.4.100  Bcast:192.168.4.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:f1ff:feba:291f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1492  Metric:1
          RX packets:17971 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10162 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:22017895 (22.0 MB)  TX bytes:1327781 (1.3 MB)

See:
https://help.ubuntu.com/10.10/serverguide/C/network-configuration.html

Also ensure that you have _either_ wicd or network manager, but not
both. Purge one or the other *after* you've entered the settings for the
one you want to keep.

For wicd you don't need to configure /etc/network/interfaces, wicd will
do that for you. Network Manager only looks for

auto lo
iface lo inet loopback

and ignores the rest - NM uses it's own settings (still somewhat a
mystery to me).

Note: in the past I'd always used wicd. However, since 10.10 I've found
Network Manager to work well, so I purged wicd & now use NM.





More information about the ubuntu-users mailing list