2016-12-20 132 views
2

我想在已經有enp1s0接口的ubuntu-server 16.10上設置一個ppp接口。當我刪除鏈接到接口enp1s0的默認路由時,我可以使用ppp0接口,但我想同時使用這兩個接口。ppp0接口使用eth0接口

爲了實現我在/ etc/iproute2/interface中添加了名爲ppp的路由表。然後創建一個路由策略表PPP如下:

ip route add 100.78.26.0/24 dev ppp0 src 100.78.26.117 table ppp 
ip route add default via 100.78.26.117 dev ppp0 table ppp 
ip rule add from 100.78.26.117/32 table ppp 
ip rule add to 100.78.26.117/32 table ppp 

的路由進行設置。問題是,接口ppp0已打開,但通過接口enp1s0連接到Internet。

有路線-n的結果:

Destination  Gateway   Genmask   Flags Metric Ref Use Iface 
0.0.0.0   192.168.1.1  0.0.0.0   UG 0  0  0 enp1s0 
10.64.64.64  0.0.0.0   255.255.255.255 UH 0  0  0 ppp0 
192.168.1.0  0.0.0.0   255.255.255.0 U  0  0  0 enp1s0 

這是IP路由表顯示所有的結果:

default via 100.78.26.117 dev ppp0 table ppp 
100.78.26.0/24 dev ppp0 table ppp scope link src 100.78.26.117 
default via 192.168.1.1 dev enp1s0 
10.64.64.64 dev ppp0 proto kernel scope link src 100.78.26.117 
192.168.1.0/24 dev enp1s0 proto kernel scope link src 192.168.1.39 
local 100.78.26.117 dev ppp0 table local proto kernel scope host src 100.78.26.117 

我需要一些幫助,使這兩個接口同時工作。

PS:這是PPP配置腳本:

nodetach 
nolock 
/dev/ttyUSB7 
115200 
local 
asyncmap 0 
user "" 
password "" 
crtscts 
modem 
hide-password 
usepeerdns 
noauth 
noipdefault 
novj 
novjccomp 
noccp 
debug 
defaultroute 
ipcp-accept-local 
ipcp-accept-remote 
connect 'chat -s -v -f /etc/ppp/peers/free-chat-connect' 
+0

如果這是一個系統管理問題而不是編程問題,它可能更適合[superuser.com](https://superuser.com/questions/tagged/ubuntu)。 – dbc

回答