logoalt Hacker News

Implement7347 • today at 3:04 AM • 1 reply • view on HN

Pretty interesting writeup, i've always been curios about how authentication between the router and isp works, btw i got my isp credentials by finding a root rce on my isp provided router, which was fun


Replies

skibz • today at 11:52 AM

Assuming a very vanilla ISP and PPPoE (and glossing over a lot of other things), the username and password from your router is received by a RADIUS [0] server [1] (that your ISP operates) when your router tries to establish the PPPoE tunnel and get you online.

This RADIUS server will check whether your account exists (authentication) and whether you may continue to connect to the Internet (authorisation - you might have a bandwidth limit, for example, or maybe you haven't paid your bill).

If those checks pass, the tunnel is established and you're online. From this point, your connection is being metered (accounting), so that the ISP can monitor your usage and dynamically shape or disconnect your connection based on your account plan that you've paid for with the ISP.

There's obviously a million and one ways that this could work, but the core of the RADIUS protocol itself is relatively simple to understand and apply, even in a homelab.

Authentication and authorisation (in the simplest cases) is three packet types: Access-Request (sent by your router, into which your username and password are encoded), Access-Accept, and Access-Reject.

And accounting has two (Accounting-Request and Accounting-Response) with Accounting-Request including a status type (Start, Interim-Update, and Stop) to indicate the beginning, periodic updates, and termination of the connection along with its bandwidth usage.

This old project [2] I worked on a long time ago demonstrates precisely what I described above.

[0]: https://en.wikipedia.org/wiki/RADIUS

[1]: https://github.com/FreeRADIUS/freeradius-server

[2]: https://github.com/io-digital/tephra