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
link|improve this question
The configuration seems OK. Did you restart your network using sudo /etc/init.d/networking restart? – Khaled Dec 22 '10 at 10:16
feedback

3 Answers

The Debian way to reloading the networking configuration is :

/etc/init.d/networking restart as root

link|improve this answer
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 4:29
feedback

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)

link|improve this answer
feedback

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)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.