【问题标题】:Alternative gateway on ubuntuubuntu 上的替代网关
【发布时间】:2015-05-15 15:02:59
【问题描述】:

我有一张 LAN 卡。我已将其划分为子接口。有没有解决方案在这个接口上有不同的工作网关?我希望当 PC 无法使用第一个网关到达目的地时,它应该通过辅助网关。我使用 Ubuntu 14.04。这是我的界面配置:

auto eth0
iface eth0 inet static
address 10.0.0.25
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
gateway 10.0.0.88
dns-nameservers 8.8.8.8 8.8.4.4

#sub interface
auto eth0:1
iface eth0:1 inet static
address 10.0.0.26
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
gateway 10.0.0.99

【问题讨论】:

    标签: ubuntu-14.04 ethernet gateway


    【解决方案1】:

    你可以做路线。这些路由作为网关工作,但它们只在一个季节工作,如果你关闭你的计算机,这些路由就会消失。 要永远执行路由,您需要创建一个带有路由命令的脚本并移至 init.d:

    sudo mv /home/usuar/script.sh /etc/init.d/

    sudo chmod +x /etc/init.d/script.sh

    sudo update-rc.d script.sh 默认

    并删除脚本

    sudo update-rc.d -f script.sh 删除

    然后删除脚本

    sudo rm /etc/init.d/script.sh

    【讨论】:

    • 路由在网关处有效,可能故障出在网关、硬件、连接......连接问题可能是一千个问题。尝试隔离问题
    猜你喜欢
    • 2014-12-29
    • 2011-10-10
    • 1970-01-01
    • 1970-01-01
    • 2012-08-10
    • 1970-01-01
    • 2019-10-20
    • 2011-05-15
    • 2011-02-19
    相关资源
    最近更新 更多