Skip to content

Instantly share code, notes, and snippets.

@jwillikers
Last active July 18, 2026 08:10
Show Gist options
  • Select an option

  • Save jwillikers/ab0390177dae6cd567e2efbae89a9d56 to your computer and use it in GitHub Desktop.

Select an option

Save jwillikers/ab0390177dae6cd567e2efbae89a9d56 to your computer and use it in GitHub Desktop.
PPPoE Setup on OpenBSD

Setup PPPoE on OpenBSD 6.6

This brief article describes how I setup the internet connection on my PPPoE interface on OpenBSD 6.6.

PPPoE Configuration

The configuration only involves two configuration files and initializing the new network interface. I use a hostname.if file to initialize the PPPoE interface when the system boots. This example is very similar to the one provided in the PPPOE(4) manpage with two differences. First, chap replaces pap as the authentication protocal. Second, only the relevant IPv4 options are shown since my ISP doesn’t support IPv6.

/etc/hostname.pppoe0
inet 0.0.0.0 255.255.255.255 NONE \ # (1)
	pppoedev em0 authproto chap \ # (2)
	authname 'username' authkey 'password' up
dest 0.0.0.1
!/sbin/route add default -ifp pppoe0 0.0.0.1
  1. Set the IP to 0.0.0.0, a wildcard representing whatever IP the PPPoE connection provides.

  2. em0 is the ethernet interface for the router’s WAN port.

The physical em0 interface must be up.

/etc/hostname.em0
up mtu 1508

Start up the em0 and pppoe0 interfaces.

sh /etc/netstart em0 pppoe0
🔥

The /etc/netstart script was not able to successfully establish a PPPoE connection when I changed my configuration from pap to chap. I had to reboot my system after changing the configuration file for the connection to succeed.

reboot
@mjcross

mjcross commented Jul 17, 2026

Copy link
Copy Markdown

A few notes for anyone having connection problems:

  1. you can add debug to the /etc/hostname.pppoe config to get additional detail in /var/log/messages.
  2. running tcpdump on the underlying network interface (e.g. em0) is informative and the output is quite readable
  3. (for me) specifying MTU 1500 at line (1) of the hostname.pppoe silently prevents the interface asking for an IPv4 address
  4. (for me) to connect reliably it's important that the previous connection was closed cleanly and fully. For example if you are swapping the fibre modem cable from a home router (e.g. Fritz!Box), drop the connection before unplugging the cable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment