How to Setup Ubuntu Server as a Router using PPPoE (2022)

Ubuntu Server is technically designed as a CLI prompt only operating system for use with large big iron servers, but there’s no reason it can’t work in routers and embedded systems that manage Point-to-Point Protocol over Ethernet as well. It’s assumed that a project like this needs either a small fanless PC or some sort of router box that you can modify via a NAND flash chip. More than likely you’re going to install a decent amount of RAM as well as a solid-state disk in order to eliminate noise as well as moving parts. You might be interested in using an SDHC-to-SATA converter so that you could run the entire operating system off an SD card. SD cards inserted into side slots on legacy-free hardware can also boot the operating system. This works when using it with a PPPoE system just fine.

While you might think that using this kind of a configuration can be slow without a proper electromechanical hard disk, you’d actually theoretically reduce the access time. Ubuntu Server is so small it boots quickly anyway. Once you have your router in place, you’ll probably not actually turn it on and off very often. Regardless of which configuration you choose, you’ll want to point your browser to https://ubuntu.com/download/server in order to download an ISO. The newest version at the time of this writing, Ubuntu Server 16.04.1 LTS, is designed only for use with 64-bit architectures. Most modern router and thin client devices fulfill this requirement just fine, but this may be a problem if you were attempting something truly exotic like using a netbook as a router.

Configuring Ubuntu Server as a PPPoE Router

Several major ISP networks still require PPPoE authentication. Almost all DSL networks use this, and even though it’s unnecessary when working with a fiber connection, some of them still actually use it as well. Netgear routers offer a login prompt that allows you to connect to these types of networks easily, but it will take some work to get a home-built Linux router to interface correctly with this sort of technology.

If you aren’t there already in your browser, then head to http://releases.ubuntu.com/16.04.1/. You could have downloaded the ISO from this page if you didn’t have it, but once you do have it scroll down to the link that reads MD5SUMS and select it.

From the CLI prompt, run md5sum on the Ubuntu Server ISO and make sure that it matches the number next to ubuntu-16.04-desktop-amd64.iso in the listing.

If it does, then get a completely blank USB memory stick or SD card ready and type sudo if=ubuntu-16.04-desktop-amd64.iso of=/dev/sdLetter bs=8M, replacing the of= prompt with the name of the device in question. You can use sudo fdisk -l to find all the devices attached to your system. Once you’ve done so, properly remove the drive and attach it to the router system. Reboot it, and push whatever key is needed to boot said system from removable storage. Ubuntu Server installs relatively easily based on a number of text-based ncurses prompts.

One problem with installing it in this fashion, however, is that the removable media will require you to be connected to the Internet during installation, and connecting a box like this directly to a network poses some security issues. Plug it into one of the network ports of your old router in order to provide firewall services until you get it up and running. As soon as you do, you’ll need to make some edits to the GRUB boot loader. If possible, then unplug your Linux router from your existing machine as soon as possible to continue the installation offline. This will prevent strange DHCP issues you might get on your existing connection otherwise.

More than likely, you won’t want to install any addition software during the operating system configuration process. GRUB silently boots on a default Ubuntu Server installation, which means you won’t see any debug messages. If you see a blinking cursor with nothing else after it boots, then hold down Ctrl, Alt and F1 to get to a virtual console. Log into your account, and then type though you might also wish to use vi instead. Find a line that reads GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash” and delete the quiet splash words in quotes. You’ll also want to edit a line that reads GRUB_CMDLINE_LINUX=”” to include net.ifnames=0 biosdevname=0 in the double quotes to properly name your networking cards. Save the file and then run sudo update-grub to update your boot loder, since the grub file is probably actually on some sort of UEFI partition.

Find a line that reads GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash” and delete the words “quiet splash” that are in quotes. fsafa

(Video) Set Up PPPoE Server On Ubuntu 14.04

That be a pirate.

Type sudo nano to open your interfaces file for editing, and then change the names of the network cards you find there back to the traditional eth0 and eth1, then save the file and exit. Once you’re out of the file you can reboot the system to ensure that the changes take effect properly.

Now you’ll need to install the proper PPPoE and OpenSSL software to complete the installation. You can install DNS, DHCP, PPPoE and OpenSSL with a single command line issue:

sudo apt-get install bind9 isc-dhcp-server openssl pppoeconf

This might take a few moments, and it could ask if you’re ready to approve the changes. Make sure to tell it that you are. As soon as it completes everything, you can actually disconnect from the Internet and continue offline. You might want to use the sync command a few times to make sure all the buffers are synced together in case something bad happens.

Your ISP provides you with a username and password, which you’ll need to enter into the chap-secrets file. Type but remember that you could still use vi if you prefer. Your user name and password need to be quoted. For example, you’ll potentially want:

“billy” * “mypass3”

Save the file and now navigate to the You’ll find a file called provider in this directory. Open it up with nano like you were doing with the other configuration files, or create a new one in the same way. Put each of these commands on a separate line in the file:

noipdefault

defaultroute

replaceddefaultroute

persist

plugin rr-pppoe.so eth0

user “billy”

(Video) Configure a Router on Ubuntu Server 20.04 LTS for IPv4 and IPv6

You can also put in hide-password and noauth if you’d rather not use login prompts, since you’re going to be using this as a router and not as an actual production machine with a regular interface. Replace the name billy with the actual user name you have, and then run pon provider or the name of the file you create to connect. It should give you any relevant error messages in the process, but you can use ifconfig to find the ppp0 or ppp1 network interface. You’ll need to reference this later. You could add usepeerdns if you want to ask the peer for a couple of DNS server addresses, which are then passed to as environment variables labeled DNS2 and DNS1. You’ll also force an environment variable called USEPEERDNS to set itself to 1 as well. If you’d rather use your own DNS servers and not ones assigned to you by your ISP, you can add lines to your file such as:

These need to be here since each time you reboot the server or establish a new PPPoE connection, the files are overwritten.

In most cases, your MTU is set at around 1500, but the highest you’ll be able to get it around 1492 or perhaps even less since you’re using the PPPoE interface. Assuming you’ve determined the maximum MTU for your ppp0 or ppp1 system, you’ll need to use to open the ip-up file and then add the line /sbin/ifconfig ppp0 mtu #### at the very bottom, replacing #### with your correct value. It might be somewhere around 1480 if you’re unsure.

Many tutorials will tell you to set the eth0 WAN connection to DHCP, but you need to set it to manual due to the PPPoE connection you’re working behind. Use and edit it so that the code block under # The WAN network interface reads auto eth0 and iface eth0 inet manual and then the code block underneath it should read:

# The LAN network interface

auto eth1

iface eth1 inet static

address 192.168.1.1

netmask 255.255.255.0

Routers need packet forwarding activated in order to act as a router, so use and then remove the octothorpe in front of net.ipv4.ip_forward=1 before saving. You’ll find it under a quote that reads # Uncomment the next line to enable packet forwarding for IPv4, but you might also want to remove the mark in front of net.ipv6.conf.all.forwarding=1 if you plan on using IPv6 routing, which may be a challenge under a PPPoE system.

Open the iptables file for editing with the command and then add these lines to it:

(Video) How to configure a PPPoE Server on TP-Link Router | NETVN

Save the file, and then exit nano or whatever other text editor that you’ve been using before you proceed. The iptables constitute the main firewall for the Linux kernel, so it’s a good idea to have these tables in order before you actually start the ISP connection.

You’ll need to now change the permissions on the file in question, so you might want to use sudo -i or sudo bash to get a root prompt. Once you have use:

Once these permissions are applied, you can type exit and push the enter key to get out of the elevated prompt.

The next configuration file we need to open with and you’ll edit it in the same exact fashion. You need to add the following settings, replacing the octothorpes with the right IP address for your router:

subnet ###.###.##.# netmask 255.255.255.0 {

range ###.###.##.### ###.###.##.###;

option routers ###.###.##.#;

option domain-name-servers ###.###.##.#;

option broadcast-address ###.###.##.###;

}

Save and close the file. If you’re working with an SD card or something similar, then this is another good time to issue the sync command as well.

You’ll need to use sudo nano once more to open the file to include your own custom rules. We’re still working with a PPPoE connection, so we’ll use the ppp0 device file instead of the eth0 default.

(Video) Setup a DSL/PPPoE connection in Ubuntu 20.04/18.04

Under a code block that starts with the comment “# Clamp the MSS to MTU size,” include the following line:

-A FORWARD -p tcp –tcp-flags SYN,RST SYN -j TCPMSS –clamp-mss-to-pmtu

This rule is required to prevent Web pages from loading only half way or timing out. It instead pins the MTU and MSS together, so you’re not going to have these problems. Now this allows the Linux kernel to guess about the correct sizes, but you can actually specify them if required. Under a code block that starts with “# Specify MSS size,” you’ll need to add:

-A FORWARD -p tcp –tcp-flags SYN,RST SYN -j TCPMSS –set-mss ####

Replace the #### section with the correct MSS value. You can figure it out with a simple bit of math. Subtract the PPPoE header size from your MTU, and then subtract the IP header and the TCP header. The difference is the total MSS size.

You may need to modify the SSH service rule in order to add the –syn option that will allow you to access SSH to this router from another computer that’s registered on your LAN. Commenting out the ICMP service rule will make your machine not reply to any pings. This will actually make your computer quite stealthy, though you shouldn’t consider this some sort of end-all treatment that makes your browsing habits through this router invisible. It won’t, but it is one more layer of security to protect you.

Sometimes the interfaces or PPPoE connections you’re working with won’t actually connect right away when you boot up the router, so you might want to create a short startup scrip to ensure that it works properly when the system boot s up. It only adds around 8-10 seconds to the total boot time, so it’s actually worth it. Edit the file with sudo nano once again, and then add

sleep 3

ifup eth0

sleep 3

ifup eth1

sleep 3

pon provider

(Video) Configure Ubuntu as PC Router with NAT Firewall and IPTABLES

You’ll need to replace provider with the name of a custom file if you created one to replace the default provider file. Many routers only need a 1-2 second sleep time, so you might want to experiment with that in order to improve boot up performance. It shouldn’t be taking much time to restart at all in the first place anyway.

This should run the pon and ifup commands after the system is totally booted, but before the actual virtual console’s log in prompts appear. If the connection is up, then nothing at all happens, but if one of the connections isn’t working properly then this script will ensure that it’s initialized properly. The last pon command relies on eth0 and eth1, so you must always position it as the final step or otherwise the script might actually fail.

As soon as you reboot the machine after making all these changes you’ll have a fully functioning router working on Ubuntu Server. You may wish to occasionally use sudo iptables-L if you need to check their status from time to time, but otherwise everything will work as well if not better than a commercially manufactured router. Your new router will run any other Ubuntu packages necessary, but you shouldn’t need to install an X Server or anything else, because the system should function correctly without any need for additional user interface software.

FAQs

How do I start a PPPoE server in Linux? ›

Under Linux, it is typically eth0 or eth1. The interface should be "up" before you start pppoe-server, but should not be configured to have an IP address. You can supply multiple -I options if you want the server to respond on more than one interface. This option is passed directly to pppoe; see pppoe(8) for details.

How do I setup a PPPoE connection? ›

Configuring PPPoE mode in the Internet interface
  1. In the administration interface, go to Interfaces.
  2. Double-click on the Internet interface.
  3. Select PPPoE mode.
  4. In the PPPoE Interface Properties dialog, type a new interface name.
  5. Type the username and password.
  6. Click OK.
  7. Click Apply.

How do I run a PPPoE server? ›

1. Go to LAN >> PPPoE Server, enable PPPoE Server and enter the Primary DNS and the Secondary DNS which will be assigned to PPPoE clients, click OK to save. 2. Go to User Management >> User Profile, click an available profile to create a user account.

What is needed to make a PPPoE connection function? ›

If your Internet Service Provider uses PPPoE, then you need at least two things, from the ISP: Assign you with a unique ID (username) and password, and. A modem-router that connects you to the network of the internet service provider.

How do I stop a PPPoE server? ›

Description. pppoe-stop is a shell script which stops the Roaring Penguin user-space PPPoE client. If you omit config_file, the default file /etc/sysconfig/network-scripts/ifcfg-ppp0 is used.

What is PPPoE mode in router? ›

PPPoE enables service providers to maintain access control through PPP connections and also manage multiple hosts at a remote site. PPPoE connects multiple hosts on an Ethernet LAN to a remote site through a single customer premises equipment (CPE) device—a Juniper Networks device.

What is PPPoE IP address? ›

PPPoE combines two widely accepted standards, Ethernet and PPP, to provide an authenticated method of assigning IP addresses to client systems. PPPoE clients are typically personal computers connected to an ISP over a remote broadband connection, such as DSL or cable service.

How do I find my PPPoE IP address? ›

What to Know. Go to Setup or Internet menus of router > select PPPoE as connection type > enter necessary information. PPPoE internet providers assign each of their subscribers a unique PPPoE username and password. PPPoE works on either a broadband router or a broadband modem.

What is the PPPoE username and password? ›

Your username is displayed at the top of the panel, below your package. To get your password, click on the 'Access Details' button.

What is a PPPoE service name? ›

A PPPoE service name table defines the set of services that the router can provide to a PPPoE client. Service entries configured in a PPPoE service name table represent the service name tags transmitted between the client and the router in a PPPoE control packet.

How do I find my PPPoE username and password for my router? ›

Step 1: Click on Start->Control Panel->Network and Internet->Network and Sharing Center. Step 2: Click on Set up a new connection or network. Step 5: Enter “test” for Username and ”123456”for Password, and then click on Connect. Step 6: the PPPoE Connection is established, you can access the Internet now.

Is PPPoE better than DHCP? ›

Conclusion. There is not better than the other, they serve two entirely different functions, with zero overlap. Both PPPoE and DHCP are critical in connecting to the network, which works to acquire IP address. What distinguishes PPPoE vs DHCP is the methods to obtain IP.

How do I test PPPoE connection? ›

Hold the Windows key on your keyboard and press the 'x' key, and then click on 'control panel'. Under 'Network and Internet', click 'view network status and tasks'. Click on Set up a new connection or network. Select 'Connect to the Internet' and then click the 'Next' button.

Which is better static IP or PPPoE? ›

A static IP just means it doesn't change and you get the same IP every time your router resets. This could mean it is set manually on your equipment or it could mean that it is just statically mapped to always give you the same IP address. PPPoE is a connection protocol, not an IP type.

What is PPPoE dual access? ›

In the dual stack PPPoE host service, the PPPoE session is initiated directly from a dual stack host device or PC within the home network. PPPoE is used to carry IPv6 and (optionally) IPv4 traffic from the device to the Broadband Remote Access Server (BRAS), also called Broadband Network Gateway (BNG).

What is access concentrator in PPPoE? ›

The PPPoE server (access concentrator) supports multiple servers for each interface - with differing service names. The access concentrator name and PPPoE service name are used by clients to identify the access concentrator to register with.

Can I change PPPoE to DHCP? ›

You would need to have a username and password with PPPOE while the configuration of DHCP is automatic. For DHCP a computer or other device throws out a broadcast requesting an IP and a DHCP server assigns it an IP with a lease for a specific period of time.

What is the advantage of PPPoE? ›

The biggest advantage of a PPPoE configuration is that it is easy to set up. It also supports multiple computers on a local area network (LAN). The downside of PPPoE is that it requires additional overhead, or extra data, to be sent over the Internet connection.

How do I get a PPPoE username and password? ›

How To SEE PPPoE Username And Password TP link - YouTube

How do I get my PPPoE username and password? ›

Step 1: Click on Start->Control Panel->Network and Internet->Network and Sharing Center. Step 2: Click on Set up a new connection or network. Step 5: Enter “test” for Username and ”123456”for Password, and then click on Connect. Step 6: the PPPoE Connection is established, you can access the Internet now.

How do I set up PPPoE on Windows 10? ›

How To Make Windows 10 To Auto Connect To PPPoE On Startup.
  1. Go to windows SETTINGS.
  2. Than select Network & internet.
  3. Click on Dial-up and select Set up a new connection.
  4. From a new pop-up select Connect to the internet and click on Next buton.
  5. Now click on Broadband (PPPoE)
Oct 26, 2015

Is PPPoE better than DHCP? ›

Conclusion. There is not better than the other, they serve two entirely different functions, with zero overlap. Both PPPoE and DHCP are critical in connecting to the network, which works to acquire IP address. What distinguishes PPPoE vs DHCP is the methods to obtain IP.

Videos

1. Setup a PPPoE connection in Linux
(TheItAssistant)
2. How to Setup Broadband PPPOE connection at Ubuntu
(Shariful Islam)
3. Ubuntu Router With Three Networks
(Linux, Development and Alternative OSes)
4. How to configure PPPOE in UBUNTU 18.10 || TechIQ
(Tech IQ education)
5. Command Line Configure PPPoE-Server and PPPoE-Client On Router Mikro-Tik.
(heang pagna)
6. Setup PPPoE Server Virtual Machine
(Micro Eye Platform)

Top Articles

Latest Posts

Article information

Author: Stevie Stamm

Last Updated: 12/06/2022

Views: 6112

Rating: 5 / 5 (80 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Stevie Stamm

Birthday: 1996-06-22

Address: Apt. 419 4200 Sipes Estate, East Delmerview, WY 05617

Phone: +342332224300

Job: Future Advertising Analyst

Hobby: Leather crafting, Puzzles, Leather crafting, scrapbook, Urban exploration, Cabaret, Skateboarding

Introduction: My name is Stevie Stamm, I am a colorful, sparkling, splendid, vast, open, hilarious, tender person who loves writing and wants to share my knowledge and understanding with you.