PPP: Difference between revisions

From Alpine Linux
(Created page with "= Configuring PPP = Next up we need to configure our router to be able to dial a PPP connection with our modem. {{cmd|apk add ppp-pppoe}} Check that the interface between yo...")
 
m (typo)
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
= Configuring PPP =
{{TOC right}}
Next up we need to configure our router to be able to dial a PPP connection with our modem.
 
== 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}}


Check that the interface between your router and modem is eth1, or change it. Enter your credentials at the bottom of the file or use /etc/ppp/chap-secrets
== Configure PPP ==


== /etc/ppp/peers/yourISP ==
=== PPP peer file ===
<pre>#
# PPP Configuration file
#


nolog
Such file is usually located as ''/etc/ppp/peers/<isp>''. See [https://ppp.samba.org/pppd.html pppd(8)] for all possible options.


# Try to get the IP address from the ISP
==== 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 ''pppoe.so'' plugin as ''eth0'' as device defined.
 
<pre>
user "myusername@realm"
plugin pppoe.so eth0
noipdefault
noipdefault
usepeerdns
defaultroute
persist
noauth
</pre>


# Try to get the name server addresses from the ISP
Note that if you have a version of ppp older than 2.4.9, the <code>pppoe.so</code> plugin is named <code>rp-pppoe.so</code>.
usepeerdns


# 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%2Bnmu2/pppoeconf pppoeconf]'' tool which helps configuring PPPoE. First some utils have to be installed.
Update modules to include pppoe:
<pre>pppoe</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%2Bnmu2/pppoeconf}}         
{{cmd|chmod +x ./pppoeconf && ./pppoeconf}}


<pre># Enable IPV6
[[Category:Networking]]
+ipv6 ipv6cp-use-ipaddr
ipv6 ,</pre>

Latest revision as of 21:53, 10 May 2023

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 pppoe.so plugin as eth0 as device defined.

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

Note that if you have a version of ppp older than 2.4.9, the pppoe.so plugin is named rp-pppoe.so.

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%2Bnmu2/pppoeconf

chmod +x ./pppoeconf && ./pppoeconf