【问题标题】:How to set up multiple network interfaces on ubuntu server. [RTNETLINK answers: File exists]如何在 ubuntu 服务器上设置多个网络接口。 [RTNETLINK 回答:文件存在]
【发布时间】:2014-11-06 11:25:11
【问题描述】:

接口文件

auto eth0
iface eth0 inet dhcp
        up route add 192.168.11.2 dev eth0
        up route add default gw 192.168.11.2 dev eth0

auto eth1
iface eth1 inet static
        address 10.95.163.14
        netmask 255.255.255.0
        up route add 172.16.0.0/16 via 10.95.163.1 dev eth1

问题

sudo /etc/init.d/networking restart 

RTNETLINK answers: File exists

Failed to bring up eth1.

用法

eth0 is used for internet access
eth1 is used for communicate within 2 internal networks

解决方法现在我需要手动添加路线

sudo ip route add 172.16.0.0/16 via 10.95.163.1 dev eth1

问题

  1. 我的配置有问题吗
  2. 有没有更好的解决方案

【问题讨论】:

  • 没有人回答这个问题吗?

标签: ubuntu configuration routing gateway ubuntu-server


【解决方案1】:

您应该使用以下方式重新启动每个界面:

ifdown -v ethX
ifup -v ethX

这样您将看到失败的确切命令。

通过快速阅读您的配置,我可以想象一个问题是您的 DHCP 服务器正在向您发送这些路由之一,然后您尝试再次添加它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-07-18
    • 1970-01-01
    • 2015-06-03
    • 2014-07-29
    • 1970-01-01
    • 1970-01-01
    • 2018-12-11
    • 1970-01-01
    相关资源
    最近更新 更多