+ -
当前位置:首页 → 问答吧 → About Default route

About Default route

时间:2010-10-15

来源:互联网

debian os 我要将eth1 设为default route 输入
route add default eth1
但是每次重开机时,该设定都会不见。
有办法可以不要每次开机都要再打一次吗??

作者: skyhorus   发布时间: 2010-10-15

丢进/etc/rc.local里面

作者: skyhorus   发布时间: 2010-10-15

其实这问题困扰我很久的原因为Debian /etc 下没有rc.local ,冏。

作者: 阿信   发布时间: 2010-10-15

skyhorus 写:其实这问题困扰我很久的原因为Debian /etc 下没有rc.local ,冏。


hi, Squeeze含以前都有 /etc/rc.local 呢
至於要让eth1变为default route,可以从 /etc/network/interfaces下手

作者: skyhorus   发布时间: 2010-10-15

感谢各位的帮忙,我的/etc 下只有 rc0.d ~ rc5.d 里面有S99rc.local 我是在rc5.d 中的S99rc.local 最后一行加下route add default eth1 就可以了吗?? 另外,目前 /etc/network/interfaces 的内容是

iface eth0 inet static
address 192.168.1.50
netmask 255.255.255.0

auto eth0

iface eth1 inet static
address 10.10.1.2
netmask 255.255.255.0
gateway 10.10.1.2 <---------------------我加上这一行就可以了吗?

auto eth1

作者: 阿信   发布时间: 2010-10-15

skyhorus 写:感谢各位的帮忙,我的/etc 下只有 rc0.d ~ rc5.d 里面有S99rc.local 我是在rc5.d 中的S99rc.local 最后一行加下route add default eth1 就可以了吗??

hi, Debian default runlevel 是 2,可以加在 /etc/rc2.d/S99rc.local。

skyhorus 写:另外,目前 /etc/network/interfaces 的内容是

iface eth0 inet static
address 192.168.1.50
netmask 255.255.255.0

auto eth0

iface eth1 inet static
address 10.10.1.2
netmask 255.255.255.0
gateway 10.10.1.2 <---------------------我加上这一行就可以了吗?

auto eth1


Yes, 这样 default gw 就是走 eth1 了。

作者: skyhorus   发布时间: 2010-10-16

感谢您的指导,受教了。 ^^

作者:   发布时间: 1970-01-01