ppp

ppp (Paul's PPP Package) is an open source package which implements the point-to-point protocol (PPP) on Linux and Solaris systems. It is implemented as single pppd daemon and acts as backend for xl2tpd, pptpd and netctl. 3G, L2TP and PPPoE connections are internally based on PPP protocol and therefore can be managed by ppp.

If usepeerdns option is used, pppd will create the /etc/ppp/resolv.conf file with obtained DNS addresses while establishing a connection. By default, the /etc/ppp/ip-up.d/00_dns hook script moves this file to /etc/resolv.conf, allowing the system to use these name servers. If this is undesirable (e.g. you are using a local caching DNS), edit the /etc/ppp/ip-up.d/00_dns.sh as you need.

Put a line like this in /etc/ppp/pap-secrets or /etc/ppp/chap-secrets as required by the authentication method used by your ISP.

Chap should always be preferred, when possible, if aiming at security (to understand how chap works see this), however it is OK to write these two files at the same time, pppd will automatically use the appropriate one:

someloginname * yourpassword

You can now start the link using the command:

# pppd call your_provider

Alternatively, you can use this

# pon your_provider

where your_provider is the exact name of your options file in /etc/ppp/peers.

To see whether your PPPoE connection is started correctly, check the pppd output in system logs:

# journalctl -b --no-pager | grep pppd

On a successful connection, you will see something like the following:

Tips and tricks

Do an auto redial

If pppd is running, you can force a connection reset by sending the SIGHUP signal to the process:

# export PPPD_PID=$(pidof pppd)
# kill -s HUP $PPPD_PID

And you have redialed the connection.

Note: Make sure you have persist option enabled in your /etc/ppp/peers/provider tab. Additionally you might want to set holdoff 0 to reconnect without waiting.

ISP auto-disconnect after 24h

Note: If you are not running your computer always on (running 24/7) then you can skip this step.

If you use a flat-rate always-on connection on a computer, some providers restart your connection after 24h. That makes sure that the IP is rotated every 24h. To compensate, you can use an dynamic DNS service in combination with inadynAUR[broken link: archived in aur-mirror] to compensate for the rotating IP address. But to avoid disconnects when you do not need it, you might try to restart the connection using a cron job or systemd timer at a time of day you know no one will be using the connection (e.g. at 4 AM).

Using cron

Note: There are many cron implementations, but none of them are installed by default as the base system uses systemd/Timers instead.

As root, do the following:

Create a bash script similar to this and give it a name (e.g. pppd_redial.sh):

Masquerading seems to be working fine but some sites do not work

The MTU under pppoe is 1492 bytes. Most sites use an MTU of 1500. So your connection sends an ICMP 3:4 (fragmentation needed) packet, asking for a smaller MTU, but some sites have their firewall blocking that.

Now, for some reason, just trying to save the resulting iptables configuration with iptables-save and restoring it later, does not work. It has to be executed after the other iptables configuration had been loaded. So, here is a systemd unit to solve it: