J'essaie de configurer un serveur PPPoE dans mon système Ubuntu 14.04 à des fins de test. Ubuntu 14.04 est installé sur le serveur et sur le client. J'ai suivi le guide de ce site Web pour configurer le serveur.
http://www.howtodoityourself.org/pppoe-server-how-to-do-it-yourself.html
Ceci est mon fichier d'interface:
# 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
Mon serveur de noms:
# 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
Le dossier secret du chap:
# Secrets for authentication using CHAP
# client server secret IP addresses
"russo" * "1234" 192.168.1.1
Le fichier d'options PPPoE Server:
# 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
Fichier de pool d'adresses IP:
192.168.1.1-20
Ensuite, lorsque je lance le serveur PPPoE en exécutant la commande suivante:
Sudo pppoe-server -C isp -L 192.168.1.254 -p /etc/ppp/allip -I eth1
et configurer NAT
Sudo iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE
puis je connecte mon client en utilisant la commande
Sudo pppoeconf
côté serveur, voici à quoi ressemble mon 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
Ceci est une partie du fichier 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:~$
Du côté de mon client, si je vérifie la situation, je vois:
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
Et voici mon 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:~$
Je ne suis pas sûr de ce que je fais mal. Toutes les suggestions sont très appréciées.
Voici le résultat ifconfig -a du côté serveur (au début):
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:~$
Puis j'ai couru ploger côté serveur et j'ai vu:
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.
Puis, exécutez à nouveau 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:~$
Voici le résultat ifconfig -a du côté client:
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:~$
Je viens de remarquer ceci:
Lorsque je lance PPPoE sur le serveur, puis que je me connecte à partir du client,
Au service je reçois:
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
Et du côté client, je reçois:
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
Après 2-3 secondes, du côté serveur, je reçois:
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:~$
Et du côté du client:
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:~$
Ok, j’ai résolu le problème en modifiant le fichier d’options du serveur PPpoE. Voici à quoi cela ressemble maintenant:
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
Et tout fonctionne parfaitement.