web-dev-qa-db-ja.com

PPPoE Ubuntu 14.04上のサーバーが機能しない-ピアXXXはCHAPセッションの検証に失敗しました

テスト目的で、ubuntu 14.04システムにPPPoEサーバーをセットアップしようとしています。サーバーとクライアントの両方にUbuntu 14.04がインストールされています。このWebサイトのガイドに従ってサーバーをセットアップしました。

http://www.howtodoityourself.org/pppoe-server-how-to-do-it-yourself.html

これは私のinterfacesファイルです。

# The loopback network interface
auto lo
iface lo inet loopback

# The WAN network interface
auto eth0


# The LAN network interface
auto eth1
iface eth1 inet static
        address 192.168.1.254
        netmask 255.255.255.0

私のネームサーバー:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
nameserver 8.8.8.8
nameserver 8.8.4.4

Chapシークレットファイル:

# Secrets for authentication using CHAP
# client    server  secret          IP addresses
"russo"     *   "1234"          192.168.1.1

PPPoEサーバーオプションファイル:

# PPP options for the PPPoE server
# LIC: GPL
require-chap
login
lcp-echo-interval 10
lcp-echo-failure 2
ms-dns 8.8.8.8
ms-dns 8.8.4.4
netmask 255.255.255.0
defaultroute
noipdefault
usepeerdns

IPアドレスプールファイル:

192.168.1.1-20

次に、次のコマンドを実行してPPPoEサーバーを実行します。

Sudo pppoe-server -C isp -L 192.168.1.254 -p /etc/ppp/allip -I eth1

nATのセットアップ

Sudo iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE

次に、コマンドを使用してクライアントを接続します

Sudo pppoeconf

サーバー側では、これは私のnetstatのようです:

mr@OptiPlex-760:~$ netstat -pr
Kernel-IP-Routentabelle
Ziel            Router          Genmask         Flags   MSS Fenster irtt Iface
default         router          0.0.0.0         UG        0 0          0 eth0
link-local      *               255.255.0.0     U         0 0          0 eth1
192.168.1.0     *               255.255.255.0   U         0 0          0 eth1
192.168.88.0    *               255.255.255.0   U         0 0          0 eth0

これはsyslogファイルの一部です:

Jul 10 08:54:35 OptiPlex-760 NetworkManager[987]: <warn> /sys/devices/virtual/net/ppp0: couldn't determine device driver; ignoring...
Jul 10 08:54:35 OptiPlex-760 pppd[4644]: Using interface ppp0
Jul 10 08:54:35 OptiPlex-760 pppd[4644]: Connect: ppp0 <--> /dev/pts/0
Jul 10 08:55:06 OptiPlex-760 pppd[4644]: Peer russo failed CHAP Session verification
Jul 10 08:55:06 OptiPlex-760 pppd[4644]: Connection terminated.
Jul 10 08:55:06 OptiPlex-760 NetworkManager[987]:    SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Jul 10 08:55:06 OptiPlex-760 pppoe[4647]: read (asyncReadFromPPP): Session 7: Input/output error
Jul 10 08:55:06 OptiPlex-760 pppd[4644]: Exit.
Jul 10 08:55:06 OptiPlex-760 pppoe-server[4315]: Session 7 closed for client 68:b5:99:f2:b8:bc (192.168.1.7) on eth1
Jul 10 08:55:06 OptiPlex-760 pppoe-server[4315]: Sent PADT
Jul 10 08:55:24 OptiPlex-760 pppoe-server[4695]: Session 1 created for client 68:b5:99:f2:b8:bc (192.168.1.1) on eth1 using Service-Name ''
Jul 10 08:55:24 OptiPlex-760 pppd[4695]: pppd 2.4.5 started by root, uid 0
Jul 10 08:55:24 OptiPlex-760 pppd[4695]: Using interface ppp0
Jul 10 08:55:24 OptiPlex-760 pppd[4695]: Connect: ppp0 <--> /dev/pts/0
Jul 10 08:55:24 OptiPlex-760 NetworkManager[987]:    SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Jul 10 08:55:24 OptiPlex-760 NetworkManager[987]:    SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/ppp0, iface: ppp0): no ifupdown configuration found.
Jul 10 08:55:24 OptiPlex-760 NetworkManager[987]: <warn> /sys/devices/virtual/net/ppp0: couldn't determine device driver; ignoring...
Jul 10 08:55:37 OptiPlex-760 pppoe-server[4707]: Session 3 created for client 68:b5:99:f2:b8:bc (192.168.1.3) on eth1 using Service-Name ''
Jul 10 08:55:37 OptiPlex-760 pppd[4707]: pppd 2.4.5 started by root, uid 0
Jul 10 08:55:37 OptiPlex-760 NetworkManager[987]:    SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/ppp1, iface: ppp1)
Jul 10 08:55:37 OptiPlex-760 NetworkManager[987]:    SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/ppp1, iface: ppp1): no ifupdown configuration found.
Jul 10 08:55:37 OptiPlex-760 NetworkManager[987]: <warn> /sys/devices/virtual/net/ppp1: couldn't determine device driver; ignoring...
Jul 10 08:55:37 OptiPlex-760 pppd[4707]: Using interface ppp1
Jul 10 08:55:37 OptiPlex-760 pppd[4707]: Connect: ppp1 <--> /dev/pts/11
mr@OptiPlex-760:~$ 

クライアント側で、plogを確認すると、次のように表示されます。

muhammadarifurrahman@wm-HP-EliteBook-2540p:~$ plog
Jul 10 08:44:15 wm-HP-EliteBook-2540p pppd[5366]: PPP session is 1
Jul 10 08:44:15 wm-HP-EliteBook-2540p pppd[5366]: Connected to 60:e3:27:05:37:78 via interface eth0
Jul 10 08:44:15 wm-HP-EliteBook-2540p pppd[5366]: Using interface ppp0
Jul 10 08:44:15 wm-HP-EliteBook-2540p pppd[5366]: Connect: ppp0 <--> eth0
Jul 10 08:44:18 wm-HP-EliteBook-2540p pppd[5366]: CHAP authentication succeeded: Access granted
Jul 10 08:44:18 wm-HP-EliteBook-2540p pppd[5366]: CHAP authentication succeeded
Jul 10 08:44:18 wm-HP-EliteBook-2540p pppd[5366]: peer from calling number 60:E3:27:05:37:78 authorized
muhammadarifurrahman@wm-HP-EliteBook

そして、これは私のnetstat -prです。

muhammadarifurrahman@wm-HP-EliteBook-2540p:~$ netstat -pr
Kernel-IP-Routentabelle
Ziel            Router          Genmask         Flags   MSS Fenster irtt Iface
muhammadarifurrahman@wm-HP-EliteBook-2540p:~$

何が間違っているのかわかりません。どんな提案も大歓迎です。

これはifconfig-サーバー側からの結果です(最初):

    mr@OptiPlex-760:~$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:23:ae:7d:f1:07  
          inet addr:192.168.88.249  Bcast:192.168.88.255  Mask:255.255.255.0
          inet6 addr: fe80::223:aeff:fe7d:f107/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:669 errors:0 dropped:0 overruns:0 frame:0
          TX packets:758 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:205085 (205.0 KB)  TX bytes:104319 (104.3 KB)
          Interrupt:21 Memory:febe0000-fec00000 

eth1      Link encap:Ethernet  HWaddr 60:e3:27:05:37:78  
          inet addr:192.168.1.254  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::62e3:27ff:fe05:3778/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:72 errors:0 dropped:3 overruns:0 frame:0
          TX packets:61 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6967 (6.9 KB)  TX bytes:6664 (6.6 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:387 errors:0 dropped:0 overruns:0 frame:0
          TX packets:387 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:32845 (32.8 KB)  TX bytes:32845 (32.8 KB)

ppp0      Link encap:Point-to-Point Protocol  
          POINTOPOINT NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:3 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:66 (66.0 B)  TX bytes:0 (0.0 B)

ppp1      Link encap:Point-to-Point Protocol  
          POINTOPOINT NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:22 (22.0 B)  TX bytes:0 (0.0 B)

mr@OptiPlex-760:~$ 

次に、サーバー側でplogを実行して見ました:

mr@OptiPlex-760:~$ plog
Jul 10 11:23:23 OptiPlex-760 pppd[2774]: Peer russo failed CHAP Session verification
Jul 10 11:23:23 OptiPlex-760 pppd[2774]: Connection terminated.
Jul 10 11:23:23 OptiPlex-760 pppd[2774]: Exit.

次に、ifconfig -aを再度実行しました。

mr@OptiPlex-760:~$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:23:ae:7d:f1:07  
          inet addr:192.168.88.249  Bcast:192.168.88.255  Mask:255.255.255.0
          inet6 addr: fe80::223:aeff:fe7d:f107/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:685 errors:0 dropped:0 overruns:0 frame:0
          TX packets:782 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:206458 (206.4 KB)  TX bytes:106269 (106.2 KB)
          Interrupt:21 Memory:febe0000-fec00000 

eth1      Link encap:Ethernet  HWaddr 60:e3:27:05:37:78  
          inet addr:192.168.1.254  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::62e3:27ff:fe05:3778/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:106 errors:0 dropped:4 overruns:0 frame:0
          TX packets:87 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:9081 (9.0 KB)  TX bytes:7945 (7.9 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:409 errors:0 dropped:0 overruns:0 frame:0
          TX packets:409 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:34067 (34.0 KB)  TX bytes:34067 (34.0 KB)

mr@OptiPlex-760:~$

これはifconfig-クライアント側の結果です:

    muhammadarifurrahman@wm-HP-EliteBook-2540p:~$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr 68:b5:99:f2:b8:bc  
          inet addr:192.168.88.250  Bcast:192.168.88.255  Mask:255.255.255.0
          inet6 addr: fe80::6ab5:99ff:fef2:b8bc/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:98 errors:0 dropped:0 overruns:0 frame:0
          TX packets:212 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:10413 (10.4 KB)  TX bytes:24738 (24.7 KB)
          Interrupt:20 Memory:d4700000-d4720000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:194 errors:0 dropped:0 overruns:0 frame:0
          TX packets:194 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:27708 (27.7 KB)  TX bytes:27708 (27.7 KB)

ppp0      Link encap:Point-to-Point Protocol  
          POINTOPOINT NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:0 (0.0 B)  TX bytes:22 (22.0 B)

wlan0     Link encap:Ethernet  HWaddr 58:94:6b:55:15:04  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

muhammadarifurrahman@wm-HP-EliteBook-2540p:~$ 

私はちょうどこれに気づいた:

サーバーでPPPoEを起動し、クライアントから接続すると、

サーブサイドで私は得る:

mr@OptiPlex-760:~$ plog
Jul 10 11:33:05 OptiPlex-760 pppd[3257]: pppd 2.4.5 started by root, uid 0
Jul 10 11:33:05 OptiPlex-760 pppd[3257]: Using interface ppp0
Jul 10 11:33:05 OptiPlex-760 pppd[3257]: Connect: ppp0 <--> /dev/pts/10

そして、クライアント側で私は得る:

muhammadarifurrahman@wm-HP-EliteBook-2540p:~$ plog
Jul 10 11:21:59 wm-HP-EliteBook-2540p pppd[4258]: CHAP authentication succeeded: Access granted
Jul 10 11:21:59 wm-HP-EliteBook-2540p pppd[4258]: CHAP authentication succeeded
Jul 10 11:21:59 wm-HP-EliteBook-2540p pppd[4258]: peer from calling number 60:E3:27:05:37:78 authorized

その後、2〜3秒後に、サーバー側で次のメッセージが表示されます。

mr@OptiPlex-760:~$ plog
Jul 10 11:33:18 OptiPlex-760 pppd[3257]: Peer russo failed CHAP Session verification
Jul 10 11:33:18 OptiPlex-760 pppd[3257]: Connection terminated.
Jul 10 11:33:18 OptiPlex-760 pppd[3257]: Exit.
mr@OptiPlex-760:~$

そして、クライアント側で:

Jul 10 11:22:09 wm-HP-EliteBook-2540p pppd[4258]: LCP terminated by peer (Authentication failed)
Jul 10 11:22:09 wm-HP-EliteBook-2540p pppd[4258]: Modem hangup
Jul 10 11:22:09 wm-HP-EliteBook-2540p pppd[4258]: Connection terminated.
Jul 10 11:22:09 wm-HP-EliteBook-2540p pppd[4258]: Failed to disconnect PPPoE socket: 114 Operation already in progress
muhammadarifurrahman@wm-HP-EliteBook-2540p:~$ 
3
Russo

わかりましたので、PPpoEサーバーオプションファイルを変更して問題を修正しました。これは今のように見えます:

auth
lcp-echo-failure 3
lcp-echo-interval 60
mtu 1482
mru 1482
require-chap
ms-dns 8.8.8.8
ms-dns 8.8.4.4
netmask 255.255.255.0
defaultroute
noipdefault
usepeerdns

そして、すべてが完璧に機能しています。

1
Russo