PDA

View Full Version : Errors with Ubuntu static IP, when restarting the computer


ashley velez
Dec 10, 2008, 09:48 AM
I have a PC with the ubuntu OS

I am having errors with setting a static IP.
I will set the static IP by editing the interfaces file to say:


Auto lo
Iface lo inet loopback

Auto eth0
Iface eth0 inet static
Address 10.66.30.101
Netmask 255.255.0.0
Broadcast 10.66.255.255
Gateway 10.66.30.1


The I restart the networking by, /etc/init.d/networking restart
That works with no errors,
Then I run the command /sbin/ifconfig to see if that changes took effect, that works without any problems
I'll have internet access

Then when I restart my PC, I no longer have internet access.

I also tried something I saw in a forum that said to run the command
Apt-get remove network-manager-gnome, then set the static ip, and it should work upon restart, but that didn't work either
Does anyone have any ideas or know the solution?



I also just tried setting an alias, I still have internet connectivity, but the alias didn't take, it still shows me as just the orig. ip,
I tried creating the alias by editing /etc/dhcp3/dhclient.conf

I uncommented the alias section and filled it in to my requirements, so it looks like this

Alias {interface "eth0";
Fixed-address 10.66.30.101;
Option subnet-mask 255.255.0.0;}

Then restarted networking, no errors, but still no ip of 10.66.30.101

ashley velez
Dec 10, 2008, 02:19 PM
I solved this problem, by setting an alias instead of a static IP. So no matter what the IP address changes to, you will always see the computer as the alias IP address.

Go to /etc/network/interfaces , edit this file to say
(changing the ip and subnet to what you need)


Auto lo
Iface lo inet loopback

Auto eth0
Iface eth0 inet dhcp

Auto eth0:0
Iface eth0:0 inet static
Name Ethernet alias LAN card
Address 10.66.30.101
Netmask 255.255.0.0
Broadcast 10.66.255.255

Then /etc/init.d/networking restart

ashley velez
Dec 10, 2008, 02:20 PM
If you have 2 NIC's like me and need 2 static IPs write this in the interfaces file, of course editing it with your address


Auto lo
Iface lo inet loopback

Auto eth0
Iface eth0 inet dhcp

Auto eth0:0
Iface eth0:0 inet static
Name Ethernet alias LAN card
Address 10.66.30.101
Netmask 255.255.0.0
Broadcast 10.66.255.255

Auto eth1
Iface eth1 inet dhcp

Auto eth1:1
Iface eth1:1 inet static
Name Ethernet alias LAN card
Address 10.66.30.102
Netmask 255.255.0.0
Broadcast 10.66.255.255