Tes*_*234 14 networking interface ethernet
尝试在 Ubuntu 12.04 上执行以下操作。
尝试配置 eth0 和 eth1,eth0 工作正常,但无法带 eth1。
以下是设置/etc/network/interfaces:
auto eth0 eth1
iface eth0 inet static
address 172.19.20.186
netmask 255.255.255.252
network 172.19.20.184
broadcast 172.19.20.187
gateway 172.19.20.185
iface eth1 inet static
address 172.18.182.55
netmask 255.255.254.0
gateway 172.18.182.1
up route add -net 172.19.26.0/23 gw 172.19.20.185 dev eth0
up route add -net 172.19.24.0/23 gw 172.19.20.185 dev eth0
up route add default gw 172.18.182.1 dev eth1
Run Code Online (Sandbox Code Playgroud)
当/etc/init.d/networking restart完成后,得到下述错误:
$ /etc/init.d/networking restart
RTNETLINK answers: File exists
Failed to bring up eth1
Run Code Online (Sandbox Code Playgroud)
甚至ifdown eth1并ifup eth1给出上述错误。
任何人都可以帮助解决这个问题吗?
Eri*_*lho 15
我认为您只需要一个默认网关。您已设置 3: gateway 172.19.20.185,gateway 172.18.182.1和up route add default gw 172.18.182.1 dev eth1。
尝试以下接口文件:
auto eth0 eth1
iface eth0 inet static
address 172.19.20.186
netmask 255.255.255.252
iface eth1 inet static
address 172.18.182.55
netmask 255.255.254.0
gateway 172.18.182.1
up route add -net 172.19.26.0/23 gw 172.19.20.185 dev eth0
up route add -net 172.19.24.0/23 gw 172.19.20.185 dev eth0
Run Code Online (Sandbox Code Playgroud)
编辑:试试这个手动配置接口,这样我们就可以看到错误在哪里。
ifconfig eth0 down; ifconfig eth1 down; ifconfig eth2 down; ifconfig eth3 downifconfig eth0 172.19.20.186 netmask 255.255.255.252 upifconfig eth1 172.18.182.55 netmask 255.255.254.0 uproute add default gw 172.18.182.1route add -net 172.19.26.0/23 gw 172.19.20.185 dev eth0route add -net 172.19.24.0/23 gw 172.19.20.185 dev eth0| 归档时间: |
|
| 查看次数: |
219660 次 |
| 最近记录: |