我有很多ip-s路由到我的专用服务器。 接口文件看起来像这样
auto lo iface lo inet loopback auto eth0 iface eth0 inet static address xx.xx.xx.xx netmask 255.255.255.xx gateway xx.xx.xx.xx auto eth0:0 iface eth0:0 inet static address xx.xx.xx.xx netmask 255.255.255.xx auto eth0:1 iface eth0:1 inet static address xx.xx.xx.xx netmask 255.255.255.xx auto eth0:2 iface eth0:2 inet static address xx.xx.xx.xx netmask 255.255.255.xx
当我键入terminal/etc/init.d/networking重新启动时,我得到这个错误许多次(我认为这个错误是每个ip我尝试分配)
RTNETLINK answers: No such process SIOCSIFFLAGS: Cannot assign requested address
我必须等待几秒钟,之后,每一件事都符合我的configuration,但如何释放这个错误?
安德鲁
您可以尝试将多个地址分配给单个接口,而不是使用伪接口。 喜欢这个:
auto eth0 iface eth0 inet static address <ip1> netmask <netmask1> gateway <some_gateway> up ip addr add <ip2>/<netmask2> dev eth0 up ip addr add <ip3>/<netmask3> dev eth0
等等
这里<netmask2>和<netmask3>是以“二进制数”的forms。 因此,例如地址192.168.0.5/24对应于192.168.0.5 ,networking掩码为255.255.255.0因为在这个networking掩码中有二进制格式的24 1。 如果遇到麻烦,请使用http://jodies.de/ipcalc 。