PPP: Difference between revisions

From Alpine Linux
(simplification, references to man pages, completion)
Line 1: Line 1:
{{TOC right}}
{{TOC right}}


= Install PPP =
== Installation ==
Install PPP
 
PPP (Point-to-Point Protocol) allows multiple transports, eg. PPoE 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.
 
<pre>
user "myusername@realm"
plugin rp-pppoe.so
eth0
noipdefault
noipdefault
# Try to get the name server addresses from the ISP
usepeerdns
usepeerdns
# Use this connection as the default route.
defaultroute
defaultroute
defaultroute-metric 300
persist
 
noauth
# detatch after ppp0 interface is created
</pre>
updetach


# Replace previous default route
=== Authentication ===
# 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
CHAP authentication is most used one but there are other ones, see [https://ppp.samba.org/pppd.html pppd(8)].
# Possibly, you may need to change interface according your configuration
plugin rp-pppoe.so eth1
 
# Uncomment if you need on-demand connection
#demand
 
# Disconnect after 300 seconds (5 minutes) of idle time.
#idle 300
 
# Hide password from log entries
hide-password
 
# Send echo requests
lcp-echo-interval 20
lcp-echo-failure 3
 
# Do not authenticate ISP peer
noauth
 
# Control connection consistency
persist
maxfail 0


# Control MTU size if your ISP does not force it
==== ''/etc/ppp/chap-secrets'' ====
#mtu 1492


user "username@yourISP.tld"
<pre>
# Secrets for authentication using CHAP
# client server secret IP addresses
"myusername@realm"         * "<your password>"
</pre>


# Compression
== Kernel modules ==
bsdcomp 15
deflate 15</pre>


== /etc/ppp/chap-secrets ==
''pppoe'' must be present in ''/etc/modules''.
Enter in your login credentials


<pre># Secrets for authentication using CHAP
== ''ifupdown-ng'' intergration ==
# client server secret IP addresses
"username@yourISP.tld"         * "<your password>"</pre>


== /etc/modules ==
To use ''/etc/network/interfaces'' with a ppp defintion automatically, ''ifupdown-ng-ppp'' package must be installed.
Update modules to include pppoe and ipv6 if you are planning on using that:
<pre>pppoe
ipv6</pre>


===  IPv6 ===
{{cmd|apk add ifupdown-ng-ppp}}
Add this to your ppp configuration. This tells PPP to get an ipv6 address. Note the comma is needed.


<pre># Enable IPV6
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.
+ipv6 ipv6cp-use-ipaddr
ipv6 ,</pre>


<pre>
auto ppp0
iface ppp0
ppp-provider isp
</pre>


[[Category:Networking]]
[[Category:Networking]]

Revision as of 13:20, 8 March 2021

Installation

PPP (Point-to-Point Protocol) allows multiple transports, eg. PPoE 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.

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 must be present in /etc/modules.

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 ppp0
iface ppp0
	ppp-provider isp