Linux pppd 失败但 NetworkManager 可以运行

Linux pppd 失败但 NetworkManager 可以运行

因此,我尝试使用 Ubuntu 16.04 通过 pppd 将我的 PtP 调制解调器“Telit ME910”连接到 Verizon LTE 网络。

如果我将其连接起来并执行“启用移动宽带”的标准网络管理器步骤,它将找到默认 APN 并列出它,这样我就可以选择“Verizon 4G LTE Con​​tract 1”,然后它就可以完美连接。它创建了带有 IP 的 ppp0 接口,然后我可以成功 PING 8.8.8.8。

如果我将其连接起来并发出“pppd call verizon”,它将创建具有 IP 的 ppp0 接口,但 PING 失败?我知道 ModemManager 和 NetworkManager 比 pppd 做的更多,但我无法找出我遗漏了什么。任何帮助都将非常有帮助。

在 /etc/ppp/peers/verizon 中:

/dev/ttyUSB1
115200
connect "/usr/sbin/chat -v -f /etc/ppp/peers/verizon-chat"
noauth
#nodefaultroute

defaultroute
replacedefaultroute
usepeerdns

local
debug
persist

#updetach
nodetach

工作连接的详细信息:

# ip route show table all
default dev ppp0  proto static  scope link  metric 700 
169.254.0.0/16 dev ppp0  scope link  metric 1000 
local 100.124.161.186 dev ppp0  table local  proto kernel  scope host  src 100.124.161.186 
broadcast 100.124.161.186 dev ppp0  table local  proto kernel  scope link  src 100.124.161.186 
broadcast 127.0.0.0 dev lo  table local  proto kernel  scope link  src 127.0.0.1 
local 127.0.0.0/8 dev lo  table local  proto kernel  scope host  src 127.0.0.1 
local 127.0.0.1 dev lo  table local  proto kernel  scope host  src 127.0.0.1 
broadcast 127.255.255.255 dev lo  table local  proto kernel  scope link  src 127.0.0.1 
unreachable default dev lo  table unspec  proto kernel  metric 4294967295  error -101 pref medium
local ::1 dev lo  table local  proto none  metric 0  pref medium
ff00::/8 dev eno1  table local  metric 256 linkdown  pref medium
unreachable default dev lo  table unspec  proto kernel  metric 4294967295  error -101 pref medium

ppp0      Link encap:Point-to-Point Protocol  
          inet addr:100.113.251.242  P-t-P:0.0.0.0  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:260 errors:0 dropped:0 overruns:0 frame:0
          TX packets:301 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:82504 (82.5 KB)  TX bytes:62112 (62.1 KB)

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         U     700    0        0 ppp0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 ppp0

系统日志在此:工作系统日志

连接失败的详细信息:

# ip route show table all
default dev ppp0  scope link 
10.64.64.64 dev ppp0  proto kernel  scope link  src 100.122.108.86 
local 100.122.108.86 dev ppp0  table local  proto kernel  scope host  src 100.122.108.86 
broadcast 127.0.0.0 dev lo  table local  proto kernel  scope link  src 127.0.0.1 
local 127.0.0.0/8 dev lo  table local  proto kernel  scope host  src 127.0.0.1 
local 127.0.0.1 dev lo  table local  proto kernel  scope host  src 127.0.0.1 
broadcast 127.255.255.255 dev lo  table local  proto kernel  scope link  src 127.0.0.1 
unreachable default dev lo  table unspec  proto kernel  metric 4294967295  error -101 pref medium
local ::1 dev lo  table local  proto none  metric 0  pref medium
ff00::/8 dev eno1  table local  metric 256 linkdown  pref medium
unreachable default dev lo  table unspec  proto kernel  metric 4294967295  error -101 pref medium

ppp0      Link encap:Point-to-Point Protocol  
          inet addr:100.122.108.86  P-t-P:10.64.64.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:38 (38.0 B)  TX bytes:2065 (2.0 KB)

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0
10.64.64.64     0.0.0.0         255.255.255.255 UH    0      0        0 ppp0  

系统日志在此:失败的系统日志

任何提示或建议都非常感谢。我甚至手动更改了 ppp0 的路由表和接口设置,以便它们与我使用 GUI(NetworkManager)时看到的内容完全匹配,但它仍然拒绝允许在 ppp0 上进行简单的 PING 8.8.8.8。因此显然有一些网络细节没有被标准“ifconfig/route -env/ip route show table all”类型命令反映出来,从而导致了断开连接。

答案1

经过长时间的搜索,我终于在 ppp 选项文件中添加了“+ipv6”,一切开始正常工作。现在要弄清楚并理解为什么需要该选项!

答案2

使用 NetworkManager 时,ppp连接配置不会与通用网络配置脚本一起存储。
为了调试ppp连接,我使用了nmcli系统控制台中的命令。
为此,我将从以下列表开始

$ nmcli con show
$ mmcli dev status
$ ip route

在正常运行的网关服务器上,ppp它看起来像这样:

$ nmcli con show
NOMBRE  UUID                                  TIPO            DISPOSITIVO 
ppp0    ec723ebc-3675-4d8a-81e8-8989bb275307  pppoe           enp1s0      
enp1s0  c0ab6b8c-0eac-a1b4-1c47-efe4b2d1191f  802-3-ethernet  --          
$ nmcli dev status
DISPOSITIVO  TIPO      ESTADO         CONEXIÓN 
enp1s0       ethernet  conectado      ppp0     
lo           loopback  sin gestión    --       
$ ip route
default via 80.58.67.182 dev ppp0 proto static metric 100 
80.58.67.182 dev ppp0 proto kernel scope link src <net.wor.k.ip> metric 100 

然后运行$ nmcli con show ppp0

它可能会给你类似这样的结果:

$ nmcli con show ppp0
connection.id:                          ppp0
connection.uuid:                        ec723ebc-3675-4d8a-81e8-8989bb275307
connection.stable-id:                   --
connection.interface-name:              enp1s0
connection.type:                        pppoe
connection.autoconnect:                 yes
connection.autoconnect-priority:        100
connection.autoconnect-retries:         -1 (predeterminado)
connection.timestamp:                   1529677563
connection.read-only:                   no
connection.permissions:                 --
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.autoconnect-slaves:          -1 (predeterminado)
connection.secondaries:                 --
connection.gateway-ping-timeout:        0
connection.metered:                     desconocido
connection.lldp:                        -1 (default)
802-3-ethernet.port:                    --
802-3-ethernet.speed:                   0
802-3-ethernet.duplex:                  --
802-3-ethernet.auto-negotiate:          no
802-3-ethernet.mac-address:             --
802-3-ethernet.cloned-mac-address:      --
802-3-ethernet.generate-mac-address-mask:--
802-3-ethernet.mac-address-blacklist:   --
802-3-ethernet.mtu:                     auto
802-3-ethernet.s390-subchannels:        --
802-3-ethernet.s390-nettype:            --
802-3-ethernet.s390-options:            --
802-3-ethernet.wake-on-lan:             1 (default)
802-3-ethernet.wake-on-lan-password:    --
ipv4.method:                            auto
ipv4.dns:                               --
ipv4.dns-search:                        --
ipv4.dns-options:                       (predeterminado)
ipv4.dns-priority:                      0
ipv4.addresses:                         --
ipv4.gateway:                           --
ipv4.routes:                            --
ipv4.route-metric:                      -1
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    --
ipv4.dhcp-timeout:                      0
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     --
ipv4.dhcp-fqdn:                         --
ipv4.never-default:                     no
ipv4.may-fail:                          yes
ipv4.dad-timeout:                       -1 (predeterminado)
ipv6.method:                            auto
ipv6.dns:                               --
ipv6.dns-search:                        --
ipv6.dns-options:                       (predeterminado)
ipv6.dns-priority:                      0
ipv6.addresses:                         --
ipv6.gateway:                           --
ipv6.routes:                            --
ipv6.route-metric:                      -1
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.ip6-privacy:                       -1 (desconocido)
ipv6.addr-gen-mode:                     eui64
ipv6.dhcp-send-hostname:                yes
ipv6.dhcp-hostname:                     --
ipv6.token:                             --
ppp.noauth:                             yes
ppp.refuse-eap:                         no
ppp.refuse-pap:                         no
ppp.refuse-chap:                        no
ppp.refuse-mschap:                      no
ppp.refuse-mschapv2:                    no
ppp.nobsdcomp:                          no
ppp.nodeflate:                          yes
ppp.no-vj-comp:                         no
ppp.require-mppe:                       no
ppp.require-mppe-128:                   no
ppp.mppe-stateful:                      no
ppp.crtscts:                            no
ppp.baud:                               0
ppp.mru:                                1492
ppp.mtu:                                1492
ppp.lcp-echo-failure:                   0
ppp.lcp-echo-interval:                  0
pppoe.service:                          --
pppoe.username:                         <provider_login>
pppoe.password:                         <hidden>
pppoe.password-flags:                   0 (none)
proxy.method:                           none
proxy.browser-only:                     no
proxy.pac-url:                          --
proxy.pac-script:                       --
GENERAL.NOMBRE:                         ppp0
GENERAL.UUID:                           ec723ebc-3675-4d8a-81e8-8989bb275307
GENERAL.DISPOSITIVOS:                   enp1s0
GENERAL.ESTADO:                         activada
GENERAL.PREDETERMINADO:                 sí
GENERAL.PREDETERMINADO6:                no
GENERAL.VPN:                            no
GENERAL.ZONA:                           --
GENERAL.RUTA-DBUS:                      /org/freedesktop/NetworkManager/ActiveConnection/2
GENERAL.CON-RUTA:                       /org/freedesktop/NetworkManager/Settings/5
GENERAL.OBJETO SPEC:                    --
GENERAL.MASTER-RUTA:                    --
IP4.DIRECCIÓN[1]:                       <net.wor.k.ip>/32
IP4.PUERTA DE ENLACE:                   80.58.67.182
IP4.DNS[1]:                             80.58.61.250
IP4.DNS[2]:                             80.58.61.254
IP6.DIRECCIÓN[1]:                       fe80::beae:c5ff:fe34:f062/64
IP6.PUERTA DE ENLACE:                   --

您可能会在以下位置找到配置文件:

# pwd
/etc/NetworkManager/system-connections
# ls -lah
total 8,0K
drwxr-xr-x. 2 root root   17 mar 22 14:26 .
drwxr-xr-x. 7 root root 4,0K feb  7 14:26 ..
-rw-------  1 root root  366 mar 22 14:26 ppp0

# cat ppp0
[connection]
id=ppp0
uuid=ec723ebc-3675-4d8a-81e8-8989bb275307
interface-name=enp1s0
type=pppoe
permissions=
timestamp=1437654424
secondaries=
autoconnect-priority=100
[pppoe]
username=<provider_login>
password=<login_password>    
[ipv6]
method=auto
dns-search=    
[ipv4]
method=auto
dns-search=    
[ethernet]
mac-address-blacklist=    
[ppp]
nodeflate=true
mru=1492
mtu=1492

相关内容