sudo /etc/init.d/networking restart * Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces * Reconfiguring network interfaces... ssh stop/waiting ssh start/running, process 20418 RTNETLINK answers: File exists Failed to bring up eth0:0. RTNETLINK answers: File exists Failed to bring up eth0:1. RTNETLINK answers: File exists Failed to bring up eth0:2.
我无法从外部访问我的networking。 但是在本地访问它没有问题。 我能ping通我用来远程访问的IP地址。
这是我的etc/network/interfaces
auto eth0 iface eth0 inet static address 192.168.1.200 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.1 auto eth0:0 iface eth0:0 inet static address 192.168.2.200 netmask 255.255.255.0 network 192.168.2.0 broadcast 192.168.2.255 gateway 192.168.2.1 auto eth0:1 iface eth0:1 inet static address 192.168.3.200 netmask 255.255.255.0 network 192.168.3.0 broadcast 192.168.3.255 gateway 192.168.3.1 auto eth0:2 iface eth0:2 inet static address 192.168.4.200 netmask 255.255.255.0 network 192.168.4.0 broadcast 192.168.4.255 gateway 192.168.4.1
networking工具是邪恶和神秘的(我最近很多)。 这也是古老的,其过时的命名惯例已经使你困惑。
“子接口”0(它们不是真正的子接口)是根接口的别名,因此当您为eth0:0设置接口时,它与eth0的设置冲突。 这不是你的错误的原因,但它会给你后来的痛苦,因为它无声地replace192.168.1.200/24 192.168.1.200/24。
我怀疑你看到的错误发生在autoconfig脚本尝试添加多个仅在网关不同的默认路由时。 您不需要所有这些默认路由。 然而,如果你想要他们,你需要以某种方式指定(至less)一个指标,你不能使用这个文件。 dev eth0上的路由将自动添加到您的每个子网。 您只需要一条默认路由即可发送其他stream量。 路由相同的一个原因是它们都与eth0相关联,因为子接口并不是真正的子接口。
我在Ubuntu 12.04中遇到了同样的问题
我使用下面的命令来查找我的networking接口
设置networking时,您需要知道计算机上的networking接口卡。 不同厂商的接口名称可能会有所不同,这就是为什么需要这一步。
ls /sys/class/net
那么你可以用你的组织networking信息根据上面的结果编辑/etc/network/interface ,然后你可以使用下面的命令把你的networking接口
ifconfig eth1 down && ifconfig eth1 up
要么
/etc/init.d/networking/restart