Difference between revisions of "PPP"

From Alpine Linux
Jump to: navigation, search
(Configuring PPP)
m
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Install PPP =
+
{{TOC right}}
Install PPP
+
 
 +
== Installation ==
 +
 
 +
PPP (Point-to-Point Protocol) allows multiple transports, eg. PPPoE is PPP over Ethernet.
 +
 
 +
=== PPPoE ===
  
 
{{cmd|apk add ppp-pppoe}}
 
{{cmd|apk add ppp-pppoe}}
  
 
== Configure PPP ==
 
== Configure PPP ==
<pre>#
 
# PPP Configuration file
 
#
 
  
nolog
+
=== PPP peer file ===
  
# Try to get the IP address from the ISP
+
Such file is usually located as ''/etc/ppp/peers/<isp>''. See [https://ppp.samba.org/pppd.html pppd(8)] for all possible options.
 +
 
 +
==== PPPoE ====
 +
 
 +
This example peer file is based on Debian's [https://salsa.debian.org/debian/ppp/-/raw/master/debian/extra/peers-pppoe peers-pppoe] extra file. See that ''rp-pppoe.so'' plugin as ''eth0'' as device defined.
 +
 
 +
<pre>
 +
user "myusername@realm"
 +
plugin rp-pppoe.so eth0
 
noipdefault
 
noipdefault
 
# Try to get the name server addresses from the ISP
 
 
usepeerdns
 
usepeerdns
 +
defaultroute
 +
persist
 +
noauth
 +
</pre>
  
# Use this connection as the default route.
+
=== Authentication ===
defaultroute
 
defaultroute-metric 300
 
  
# detatch after ppp0 interface is created
+
CHAP authentication is most used one but there are other ones, see [https://ppp.samba.org/pppd.html pppd(8)].
updetach
 
  
# Replace previous default route
+
==== ''/etc/ppp/chap-secrets'' ====
# This requires a special patch to ppp
 
# https://sources.debian.net/src/ppp/2.4.7-1%2B1~exp1/debian/patches/cifdefroute.dif/
 
# replacedefaultroute
 
  
# rp-pppoe plug-in makes PPPoE connection so rp-pppoe package is not needed
+
<pre>
# Possibly, you may need to change interface according your configuration
+
# Secrets for authentication using CHAP
plugin rp-pppoe.so eth1
+
# client server secret IP addresses
 +
"myusername@realm"         * "<your password>"
 +
</pre>
  
# Uncomment if you need on-demand connection
+
== Kernel modules ==
#demand
 
  
# Disconnect after 300 seconds (5 minutes) of idle time.
+
=== PPPoE ===
#idle 300
 
  
# Hide password from log entries
+
''pppoe'' must be present in ''/etc/modules'' when using PPPoE.
hide-password
 
  
# Send echo requests
+
== ''ifupdown-ng'' intergration ==
lcp-echo-interval 20
 
lcp-echo-failure 3
 
  
# Do not authenticate ISP peer
+
To use ''/etc/network/interfaces'' with a ppp defintion automatically, ''ifupdown-ng-ppp'' package must be installed.
noauth
 
  
# Control connection consistency
+
{{cmd|apk add ifupdown-ng-ppp}}
persist
 
maxfail 0
 
  
# Control MTU size if your ISP does not force it
+
Example for PPP configuration in ''/etc/network/interfaces'', see [https://github.com/ifupdown-ng/ifupdown-ng/blob/master/doc/interfaces-ppp.scd interfaces-ppp(5)] for more info.
#mtu 1492
 
  
user "username@yourISP.tld"
+
<pre>
 +
auto eth0
 +
iface eth0 up
  
# Compression
+
auto ppp0
bsdcomp 15
+
iface ppp0
deflate 15</pre>
+
ppp-provider isp
 +
</pre>
  
== /etc/ppp/chap-secrets ==
+
== Tips ==
Enter in your login credentials
 
  
<pre># Secrets for authentication using CHAP
+
=== pppoeconf ===
# client server secret IP addresses
 
"username@yourISP.tld"         * "<your password>"</pre>
 
  
== /etc/modules ==
+
Debian created ''[https://sources.debian.org/data/main/p/pppoeconf/1.21+nmu1/pppoeconf pppoeconf]'' tool which helps configuring PPPoE. First some utils have to be installed.
Update modules to include pppoe and ipv6 if you are planning on using that:
 
<pre>pppoe
 
ipv6</pre>
 
  
===  IPv6 ===
+
{{cmd|apk add ppp-pppoe newt gettext sed}}
Add this to your ppp configuration. This tells PPP to get an ipv6 address. Note the comma is needed.
+
{{cmd|wget https://sources.debian.org/data/main/p/pppoeconf/1.21+nmu1/pppoeconf}}
 +
{{cmd|chmod +x ./pppoeconf && ./pppoeconf}}
  
<pre># Enable IPV6
+
[[Category:Networking]]
+ipv6 ipv6cp-use-ipaddr
 
ipv6 ,</pre>
 

Latest revision as of 11:33, 17 March 2021

Installation

PPP (Point-to-Point Protocol) allows multiple transports, eg. PPPoE is PPP over Ethernet.

PPPoE

apk add ppp-pppoe

Configure PPP

PPP peer file

Such file is usually located as /etc/ppp/peers/<isp>. See pppd(8) for all possible options.

PPPoE

This example peer file is based on Debian's peers-pppoe extra file. See that rp-pppoe.so plugin as eth0 as device defined.

user "myusername@realm"
plugin rp-pppoe.so eth0
noipdefault
usepeerdns
defaultroute
persist
noauth

Authentication

CHAP authentication is most used one but there are other ones, see pppd(8).

/etc/ppp/chap-secrets

# Secrets for authentication using CHAP
# client	server	secret			IP addresses
"myusername@realm"	        *	"<your password>"

Kernel modules

PPPoE

pppoe must be present in /etc/modules when using PPPoE.

ifupdown-ng intergration

To use /etc/network/interfaces with a ppp defintion automatically, ifupdown-ng-ppp package must be installed.

apk add ifupdown-ng-ppp

Example for PPP configuration in /etc/network/interfaces, see interfaces-ppp(5) for more info.

auto eth0
iface eth0 up

auto ppp0
iface ppp0
	ppp-provider isp

Tips

pppoeconf

Debian created pppoeconf tool which helps configuring PPPoE. First some utils have to be installed.

apk add ppp-pppoe newt gettext sed

wget https://sources.debian.org/data/main/p/pppoeconf/1.21+nmu1/pppoeconf

chmod +x ./pppoeconf && ./pppoeconf