![无法建立 pppoe 连接](https://linux22.com/image/121478/%E6%97%A0%E6%B3%95%E5%BB%BA%E7%AB%8B%20pppoe%20%E8%BF%9E%E6%8E%A5.png)
我在基于 De(b)vuan 的发行版上建立 pppoe 连接时遇到问题。我的 ISP 允许我通过标记的 vlan 300 建立链接。以前,在我稍微重新编译内核(使其更通用)之前,连接工作得很好,但我不认为这应该是一个问题。
所有模块都(应该)已经正确加载。
这是日志:
Nov 11 01:08:02 pppd[2863]: Send PPPOE Discovery V1T1 PADI session 0x0 length 12
Nov 11 01:08:02 pppd[2863]: dst ff:ff:ff:ff:ff:ff src b8:27:eb:62:e6:80
Nov 11 01:08:02 pppd[2863]: [service-name] [host-uniq 2f 0b 00 00]
Nov 11 01:08:02 pppd[2863]: Recv PPPOE Discovery V1T1 PADO session 0x0 length 53
Nov 11 01:08:02 pppd[2863]: dst b8:27:eb:62:e6:80 src e4:81:84:26:2e:6c
Nov 11 01:08:02 pppd[2863]: [service-name] [AC-name BNG_NS_SATELIT1_2] [host-uniq 2f 0b 00 00] [AC-cookie 06 40 99 9b 50 e9 b3 90 be 93 bb 10 9f e6 16 db]
Nov 11 01:08:02 pppd[2863]: Send PPPOE Discovery V1T1 PADR session 0x0 length 32
Nov 11 01:08:02 pppd[2863]: dst e4:81:84:26:2e:6c src b8:27:eb:62:e6:80
Nov 11 01:08:02 pppd[2863]: [service-name] [host-uniq 2f 0b 00 00] [AC-cookie 06 40 99 9b 50 e9 b3 90 be 93 bb 10 9f e6 16 db]
Nov 11 01:08:02 pppd[2863]: Recv PPPOE Discovery V1T1 PADO session 0x0 length 57
Nov 11 01:08:02 pppd[2863]: dst b8:27:eb:62:e6:80 src e4:81:84:25:df:d6
Nov 11 01:08:02 pppd[2863]: [service-name] [AC-name BNG_XXXX] [host-uniq 2f 0b 00 00] [AC-cookie 5e 0c 8b 60 fb 75 10 fd 83 4f 68 ce fa 5a f3 d9]
Nov 11 01:08:02 pppd[2863]: Recv PPPOE Discovery V1T1 PADS session 0x642 length 12
Nov 11 01:08:02 pppd[2863]: dst b8:27:eb:62:e6:80 src e4:81:84:26:2e:6c
Nov 11 01:08:02 pppd[2863]: [service-name] [host-uniq 2f 0b 00 00]
Nov 11 01:08:02 pppd[2863]: PADS: Service-Name: ''
Nov 11 01:08:02 pppd[2863]: PPP session is 1602
Nov 11 01:08:02 pppd[2863]: Connected to e4:81:xx:xx:xx via interface eth0.300
Nov 11 01:08:02 pppd[2863]: using channel 71
Nov 11 01:08:02 pppd[2863]: Using interface ppp0
Nov 11 01:08:02 pppd[2863]: Connect: ppp0 <--> eth0.300
Nov 11 01:08:02 pppd[2863]: sent [LCP ConfReq id=0xa <mru 1492> <magic 0x6bd07e40>]
Nov 11 01:08:02 pppd[2863]: rcvd [LCP ConfAck id=0xa <mru 1492> <magic 0x6bd07e40>]
Nov 11 01:08:05 pppd[2863]: rcvd [LCP ConfReq id=0x28 <mru 1492> <auth pap> <magic 0x6e7eeffa>]
Nov 11 01:08:05 pppd[2863]: sent [LCP ConfAck id=0x28 <mru 1492> <auth pap> <magic 0x6e7eeffa>]
Nov 11 01:08:05 pppd[2863]: sent [LCP EchoReq id=0x0 magic=0x6bd07e40]
Nov 11 01:08:05 pppd[2863]: sent [PAP AuthReq id=0x9 user="[email protected]" password=<hidden>]
Nov 11 01:08:05 pppd[2863]: rcvd [LCP EchoRep id=0x0 magic=0x6e7eeffa]
Nov 11 01:08:06 pppd[2863]: rcvd [PAP AuthAck id=0x9 "Login ok"]
Nov 11 01:08:06 pppd[2863]: Remote message: Login ok
Nov 11 01:08:06 pppd[2863]: PAP authentication succeeded
Nov 11 01:08:06 pppd[2863]: peer from calling number E4:81:xx:xx:xx:xx authorized
Nov 11 01:08:06 pppd[2863]: sent [IPCP ConfReq id=0x19 <addr 0.0.0.0>]
Nov 11 01:08:06 pppd[2863]: rcvd [IPCP ConfReq id=0xe <addr xxx.xxx.xxx.xxx>]
Nov 11 01:08:06 pppd[2863]: sent [IPCP ConfAck id=0xe <addr xxx.xxx.xxx.xxx>] # <- GW
Nov 11 01:08:06 pppd[2863]: rcvd [IPCP ConfNak id=0x19 <addr xxx.xxx.xxx.xxx>]
Nov 11 01:08:06 pppd[2863]: sent [IPCP ConfReq id=0x1a <addr xxx.xxx.xxx.xxx>]
Nov 11 01:08:06 pppd[2863]: rcvd [IPCP ConfAck id=0x1a <addr xxx.xxx.xxx.xxx>]
Nov 11 01:08:06 pppd[2863]: ioctl(SIOCADDRT) device route: Network is down (line 2501)
Nov 11 01:08:06 pppd[2863]: Interface configuration failed
Nov 11 01:08:06 pppd[2863]: Connect time 0.1 minutes.
Nov 11 01:08:06 pppd[2863]: Sent 30 bytes, received 30 bytes.
Nov 11 01:08:06 pppd[2863]: sent [IPCP TermReq id=0x1b "Interface configuration failed"]
Nov 11 01:08:06 pppd[2863]: rcvd [LCP TermReq id=0x29]
Nov 11 01:08:06 pppd[2863]: LCP terminated by peer
Nov 11 01:08:06 pppd[2863]: sent [LCP TermAck id=0x29]
Nov 11 01:08:06 pppd[2863]: rcvd [IPCP TermAck id=0x1b]
Nov 11 01:08:06 pppd[2863]: Discarded non-LCP packet when LCP not open
Nov 11 01:08:06 pppd[2863]: Modem hangup
Nov 11 01:08:06 pppd[2863]: Connection terminated.
Nov 11 01:08:06 pppd[2863]: Failed to disconnect PPPoE socket: 114 Operation already in progress
# cat /etc/ppp/peers/dsl-provider
# Minimalistic default options file for DSL/PPPoE connections
noipdefault
defaultroute
replacedefaultroute
hide-password
#lcp-echo-interval 0
#lcp-echo-failure 0
noauth
persist
mtu 1412
persist
#maxfail 0
holdoff 20
plugin rp-pppoe.so
eth0.300
user "[email protected]"
编辑:由于它在我修改过的路由器上,因此链接状态如下:
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:62:e6:80 brd ff:ff:ff:ff:ff:ff
inet6 fe80::ba27:ebff:fe62:e680/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0e:c6:c7:3e:1c brd ff:ff:ff:ff:ff:ff
inet 192.168.1.1/24 brd 192.168.1.255 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::20e:c6ff:fec7:3e1c/64 scope link
valid_lft forever preferred_lft forever
4: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000
link/ether 00:e0:4c:36:02:76 brd ff:ff:ff:ff:ff:ff
inet6 fe80::2e0:4cff:fe36:276/64 scope link
valid_lft forever preferred_lft forever
32: eth0.200@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0 state UP group default qlen 1000
link/ether b8:27:eb:62:e6:80 brd ff:ff:ff:ff:ff:ff
inet6 fe80::ba27:ebff:fe62:e680/64 scope link
valid_lft forever preferred_lft forever
33: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:e0:4c:36:02:76 brd ff:ff:ff:ff:ff:ff
inet6 fe80::2e0:4cff:fe36:276/64 scope link
valid_lft forever preferred_lft forever
63: eth0.300@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether b8:27:eb:62:e6:80 brd ff:ff:ff:ff:ff:ff
inet6 fe80::ba27:ebff:fe62:e680/64 scope link
valid_lft forever preferred_lft forever
模块:
# lsmod | grep 'ppp\|802\|garp'
:
ppp_mppe 6951 0
pppoe 11779 0
pppox 2913 1 pppoe
ppp_generic 29613 3 pppox,pppoe,ppp_mppe
slhc 5959 1 ppp_generic
8021q 22998 0
garp 7049 1 8021q
mrp 8903 1 8021q
stp 2430 2 garp,bridge
llc 5903 3 garp,bridge,stp
谁能指出我是什么原因造成的:
Nov 11 01:08:29 pppd[2863]: ioctl(SIOCADDRT) device route: Network is down (line 2501)
Nov 11 01:08:29 pppd[2863]: Interface configuration failed
Nov 11 01:08:29 pppd[2863]: Connect time 0.1 minutes.
Nov 11 01:08:29 pppd[2863]: Sent 30 bytes, received 30 bytes.
Nov 11 01:08:29 pppd[2863]: sent [IPCP TermReq id=0x1e "Interface configuration failed"]
Nov 11 01:08:29 pppd[2863]: rcvd [LCP TermReq id=0x34]
Nov 11 01:08:29 pppd[2863]: LCP terminated by peer
编辑接口文件:
# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
auto eth1
auto eth3
#LAN
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
#IPTV
auto eth0.200
iface eth0.200 inet manual
#WAN
auto eth0.300
iface eth0.300 inet manual
auto dsl-provider
iface dsl-provider inet ppp
pre-up /bin/ip link set eth0.300 up # line maintained by pppoeconf
provider dsl-provider
iface br0 inet manual
bridge_ports eth3 eth0.200
IP路由:
# ip r
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.1
由 pppoeconf 生成:
:/~ # grep -v '^$\|^#' /etc/ppp/peers/dsl-provider
noipdefault
defaultroute
hide-password
lcp-echo-interval 20
lcp-echo-failure 3
connect /bin/true
noauth
persist
mtu 1492
noaccomp
default-asyncmap
logfile /var/log/ppp.log
plugin rp-pppoe.so eth0.300
user "[email protected]"
编辑2:
附加 strace 输出:
strace pppd file /etc/ppp/peers/dsl-provider debug
http://paste.debian.net/995356/
strace -p PID
http://paste.debian.net/995357/
赞赏!
答案1
线路
ioctl(SIOCADDRT) device route: Network is down
表示pppd
尝试在已关闭的设备上为某个地址范围设置路由。如果您使用 手动设置路线,也会发生同样的情况ip route
。
通过执行以下操作进行调试ip addr
:查看网络接口上的地址以及哪些地址处于打开或关闭状态,然后查看pppd
收到的地址。这可能涉及一些猜测pppd
执行期间正在做什么,因为关闭后的状态可能与执行期间的状态不同。如果您无法猜测任何内容,请使用strace
并为大输出做好准备。
您没有显示其他网络接口或地址,因此我无法为您执行此操作。