0

I'm trying to set auto static ip. I've set the content of /etc/network/interfaces to be:

auto lo

auto eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1.

and /etc/resolv.conf to be:

nameserver 192.168.1.1.

It seems that the ip address have set successfully. However, when I plug out the lan cable and then plug it back, the ip address is not set. How can I make it automatically set the static ip when the lan cable is connected?

Chris S
  • 77,337
  • 11
  • 120
  • 212
Forge
  • 107
  • 5

1 Answers1

1

Ubuntu workstation or server? In workstation you can right click the networking icon to bring up network connections, wired tab, highlight auto eth0, click edit, and go to ipv4 settings and method manual and enter your settings there.

It looks like there may be some settings that are handled "automagically," otherwise, including changes to the file you're altering. Take a look at this site for instructions: https://help.ubuntu.com/10.04/serverguide/C/network-configuration.html

Bart Silverstrim
  • 31,092
  • 9
  • 65
  • 87