Friday, June 10, 2016

dial pppoe connection on linux

***general information***
- interface direct to internet: eth0
- username/password: user1/pass1

1- install pppoe package
$ sudo apt-get install pppoe

2- create file  /etc/ppp/peers/pppoe1 with the following content
noipdefault
defaultroute
hide-password
lcp-echo-interval 20
lcp-echo-failure 3
connect /bin/true
noauth
persist
mtu 1492
noaccomp
default-asyncmap
plugin rp-pppoe.so
nic-eth0
user "user1"
usepeerdns


3- update file /etc/ppp/chap-secrets with the following content
user1    *    "pass1"        *



4- connection using command pon
$ sudo pon pppoe1

5- disconnect using command poff
$ sudo poff

----------------------note-----------------
-if you connect successfully linux will create new interface, ppp0, so if you can see the interface, it means good
$ ifconfig ppp0
ppp0      Link encap:Point-to-Point Protocol 
          inet addr:10.0.0.255  P-t-P:10.0.0.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1480  Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:72 (72.0 B)  TX bytes:54 (54.0 B


-or if you see log file similar to the following message
$ tail -f /var/log/syslog
Jun 10 20:07:27 dra-pc pppd[5643]: Plugin rp-pppoe.so loaded.
Jun 10 20:07:28 dra-pc pppd[5644]: pppd 2.4.7 started by tun, uid 0
Jun 10 20:07:28 dra-pc pppd[5644]: PPP session is 3
Jun 10 20:07:28 dra-pc pppd[5644]: Connected to 08:00:27:91:fe:1d via interface                                                                                                                 vboxnet0
Jun 10 20:07:28 dra-pc pppd[5644]: Using interface ppp0
Jun 10 20:07:28 dra-pc pppd[5644]: Connect: ppp0 <--> vboxnet0
Jun 10 20:07:28 dra-pc pppd[5644]: CHAP authentication succeeded
Jun 10 20:07:28 dra-pc pppd[5644]: peer from calling number 08:00:27:91:FE:1D au                                                                                                                thorized
Jun 10 20:07:28 dra-pc pppd[5644]: not replacing default route to enxca0609b9ca4                                                                                                                9 [192.168.42.129]
Jun 10 20:07:28 dra-pc pppd[5644]: local  IP address 10.0.0.255
Jun 10 20:07:28 dra-pc pppd[5644]: remote IP address 10.0.0.1
Jun 10 20:07:28 dra-pc pppd[5644]: primary   DNS address 8.8.8.8
Jun 10 20:07:28 dra-pc pppd[5644]: secondary DNS address 8.8.8.8
Jun 10 20:07:28 dra-pc named[1278]: listening on IPv4 interface ppp0, 10.0.0.255   


No comments:

Post a Comment