我试图改变一个静态IP分配给一个debian虚拟机。 我修改了/ etc / network / interfaces文件,但我的debian似乎不喜欢新的设置
目前该机器的ip被设置为192.168.1.136,我希望机器的ip被设置为192.168.1.8
这里是我修改的/ 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
Debian重新加载networkingconfiguration的方法是:
/etc/init.d/networking restart以root身份/etc/init.d/networking restart
尝试
ifdown eth0 ; ifup eth0
重新加载“networkingconfiguration。 或者只是重启机器。 此外,Debian(和许多其他发行版)默认使用udev(“/etc/udev/rules.d/70-persistent-net.rules”)将给定的接口MAC“绑定”到接口名称,所以如果您更改了机器的MAC地址界面将eth1(“撤消它”,删除该udev文件)
也许接口名称不是eth0了? 请尝试以下内容来了解您的界面名称:
# ifconfig | grep ^eth
如有必要,请更改/ etc / networking / interfaces中的configuration并重新启动networking:
# /etc/init.d/networking restart
(作为根)