Network Authentication and Authorization
Why does the university Wi-Fi ask for a login while the guest network does not? Why does a banking app wait for an SMS code even though it knows your password? In the last practical class of the course we put together the AAA system that controls who is getting into the network (authentication), what they may do (authorization) and what they have done (accounting): RADIUS and TACACS+, 802.1X, salted hashes and one-time codes — and at the end a capstone audit that ties the whole course together.
Lesson goals and plan
By the end of the lesson you will…
- you can tell the stages of identification, authentication, authorization and accounting (AAA) apart
- you can explain authentication factors and MFA and compute an HOTP/TOTP code in Python
- you can prove why passwords must be stored not in plain text but with a salt and a slow hash
- you can compare RADIUS and TACACS+ by port, encryption and functions
- you can explain step by step the exchange between the supplicant, the authenticator and the authentication server in 802.1X
- you can model role-based access control (RBAC), a lockout policy and accounting records in a program
- you can combine everything learned during the course and automatically audit a campus network
Plan (according to the syllabus)
- Network Authentication and Authorization
Compare AAA with an airport: passport control is authentication, which flights the boarding pass lets you board is authorization, the cameras and the logbook are accounting. If one is missing, the others work only by halves.
The student Malika used her LMS password on several sites. One of them was hacked, and the password database leaked onto the Internet. The next day someone tried to log in to the university system in Malika’s name — the password was right, but the system asked for the 6-digit code on her phone. The attacker had no phone. The login was denied, Malika received a warning, and the administrator saw in the log which IP the attempt came from. In this small story all three “A”s of AAA worked. Today we learn to build them at the network level — on Wi-Fi, a switch port and a router console.
Key terms
Theory reminder
| Factor | Examples | Weakness |
|---|---|---|
| Something you know (knowledge) | A password, a PIN, a secret question | Guessing, phishing, reusing one password in many places |
| Something you have (possession) | An app on your phone (TOTP), an SMS code, a hardware key (FIDO2), a smart card, an ID card | Can be lost; an SMS can be intercepted through a SIM swap |
| Something you are (inherence) | A fingerprint, a face, a voice | Cannot be replaced; often checked locally inside the device |
MFA = different kinds of factors. A password + a secret question are both “something you know”, so that is not MFA. A password + a code on your phone is genuine two-factor authentication (2FA). Government service portals also use factors beyond a password for login, such as an SMS code, an electronic digital signature (EDS) or an ID card.
| Feature | RADIUS | TACACS+ |
|---|---|---|
| Transport | UDP 1812 (auth), 1813 (accounting); old: 1645/1646 | TCP 49 |
| Encryption | Only the password field is hidden | The whole message body is encrypted |
| AAA separation | Authentication and authorization in one reply (Access-Accept) | All three A’s are separate — each command can be authorized individually |
| Standard | An open standard (RFC 2865, 2866) | Originated at Cisco, described in RFC 8907 |
| Typical use | Users getting onto the network: Wi-Fi, 802.1X, VPN | Administrators managing routers/switches |
Network Authentication and Authorization
Three sample tasks: storing a password correctly, configuring AAA through RADIUS on a router, and 802.1X on a switch port. Two simulators: the 802.1X/RADIUS exchange and a password-strength meter. Then you compute one-time codes (HOTP) yourself.
Sample task 1. How should a password be stored?
Condition: suppose the users table of the department website has leaked. What does the attacker get with each of three storage methods?
| Method | What is in the database | If it leaks |
|---|---|---|
| Plain text | aziz | Andijon#2026 | Every password is known at once — the worst case |
| A fast hash without a salt (SHA-256) | aziz | 3f1a… | Identical passwords give identical hashes; popular passwords are found in an instant from ready-made tables; the rest are guessed on a GPU at billions per second |
| A salt + a slow hash (bcrypt, scrypt, Argon2, PBKDF2) | aziz | $argon2id$…tuz…xesh | Each password has to be guessed separately and very slowly — strong passwords are practically never found |
- At registration
Generate a random salt for each user (for example, 16 bytes), compute
hash = H(salt + password)and write the salt and the hash to the database. The password itself is stored nowhere. - At login
Take the user’s salt from the database, recompute the hash with the entered password and compare it with the stored one (
hmac.compare_digest— a timing-safe comparison). - Why “slow”?
0.1 seconds is unnoticeable for a user, but if every guess takes the attacker 0.1 seconds, billions of attempts take years. For simplicity the tasks in this lesson use SHA-256, but a real system uses Argon2id or bcrypt.
Simulator 1: a password-strength meter
Type a sample password (do not type your real password! — the page sends it nowhere, but it is a good habit). The meter computes the entropy (in bits) from the character set and the length and shows the approximate time needed to guess it at random in two cases: a fast hash (1010 guesses per second, a powerful GPU) and a slow hash (104 per second). Popular dictionary passwords are found in an instant regardless of their entropy.
:ik-qulf: Password lab
Experiment +10 XP: compare “Andijon2026”, “andijon2026!”, “Choynak-Olma-Metro-42” and “xQ7#pL9!”. Which one is easy to remember yet came out the strongest? Which has more effect — the length or the variety of characters?
Sample task 2. AAA through RADIUS on a router
Condition: the department has 6 routers and switches. Keeping a separate admin password on each is risky and inconvenient. Control access to all the devices through a central RADIUS server (10.2.0.20), and if the server goes down — a local backup account.
Cisco IOS: centralised AAAaaa new-model ! RADIUS server and the shared secret key radius server KAFEDRA-RAD address ipv4 10.2.0.20 auth-port 1812 acct-port 1813 key <uzun-maxfiy-kalit> aaa group server radius RAD-GRP server name KAFEDRA-RAD ! A1: who can log in (RADIUS first, the local database if there is no reply) aaa authentication login default group RAD-GRP local ! A2: which privilege level after login aaa authorization exec default group RAD-GRP local ! A3: record the start and the end of the session aaa accounting exec default start-stop group RAD-GRP ! Backup account (only when RADIUS is not working) username zaxira privilege 15 secret <kuchli-parol>
- aaa new-model
Turns on the AAA mechanism — after that, login methods work according to a method list.
- The order of the method list
group RAD-GRP local: RADIUS first. The device falls back to the local database only if the server does not respond. If the server says “Reject”, it does not fall back to the local database — this is important! - Authorization
The user is given a privilege level based on the attributes in the RADIUS reply: a teacher — view only, an administrator — configure.
- Accounting
Every login and logout is recorded on the server: who, to which device, when. When there are many devices and commands have to be controlled separately, TACACS+ is often chosen.
Sample task 3. 802.1X on a switch port
Condition: nobody should be able to plug their laptop into a socket in the computer lab and get into the internal network. The port should open only after the user has authenticated, and a VLAN should be assigned according to the RADIUS reply.
Cisco IOS: port-based controlaaa authentication dot1x default group RAD-GRP aaa authorization network default group RAD-GRP dot1x system-auth-control interface GigabitEthernet1/0/5 switchport mode access authentication port-control auto ! the port is closed until authentication dot1x pae authenticator
Supplicant
The 802.1X client on the user’s device (built into Windows, Android, macOS). It supplies a login/password or a certificate.
Authenticator
A switch or a Wi-Fi access point. It “translates” EAP messages from EAPOL to RADIUS and opens/closes the port.
Authentication server
A RADIUS server (for example, FreeRADIUS, Microsoft NPS). It checks against the user database and returns attributes such as the VLAN.
Simulator 2: the 802.1X + RADIUS exchange
Choose a scenario and press Next step. Watch which message goes from which side to which, and over which protocol. The port state and the assigned VLAN are shown at the top.
:ik-qalqon: Port Gi1/0/5 unauthorized
One-time codes: how do HOTP and TOTP work?
The authenticator app on the phone and the server know the same secret key (shared once through a QR code). Computing a code: HMAC-SHA1(key, counter) → “dynamic truncation” (the low 4 bits of the last byte give an offset, 4 bytes are taken from that place, and the highest bit is dropped) → mod 106. In TOTP the counter = Unix time // 30, so the code changes every 30 seconds and works even without the Internet.
Test runs: first predict, then check
// REMEMBER IN 1 MINUTE
- AAA: authentication (who are you?), authorization (what is allowed?), accounting (what did you do?).
- MFA — factors of different kinds: something you know + something you have + something you are.
- Passwords: a salt + a slow hash (Argon2, bcrypt, PBKDF2); never in plain text.
- RADIUS: UDP 1812/1813, only the password is hidden. TACACS+: TCP 49, full encryption, the A’s are separate.
- 802.1X: supplicant → authenticator (EAPOL) → RADIUS; the VLAN comes in the reply.
Independent tasks
7 tasks — from a password policy to accounting. Use input() without a prompt text. All logins and passwords are training samples.
Common mistakes
| Error | Consequence | Correct answer |
|---|---|---|
| Confusing authentication and authorization (“they got in — so they may do everything”) | A student can change the grades | The principle of least privilege, RBAC |
| Passwords in plain text or with an unsalted MD5/SHA | If the database leaks — all the accounts go with it | A salt + Argon2id / bcrypt / PBKDF2 |
One shared admin account on every device | Nobody knows who did what, and the password stays when an employee leaves | Central AAA (RADIUS/TACACS+), personal accounts, accounting |
The local backup account is first in the aaa ... local list | Central control is bypassed | group RAD-GRP local — the local one last |
| The server certificate is not checked in 802.1X | A fake access point gets the proof of the password | Mandatory checking of the server certificate and its name on the supplicant |
| No lockout policy | Unlimited brute-force | Limiting attempts, delays, MFA |
| The error message tells apart “No such login” / “Wrong password” | The attacker finds out which logins exist | A general “Wrong login or password” for the outside user |
Boss level
Boss level: a mini-RADIUS server with MFA
Write a simplified AAA server for the department Wi-Fi +70 XP. The user database is in the code: a salt, a hash, a role, an HOTP key (or None — no MFA) and a counter.
Input: n, then n lines login password otp (for a user without MFA put - in place of otp).
Rules (in this order): no such login → Access-Reject: login (foydalanuvchi yo‘q); the hash does not match → (parol xato); if there is a key, otp must equal one of the HOTP codes from the counter’s current value c to c+2, otherwise (OTP xato); on a match, counter = the found value + 1 (so a code cannot be reused!).
Success: Access-Accept: login (rol=talaba, VLAN=20). At the end Accept: a, Reject: b.
End of the course: the capstone project
You have passed through the “stops” of 21 practical classes: IP addressing and subnetting, DHCP and the default gateway, CIDR, static and dynamic routing, HTTP/HTTPS, FTP/SFTP, SNMP, VPN, security and AAA. Now we combine them in a single task.
Task: an audit program that checks the inventory of devices on a campus network. Each device line: name ip/prefix gateway services (services separated by commas, for example ssh,https). The checks and messages (in this order) +100 XP:
- the IP is the network or broadcast address of its own subnet (if the prefix is 30 or smaller) →
IP tarmoq/broadcast manzili(subnetting); - the gateway does not belong to the device’s subnet →
Shlyuz boshqa subnetda(default gateway, CIDR); - the services contain
telnet→Telnet (SSH ishlating);ftp→FTP (SFTP ishlating);httpis there andhttpsis not →HTTP (HTTPS qo‘shing);snmp-public→SNMP community public;pptp→PPTP (IKEv2/WireGuard)(services, SNMP, VPN, security).
For each device print name: OK or name: message1; message2, and at the end Moslik: k/n (the number of devices without problems).
The capstone report
- A campus network diagram: at least 3 VLANs/subnets, a router, a switch, a server and Wi-Fi; the address and gateway of each subnet.
- An address-plan table (subnetting/CIDR): network, prefix, number of hosts, gateway, DHCP range.
- Routing: static routes or an OSPF configuration (with sample commands).
- Services: HTTPS, SFTP, SNMPv3 (without a public community), DNS.
- Security and AAA: firewall rules, VPN (remote access), 802.1X/RADIUS, an MFA policy.
- The output of the audit program and the fixes of the problems found (before/after).
A closing word. The “Computer Networks” course ends here, but your network journey is only beginning. In the first lesson you followed the path of a single packet — now you can address it, route it, put it into an encrypted tunnel, pass it through a firewall and check who sent it. Recommended next steps: assemble your whole capstone diagram in Cisco Packet Tracer, analyse your own traffic with Wireshark (only on your own device) and prepare for the CCNA level with the Cisco Networking Academy (netacad.com) courses. Networks are the foundation of every IT field: whether you become a programmer, an administrator, a cybersecurity specialist or a cloud engineer, you will need this knowledge every day. Good luck, engineer!
Reinforcement
Review questions
Explain the difference between identification, authentication and authorization with an example.
Entering a login when connecting to Wi-Fi is identification; checking the password and the code is authentication; giving a teacher VLAN 10 and the right to access systems is authorization.
Why is accounting needed?
To record who used the network, when, from where and for how long: for investigating incidents, audit, traffic billing and detecting violations.
Explain the three authentication factors and the concept of MFA.
Something you know (a password), something you have (a phone, a token, a card), something you are (biometrics). MFA is the use of at least two factors of different kinds.
How should passwords be stored, and why?
With a random salt for each user and a slow hash function (Argon2id, bcrypt, scrypt, PBKDF2). Even if the database leaks, recovering the passwords is very expensive; identical passwords also look different.
How do HOTP and TOTP differ?
HOTP creates a code from a counter (it grows with each use), TOTP from time (usually a 30-second step). Both are based on an HMAC with a shared key.
Compare RADIUS and TACACS+.
RADIUS: UDP 1812/1813, only the password field is hidden, authentication and authorization together; for users getting onto the network. TACACS+: TCP 49, the whole message is encrypted, AAA is separate, command-level authorization; for managing devices.
Name the three roles in 802.1X and the main sequence of messages.
Supplicant (the client), authenticator (the switch/AP), authentication server (RADIUS). EAP-Request/Identity → EAP-Response/Identity → Access-Request → (Access-Challenge, TLS tunnel) → Access-Accept/Reject → EAP-Success/Failure → Accounting Start.
What is MAB and why is it considered a weak method?
MAC Authentication Bypass — connecting devices without an 802.1X client (a printer, a camera) by their MAC address. A MAC is easy to spoof, so such devices are placed in a restricted VLAN.
How are the principle of least privilege and RBAC related?
Each user is given only the rights needed for their work. RBAC does this through roles: rights are attached to a role and the user is attached to a role — it is easy to manage and has few errors.
Independent work
The independent-study topic in the course syllabus: “Network security: authentication, encryption, SSL/TLS and the main cyberattacks.” (6 hours). This practical class relies on the authentication part of the topic. According to your variant: (1) draw the AAA diagram (who is the supplicant, the authenticator, the server), (2) build a table of roles and permissions, (3) write a password and MFA policy, (4) carry out the variant’s Python task, (5) explain in 1 page the part related to SSL/TLS or encryption.
| Criterion | Points |
|---|---|
| The AAA diagram is correct, the roles are clear | 1 |
| The table of roles and permissions follows the principle of least privilege | 1 |
| The password and MFA policy is justified | 1 |
| The Python program works and has been tested | 1 |
| A note on SSL/TLS or encryption, sources | 1 |
Summary
Your lesson results
Your results are saved in this browser. Read all the sections and complete the exercises and assignments.