0

i'm trying to change a static ip assigned to a debian VM. I modified the /etc/network/interfaces file but my debian doesn't seem to like the new settings

currently the machine's ip is set to 192.168.1.136 and i want the machine's ip to be set to 192.168.1.8

here's my modified /etc/network/interfaces :

auto lo
iface lo inet loopback

allow-hotplug eth0

auto eth0
iface eth0 inet static
address 192.168.1.8
gateway 192.168.1.1
netmask 255.255.255.0
Khaled
  • 36,533
  • 8
  • 72
  • 99
  • The configuration seems OK. Did you restart your network using `sudo /etc/init.d/networking restart`? – Khaled Dec 22 '10 at 10:16

3 Answers3

1

The Debian way to reloading the networking configuration is :

/etc/init.d/networking restart as root

Antoine Benkemoun
  • 7,314
  • 3
  • 42
  • 60
  • except, the script says "force-reload|restart) \n Running $0 $1 is deprecated because it may not enable again some interfaces" – stew Jan 13 '11 at 04:29
0

Try

ifdown eth0 ; ifup eth0

to "reload" network config. Or just reboot machine. Also, Debian (and a lot of other distros) by default "binds" given interface MAC to interface name using udev (/etc/udev/rules.d/70-persistent-net.rules) so if you changed MAC of machine correct interface will be eth1 (to "undo it", remove that udev file)

XANi
  • 391
  • 1
  • 3
0

Maybe the interface name is not eth0 anymore? Try the following to learn about your interface names:

# ifconfig | grep ^eth

If necessary, change the configuration in /etc/networking/interfaces and restart network:

# /etc/init.d/networking restart

(as root)

sw0x2A
  • 216
  • 1
  • 4