wifiSession 07 — Live Lab

PPPoE on a MikroTik hAP, from scratch

You are going to configure a real PPPoE server, point it at a RADIUS instance, create per-user access profiles with enforced time limits, connect your machines as PPPoE clients, and then watch the router log you off. Every step maps back to what Session 06 explained in theory.

DE
David Emiru Egwell
CTO, SprintUG Internet Limited
10
Parts
1
hAP device
4
Trainees
RADIUS
User Manager
format_list_bulleted Session Contents

What we are building today

Session 06 was all words. This session is all hands. You are going to take a home-router-sized device called a MikroTik hAP, turn it into a PPPoE server the same way a real ISP would, wire it to a RADIUS server, then connect your laptop to it as if your laptop were a customer premises device. Every command has a reason and that reason was explained in Session 06.

Why a MikroTik hAP? The same MikroTik RouterOS that runs on a hAP runs on carrier-grade MikroTik hardware. The commands are identical. The difference is port count and throughput. Learning here is learning everywhere.

What each person is doing

Everyone takes the same steps to connect. The difference is what RADIUS tells the router about each of you. Each person has a different Session-Timeout value assigned by the RADIUS profile. That value is the prize. You will not know how much time you have until you are connected and the countdown starts.

  • check_circleIrene — PPPoE connects, RADIUS assigns 3 minutes
  • check_circleDennis — PPPoE connects, RADIUS assigns 5 minutes
  • check_circleMsabi — PPPoE connects, RADIUS assigns 10 minutes
  • check_circleIbrahim — PPPoE connects, RADIUS assigns 15 minutes

When your session expires the router drops the PPPoE link. No warning from the router. Your internet stops. That is the real behaviour of a timed ISP session: the network enforces the policy, not a pop-up.

What you need before we start

  • check_circleOne MikroTik hAP (any hAP variant works: hAP lite, hAP ac², hAP ac³)
  • check_circleOne laptop per trainee with a Wi-Fi adapter (or wired Ethernet)
  • check_circleWinBox installed on the trainer laptop — download from mikrotik.com/download
  • check_circleThe hAP on factory defaults (hold the reset button for 5 seconds if in doubt)
  • check_circlePower for the hAP and a way to reach it from the trainer laptop on the LAN

Lab topology

The diagram below shows every device and every arrow of traffic in this lab. Read it before you touch anything.

┌─────────────────────────────────────────────────────────────────┐ │ MikroTik hAP │ │ │ │ ether1 (WAN) ether2-4 / Wi-Fi (LAN bridge) │ │ 192.168.88.1 ◄────── PPPoE server listening on bridge │ │ RADIUS client → 127.0.0.1:1812 │ │ User Manager (built-in RADIUS server) │ └─────────────────────────────────────────────────────────────────┘ │ Wi-Fi (trainees connect to MikroTik's default SSID) ┌──────┴──────────────────────────────────────┐ │ │ Laptop (Irene) Laptop (Dennis) Laptop (Msabi) Laptop (Ibrahim) PPPoE client PPPoE client PPPoE client PPPoE client username:irene username:dennis username:msabi username:ibrahim Traffic flow after PPPoE connect: Laptop → PPPoE → hAP → RADIUS User Manager ↓ RADIUS Access-Accept + Session-Timeout value ↓ hAP opens session, starts timer hAP issues IP from PPPoE pool ↓ When timer hits 0: hAP sends RADIUS Accounting-Stop hAP tears down the PPPoE session Laptop loses connectivity

The hAP acts as PPPoE server and RADIUS client at the same time. User Manager is the RADIUS server running on the same device. That is fine for a lab. In production the RADIUS server lives on a separate server and the PPPoE server (Juniper MX, Cisco, MikroTik BRAS) is the RADIUS client. The conversation between them is identical.

RADIUS client vs RADIUS server: The thing doing the authenticating (the router) is the client. The thing holding the user database and policies (User Manager / FreeRADIUS) is the server. The router asks. The RADIUS server answers. This is backwards from what "client" usually implies, so it catches people out.

Configure the PPPoE server

Connect the trainer laptop to the hAP via Ethernet and open WinBox. You should see the hAP appear in the Neighbors list. Click it to connect. Default credentials after a reset are admin with no password.

Factory reset first. If this hAP has been used before, go to System → Reset Configuration, tick "No Default Configuration", and click Reset. A truly blank device is easier to teach on than one with mystery settings.

Step 1 — Create an IP Pool for PPPoE clients

PPPoE clients need an IP address assigned when they connect. You create a pool: a range of IPs the router draws from each time a client authenticates.

# In the WinBox Terminal: /ip pool add name=pppoe-pool ranges=10.0.0.2-10.0.0.30 # Verify /ip pool print

This gives 29 addresses. More than enough for 4 trainees. Address 10.0.0.1 will be the router's end of every PPPoE link.

Step 2 — Create a PPPoE Profile

A profile defines the IP settings applied to all PPPoE sessions that use it. You can have multiple profiles (different speeds, different pools), but for this lab one is enough.

/ppp profile add name=lab-profile \ local-address=10.0.0.1 \ remote-address=pppoe-pool \ use-encryption=no

local-address is the IP on the router's side of the PPPoE tunnel. remote-address points to the pool you just made. The client gets an IP from that pool. use-encryption=no skips MPPE, which simplifies the lab.

Step 3 — Enable the PPPoE Server

The server needs to know which interface to listen on. On the hAP, trainees will connect over Wi-Fi, and the hAP bridges its LAN ports and Wi-Fi into one interface called bridge by default. Run:

/interface pppoe-server server add \ service-name=sprint-lab \ interface=bridge \ default-profile=lab-profile \ authentication=chap,mschap1,mschap2 \ disabled=no
authentication= field: This lists which password-exchange methods are acceptable. CHAP means the password is never sent in plain text — a challenge/response hash goes instead. MSCHAPv1 and v2 are Microsoft extensions of the same concept. The client and server negotiate the strongest method they both support.

Step 4 — Point the PPPoE server at RADIUS

By default the router checks users against its own local secrets list under /ppp secret. You need to tell it to ask RADIUS instead.

/ppp profile set lab-profile use-radius=yes /radius add \ service=ppp \ address=127.0.0.1 \ secret=labsecret \ authentication-port=1812 \ accounting-port=1813

address=127.0.0.1 means the hAP is asking itself — because User Manager is running on the same device. secret=labsecret is the shared secret that the RADIUS client (this router process) and the RADIUS server (User Manager) both need to know. We will set it on the User Manager side in Part 4.

Set up RADIUS with User Manager

User Manager is MikroTik's built-in RADIUS server. It ships with RouterOS but requires a package install on some versions. First check whether it is already running.

# Check installed packages /system package print # If "user-manager" is not in the list: # 1. Download the correct package from mikrotik.com/download # (match your RouterOS version and board architecture) # 2. Drag the .npk file into WinBox Files # 3. Reboot: /system reboot # 4. Check again: /system package print

Open the User Manager interface

Once the package is installed you access User Manager through a web browser, not WinBox. The default address is:

http://192.168.88.1/userman

The username is admin. The password is the same as your WinBox admin password (blank by default).

Step 5 — Register the router as a RADIUS client

User Manager needs to know that this hAP is allowed to ask it for authentication. In User Manager:

  • check_circleGo to RoutersAdd
  • check_circleName: hap-lab
  • check_circleIP Address: 127.0.0.1
  • check_circleShared Secret: labsecret (must match what you typed in /radius add)
  • check_circleClick Add
Why must the secret match? Every RADIUS packet is signed using a hash of the shared secret. If the client and server have different secrets, the hash does not match and the packet is silently dropped. No error, no response, the PPPoE connection just stalls. This is one of the most common mistakes in a first RADIUS setup.

Create user profiles with Session-Timeout

This is the key part. You are creating four user accounts. Each account has a different Session-Timeout attribute. That attribute travels from RADIUS to the router inside the Access-Accept packet. The router reads it and enforces the timeout.

Step 6 — Create user profiles in User Manager

In User Manager, go to ProfilesAdd. Create one profile per trainee.

Username Password Session-Timeout (seconds) Human-readable
ireneirene1231803 minutes
dennisdennis1233005 minutes
msabimsabi12360010 minutes
ibrahimibrahim12390015 minutes

For each user the steps are:

  • check_circleUser Manager → UsersAdd
  • check_circleUsername: as in the table above
  • check_circlePassword: as in the table above
  • check_circleUnder Limits → set Session Timeout to the value in the table
  • check_circleSave
What Session-Timeout actually is: It is a standard RADIUS attribute (attribute number 27 in RFC 2865). When the router receives it, it starts an internal countdown. When the countdown finishes the router terminates the session using a Disconnect-Message (CoA). The client is not warned. The link just goes down.

What RADIUS actually sends back

When Irene authenticates, the RADIUS Access-Accept packet looks like this:

# RADIUS Access-Accept (simplified) Framed-IP-Address: 10.0.0.2 # assigned from pool Framed-IP-Netmask: 255.255.255.0 Session-Timeout: 180 # ← this is the prize value Acct-Interim-Interval: 60 # send accounting update every 60s Class: irene-profile

The Session-Timeout: 180 line is the only difference between Irene's session and Ibrahim's. Everything else is the same. The router stores that value, starts a countdown, and at 0 it terminates the session regardless of what Irene is doing.

Connect your machine as a PPPoE client

Each trainee follows these steps on their own machine. The interface name varies by OS. The username and password are from the table in Part 5.

Windows 10 / 11

  • check_circleStart → Settings → Network & Internet → Dial-up
  • check_circleClick Set up a new connection
  • check_circleChoose Connect to the InternetBroadband (PPPoE)
  • check_circleUsername: your username from the table; Password: your password
  • check_circleConnection name: anything you want (e.g. SprintLab)
  • check_circleClick Connect

After a successful connection, run ipconfig in Command Prompt. You should see a PPP adapter with an IP address from the range 10.0.0.2–10.0.0.30.

C:\> ipconfig PPP adapter SprintLab: Connection-specific DNS Suffix . : IPv4 Address. . . . . . . . . . . : 10.0.0.2 Subnet Mask . . . . . . . . . . . : 255.255.255.255 Default Gateway . . . . . . . . . : 10.0.0.1

macOS

  • check_circleSystem Preferences → Network → click +
  • check_circleInterface: PPPoE; Ethernet Interface: your Wi-Fi or Ethernet adapter
  • check_circleAccount Name: your username; Password: your password
  • check_circleClick Connect

Linux (NetworkManager)

# Using nmcli nmcli con add type pppoe \ con-name sprint-lab \ ifname eth0 \ username YOUR_USERNAME \ password YOUR_PASSWORD nmcli con up sprint-lab # Verify ip addr show ppp0
How PPPoE finds the server: Your machine broadcasts a PADI (PPPoE Active Discovery Initiation) on the local network. The hAP hears it and responds with a PADO (Offer). Your machine selects the offer and a PPPoE session is negotiated before a single credential is exchanged. Only after the data-link session is up does LCP (Link Control Protocol) run and credentials flow via CHAP. This is the same handshake Session 06 Part 2 described.

Verify active sessions on MikroTik

While trainees are connected, go back to WinBox on the trainer laptop and look at what the router knows about the active sessions.

In WinBox

Go to PPP → Active Connections. You will see a row for each connected trainee. The columns to read:

Column What it means
NameThe PPPoE username the trainee authenticated with
ServiceThe service name you gave the server (sprint-lab)
Caller IDThe MAC address of the trainee's network interface
AddressThe IP assigned to this session from the pool
UptimeHow long this session has been active
Session TimeoutRemaining seconds — counting down from the RADIUS value

In the Terminal

# View all active PPP sessions /ppp active print detail # Example output: 0 name="irene" service="sprint-lab" caller-id="AA:BB:CC:DD:EE:FF" address=10.0.0.2 uptime=1m34s session-timeout=26s radius=yes encoding=""
# Watch it live (updates every second) /ppp active print interval=1

RADIUS accounting log

In User Manager, go to Log. You will see Accounting-Start entries when each person connects and Accounting-Stop entries when they disconnect. The Stop entry includes a Terminate-Cause field. When the router times the session out, that field reads Session-Timeout. That confirms the policy was enforced correctly.

# Example RADIUS accounting record (simplified): Acct-Status-Type: Stop User-Name: irene Session-Id: 8000001 Acct-Session-Time: 180 Terminate-Cause: Session-Timeout ← router enforced the RADIUS rule

The prize: what happens at timeout

Once you are connected and authenticated, your instructor will give you a direct link. Open it on your phone before your session expires. The page will show your personal countdown mirroring what the router is doing. When the router ends your session, you will lose connectivity and the page will show that your session terminated.

Each person's page is their own. The link is specific to you. You can see what everyone else got as an allocation, but you can only watch your own timer. The page is a mirror of the RADIUS Session-Timeout the router received — not a software decision, a network one.

Your links

When your PPPoE session goes down, your machine will try to reconnect automatically (most operating systems do). If you reconnect before the class ends, RADIUS will apply the same Session-Timeout again — the policy does not care how many times you reconnect.

This is exactly what ISPs do with a different number. A 24-hour timed session for a daily voucher, a monthly session with a data cap, a corporate user with unlimited time but throttled speed after 10 GB — these are all different RADIUS attributes applied at authentication time. The mechanism is the same.

Troubleshooting drills

These are the problems that happen in real labs and on real networks. Work through each scenario and identify what the real cause is before checking the answer.

Drill 1: PPPoE client connects but no IP is assigned

Symptom: The connection status in Windows says "Connected" but ipconfig shows 0.0.0.0 or no PPP adapter.

Likely cause: The IP pool is empty or misconfigured, or the profile's remote-address field does not point to the correct pool name. Check with /ip pool print and /ppp profile print.

Drill 2: Authentication fails — client shows error 691

Symptom: Windows error 691: "The remote connection was denied because the username and password combination you provided is not recognised."

Likely cause: One of three things: the username does not exist in User Manager, the password is wrong, or the RADIUS shared secret on the router does not match the one in User Manager. Check all three. Start with the shared secret — it is the most common mistake.

Drill 3: PPPoE connects but session drops immediately

Symptom: The session appears in PPP Active for less than 2 seconds then disappears.

Likely cause: RADIUS returned a Session-Timeout of 0 or a negative value, or the user's account has expired in User Manager. Open the Log in User Manager and look for a Terminate-Cause on the Accounting-Stop record.

Drill 4: RADIUS is not responding — all connections stall

Symptom: Connections hang at the authentication stage indefinitely.

Likely cause: User Manager package is not running, or the /radius entry on the router has a wrong address or port. Check with /radius print and confirm User Manager is installed and active in /system package print.

Drill 5: Session timeout is not being honoured

Symptom: Irene's session should drop at 3 minutes but she is still connected at 5 minutes.

Likely cause: The router profile does not have use-radius=yes set, so the session is being authenticated locally without applying RADIUS attributes. The local /ppp secret list may have shadow credentials that match without a timeout. Check with /ppp profile print detail and remove any matching entries from /ppp secret.

What you just proved

Run through this checklist after the lab finishes. Each item is a link between something you physically experienced today and something Session 06 described.

  • check_circleYou ran a PPPoE handshake from scratch. PADI → PADO → PADR → PADS happened before any credentials left your machine.
  • check_circleYour machine negotiated LCP with the hAP to agree on authentication method (CHAP or MSCHAPv2).
  • check_circleCHAP means your password was never sent in plain text. A challenge was sent, your machine hashed the password with it, and only the hash travelled over the wire.
  • check_circleThe hAP forwarded your credentials to RADIUS over UDP. The router is the RADIUS client. User Manager is the RADIUS server.
  • check_circleRADIUS returned an Access-Accept with a Session-Timeout attribute. That number is now a live countdown inside the router.
  • check_circleYou were assigned an IP from a pool, not a static address. The pool is managed by the router. When your session ends, the IP returns to the pool.
  • check_circleWhen the timer hit zero the router sent no message to your machine. The PPPoE session was torn down unilaterally. This is normal behaviour. The network enforces policy, not the device.
  • check_circleThe RADIUS log shows a Terminate-Cause of Session-Timeout. This is the accounting record that an ISP uses to audit session history.

Every ISP in Tanzania doing PPPoE is building exactly what you built today. The scale is different. The protocol is identical.

Session 07 closing note

Key terms from this session

Term What it is
PPPoE serverThe device that listens for PADI broadcasts and creates the PPPoE tunnel per client. In this lab: the hAP.
PPPoE clientThe device that initiates the connection. In this lab: your laptop.
RADIUS clientThe device that sends authentication requests to RADIUS. In this lab: the hAP (the same device as the PPPoE server).
RADIUS serverThe service that holds user credentials and policies. In this lab: User Manager running on the hAP.
Access-AcceptRADIUS response meaning: credentials valid, here are the session policies.
Access-RejectRADIUS response meaning: credentials invalid or policy denies access.
Session-TimeoutRADIUS attribute 27. Maximum seconds before the session is forcibly terminated.
Accounting-StartRADIUS packet sent when a session begins. Records start time, session ID, and assigned IP.
Accounting-StopRADIUS packet sent when a session ends. Includes duration, bytes in/out, and Terminate-Cause.
Shared secretThe pre-shared string that proves a RADIUS client is authorised to use this RADIUS server. Must match on both ends.
IP poolA range of IP addresses the router draws from when assigning a client an address during session creation.
CHAPChallenge Handshake Authentication Protocol. Password never travels in plain text. A hashed response to a server challenge travels instead.