我有一个Debian 7服务器和一个可用的IP地址范围从xx.xx.xx.90到93.当通过/ etc / network / interfaces设置可用地址时,我有以下几点:
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address xx.xx.xx.90 netmask 255.255.255.248 network xx.xx.xx.88 broadcast xx.xx.xx.95 gateway xx.xx.xx.89 # Example extra IP comment up ip addr add xx.xx.xx.91/24 dev eth0 label eth0:0 down ip addr del xx.xx.xx.91/24 dev eth0 label eth0:0 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers xx.xx.xx.xx xx.xx.xx.xx dns-search host.xx.xx
“示例额外IP注释”下方的两行对应于我要添加的新IP(对于范围的其余部分将是类似的)。
当保存上述并通过sudo ifdown eth0 && sudo ifup eth0重新启动联网时,我收到以下消息:
ifdown: interface eth0 not configured RTNETLINK answers: File exists Failed to bring up eth0.
我不明白为什么报告eth0没有configuration,为什么没有configuration。
任何帮助将不胜感激。
更新我使用了sudo ifdown --force eth0 && sudo ifup --force eth0而不是按照Zoredache的build议,解决了问题。
您被分配了/29块,而不是/24 。 但是你在down脚本中指定了/24 。 先尝试修复。
更好的是,使用指定地址的新方法(以及最近几次发布的新版本)。
allow-hotplug eth0 iface eth0 inet static address xx.xx.xx.90 netmask 255.255.255.248 network xx.xx.xx.88 broadcast xx.xx.xx.95 gateway xx.xx.xx.89 iface eth0 inet static address xx.xx.xx.91 netmask 255.255.255.248 iface eth0 inet static address xx.xx.xx.92 netmask 255.255.255.248 iface eth0 inet static address xx.xx.xx.93 netmask 255.255.255.248
它看起来像你的格式是有点closures。 尝试这样的事情:
auto eth0 iface eth0 inet static address xxx90 auto eth0:1 iface eth0:1 inet static address xxx91
如果您希望NetworkManager处理在/ etc / network / interfaces中启用的接口:在/etc/NetworkManager/NetworkManager.conf中设置managed = true。
重新启动NetworkManager:
# /etc/init.d/network-manager restart
然后重启
# reboot
来源: https : //wiki.debian.org/NetworkManager
addresses 10.0.0.1/8 192.168.10.4/24
使用地址范围。