我在一个 Arch Linux 机器上,通过 3G USB 记忆棒 (ttyUSB0) 使用工作 ETH0(固定 IP)和 PPP 连接。重启后,ETH0 工作正常。建立 PPP 连接也可以正常工作。但是在使用 'poff' 取消 PPP 连接后,我没有再次获得默认路由。我知道如何手动设置默认路由,但是由于 linux 机器将在各种网络中注册,我必须找到一个在使用 PPP 连接后自动获取默认路由的过程。
ETH0 在 /etc/conf.d/net-conf-eth0 中配置:
address = 10.0.1.30
netmask = 24
broadcast = 10.0.1.255
gateway = 10.0.1.1
PPP是使用设置的
pacman -S ppp
...以及以下配置文件:
/etc/ppp/ip-pre-up
#!/bin/sh
/usr/bin/route del default
/etc/ppp/options-mobile
ttyUSB0
921600
lock
crtscts
modem
passive
novj
defaultroute
noipdefault
usepeerdns
noauth
hide-password
persist
holdoff 10
maxfail 0
debug
PPP连接前的路由表:
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default router.intern 0.0.0.0 UG 0 0 0 eth0
default router.intern 0.0.0.0 UG 1024 0 0 eth0
10.0.1.0 * 255.255.255.0 U 0 0 0 eth0
router.intern * 255.255.255.255 UH 1024 0 0 eth0
PPP连接成功后的路由表:
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.1.0 * 255.255.255.0 U 0 0 0 eth0
router.intern * 255.255.255.255 UH 1024 0 0 eth0
我错过了什么?