IP services
Core15
Walk me through how a client gets an IP address from DHCP.
Say this first
Four messages, known as DORA. The client broadcasts a DISCOVER from 0.0.0.0 port 68 to 255.255.255.255 port 67. Each server answers with an OFFER. The client broadcasts a REQUEST that names the server it picked (option 54), and that server confirms with an ACK carrying the lease and options. Server side is UDP 67, client side is UDP 68.
Go deeper
The four messages
Message Sent by IP source to destination What matters in it DISCOVER client 0.0.0.0 to 255.255.255.255 client MAC in chaddr, transaction IDxidOFFER server server IP to the offered IP, or broadcast yiaddr(the offered address), option 54 server ID, lease, mask, gateway, DNSREQUEST client 0.0.0.0 to 255.255.255.255 option 50 (the address it wants), option 54 (the server it chose) ACK server server IP to the offered IP, or broadcast the final lease (option 51) and all options The REQUEST is a broadcast on purpose. Every server that made an offer sees it, and the ones that were not chosen put their offered address back in the pool.
Unicast or broadcast replies
The client has no address yet, so how does the OFFER reach it? The client decides with the broadcast flag, the top bit of the 16-bit
flagsfield:- Flag set: the server (or relay) broadcasts the OFFER and ACK.
- Flag clear: the server sends them as unicast IP to
yiaddr, addressed at layer 2 to the client MAC inchaddr.
Stacks that cannot accept unicast IP before the interface has an address set the flag.
Under the hood
DHCP messages are BOOTP packets with option 53 saying which message they are. That is why the ports are named
bootps(67) andbootpc(68). Option 53 values: 1 DISCOVER, 2 OFFER, 3 REQUEST, 4 DECLINE, 5 ACK, 6 NAK, 7 RELEASE, 8 INFORM.After the ACK, many clients probe the address with ARP (RFC 5227) before using it. If another host answers, the client sends DECLINE and starts again.
They will ask next
Why does the client use fixed port 68 instead of an ephemeral port?
Replies may be broadcast. If they went to an ephemeral port, every host on the segment would receive a broadcast aimed at whatever application happened to own that port. A reserved client port means only DHCP clients listen for it.
What is DHCPINFORM for?
A host that already has a static address asks only for configuration (DNS servers, domain, proxy settings). The server answers with an ACK that carries options but no lease.
Can DHCP work with fewer than four messages?
Yes. Rapid Commit (option 80, RFC 4039) allows a two-message DISCOVER and ACK exchange in DHCPv4, but support is patchy. It is far more common in DHCPv6, where Solicit and Reply can complete the exchange.
Traps
- Saying the OFFER is always a broadcast or always a unicast. It depends on the broadcast flag and on whether a relay is in the path.
- Swapping the ports. Server listens on UDP 67, client on UDP 68.
How did you do?Book 3.3 Internet (IP)Own pageWhich DHCP options do you configure most, and what are options 43, 66 and 150 for?
Say this first
The everyday set is option 1 subnet mask, 3 default gateway, 6 DNS servers, 15 domain name and 51 lease time. For devices that boot from the network, 66 is the TFTP server name and 67 the boot file (PXE and many IP phones), 150 is Cisco's list of TFTP server addresses for Cisco IP phones, and 43 is vendor-specific data, which Cisco access points use to learn their wireless controller addresses. Option 82 is added by relays and switches, not set in a pool.
Go deeper
The options worth knowing by number
Option Name Notes 1 Subnet mask 3 Router default gateway list 6 DNS servers list of addresses 15 Domain name DNS suffix for the client 42 NTP servers 43 Vendor-specific information format defined by the vendor 50 Requested IP address client to server 51 Lease time seconds on the wire 53 Message type DISCOVER, OFFER and so on 54 Server identifier which server owns the lease 60 Vendor class identifier the client says what kind of device it is 61 Client identifier IOS bindings show this, for example 01 plus the MAC 66 TFTP server name one name or address, as a string 67 Boot file name PXE 82 Relay agent information inserted by relays or snooping switches 121 Classless static routes 150 TFTP server addresses Cisco, list of IPs Option 43 for Cisco APs
A Cisco lightweight AP expects a type-length-value: type
f1, length 4 bytes per controller, then each controller address in hex. Two controllers at 10.0.50.10 and 10.0.50.11:f1+08+0a00320a+0a00320b.Cisco IOS ip dhcp excluded-address 10.50.0.1 10.50.0.10 ip dhcp pool AP-MGMT network 10.50.0.0 255.255.255.0 default-router 10.50.0.1 dns-server 10.0.0.53 option 43 hex f1080a00320a0a00320b ! ip dhcp excluded-address 10.40.0.1 10.40.0.10 ip dhcp pool VOICE network 10.40.0.0 255.255.255.0 default-router 10.40.0.1 dns-server 10.0.0.53 domain-name corp.example.com option 150 ip 10.0.0.15 10.0.0.16 lease 0 8lease 0 8is 0 days and 8 hours. The IOS default is 1 day. Other vendors' APs and phones use 43 with their own sub-option formats, usually matched by option 60.They will ask next
How does the server know what kind of device is asking?
Option 60 (vendor class identifier) and option 55 (the list of options the client wants). Servers can match on option 60 and hand phones, APs and PCs different options from the same scope.
A Cisco phone gets an address but never registers. Which option do you check?
Option 150 (or 66) must point at the call manager's TFTP server, and UDP 69 must be allowed from the voice VLAN to it. The phone downloads its config file over TFTP before it registers.
What happens if the server sends both option 121 and option 3?
RFC 3442 says the client must ignore option 3. If you use classless static routes, include the default route (0.0.0.0/0) inside option 121 itself.
Traps
- Typing the WLC address for option 43 as plain text. Cisco APs expect the hex TLV.
- Treating options 66 and 150 as the same thing. 66 is a single standard string, 150 is Cisco's list of IP addresses.
How did you do?Book 3.3 Internet (IP)Own pageA user's PC shows a 169.254.x.x address. How do you troubleshoot it?
Say this first
169.254.0.0/16 is link-local (APIPA, RFC 3927). Windows picked it itself because no DHCP server answered. Either the DISCOVER never reached a server or the reply never came back. I follow the packet: the access port and VLAN, then the relay on the gateway, then the path and return route to the server, then the scope, then the server.
Go deeper
In the order the packet travels
- Access port: up, in the right VLAN, not err-disabled.
show interfaces status,show vlan brief. - Spanning tree: a port without PortFast spends 30 seconds in listening and learning. The client
can give up before the port forwards. Access ports get
spanning-tree portfast. - DHCP snooping: if the uplink is not trusted, the switch drops the OFFER. Check the trusted
ports in
show ip dhcp snooping. - Relay:
show ip interface Vlan20 | include Helpermust show the server. - Path to the server:
ping 10.0.12.1 source Vlan20from the gateway tests the route there and the server's route back to the client subnet in one go. - Scope: exists for that subnet and is not full.
show ip dhcp poolon IOS, scope statistics on Windows. - Capture:
debug ip dhcp server packeton an IOS server, orudp port 67 or udp port 68in tcpdump. In Wireshark the display filter isdhcp.
On Linux there is usually no 169.254 address at all, just no IPv4 address, unless the network manager is set to fall back to link-local.
They will ask next
Why can the PC still reach some devices with a 169.254 address?
Link-local works between hosts on the same segment that also have 169.254 addresses. It never crosses a router, so nothing beyond the VLAN is reachable.
What does a capture at the client show when the server never answers?
Repeated DISCOVERs with the
secsfield climbing and no OFFER. The next capture point is the relay: if DISCOVERs leave the relay toward the server and nothing returns, look at the server and its return route.
Traps
- Rebooting the PC first. It retries the same failing exchange and tells you nothing about where it breaks.
- Forgetting PortFast on access ports. It shows up as DHCP failures after every link flap.
How did you do?Book 3.3 Internet (IP)Own page- Access port: up, in the right VLAN, not err-disabled.
Walk me through what happens when a client resolves www.example.com.
Say this first
The stub resolver on the client checks its own cache and hosts file, then sends one recursive query (RD bit set) to its configured resolver. If the resolver has nothing cached, it walks the tree itself: a root server refers it to the .com servers, a .com server refers it to example.com's name servers, and an authoritative server for example.com returns the A record. The resolver caches the answer and the referrals for their TTLs and hands the record back to the client.
Go deeper
The walk
Output PC1 stub -- recursive query, RD=1 --> resolver 10.0.0.53 resolver -- www.example.com A? ----> a root server referral: com. NS plus glue resolver -- www.example.com A? ----> a .com TLD server referral: example.com. NS plus glue resolver -- www.example.com A? ----> ns1.example.com answer, AA bit set resolver -- answer, RA=1 ----------> PC1With QNAME minimisation (RFC 9156) the resolver asks the root only about
com.and the TLD only aboutexample.com., so the full name is not leaked to servers that do not need it.Details interviewers probe
- Root addresses come from the root hints built into the resolver: 13 names, a to m.root-servers.net, each served by many anycast instances worldwide.
- Glue:
ns1.example.comlives inside the zone it serves. The .com servers include its A and AAAA records in the referral, otherwise the resolver could never reach it. - Caching: the next query for
mail.example.comskips root and TLD, because the example.com NS set is already cached. - Transport: UDP 53, with TCP 53 for answers too big for UDP.
- Client side: the hosts file is checked first on most systems, the OS has its own cache (the Windows DNS Client service, systemd-resolved on 127.0.0.53), browsers keep another, and search domains get appended to short names.
They will ask next
What is the AA bit?
Authoritative Answer. Only a server authoritative for the zone sets it. An answer from a resolver's cache does not have it, so
aain dig's flags tells you that you reached the source of truth.What is a forwarder, and a conditional forwarder?
A forwarder is a resolver that hands its recursive queries to another resolver instead of walking from the root, for example AD DNS forwarding to a central resolver. A conditional forwarder does that only for one domain, such as a partner's zone reached over a VPN.
What is split-horizon DNS?
The same name gets different answers depending on who asks: internal clients get the private address of a server, the internet gets the public one. It is done with separate zones or views.
Traps
- Saying the client walks the tree itself. A stub sends one recursive query and the resolver does the iterative work.
- Saying there are only 13 root servers. There are 13 root server names, run as many anycast instances.
How did you do?Book 9.3 Infrastructure ApplicationsOwn pageName the common DNS record types and what each one is for.
Say this first
A maps a name to an IPv4 address, AAAA to IPv6. CNAME makes a name an alias of another name. MX names a domain's mail servers with a preference (lower wins). NS lists a zone's authoritative servers. PTR maps an address back to a name. SOA holds the zone's admin data and timers. TXT carries text such as SPF, DKIM, DMARC and domain verification tokens. SRV locates a service with priority, weight, port and target host.
Go deeper
In zone file form
Output example.com. 3600 IN SOA ns1.example.com. hostmaster.example.com. 2026111001 7200 3600 1209600 3600 example.com. 3600 IN NS ns1.example.com. example.com. 3600 IN NS ns2.example.net. example.com. 3600 IN MX 10 mail1.example.com. example.com. 3600 IN MX 20 mail2.example.com. example.com. 3600 IN TXT "v=spf1 mx -all" www.example.com. 300 IN A 203.0.113.80 www.example.com. 300 IN AAAA 2001:db8:80::80 shop.example.com. 300 IN CNAME www.example.com. _sip._tcp.example.com. 3600 IN SRV 10 60 5060 sip1.example.com.And in the reverse zone
113.0.203.in-addr.arpa:Output 80.113.0.203.in-addr.arpa. 3600 IN PTR www.example.com.SRV fields
priority weight port target. Lower priority is tried first. Among equal priorities, weight sets the share of traffic. Active Directory clients find domain controllers this way, through names like_ldap._tcp.dc._msdcs.corp.example.com.Others worth naming
- CAA: which certificate authorities may issue certificates for the domain. CAs must check it.
- DS, DNSKEY, RRSIG, NSEC, NSEC3: DNSSEC.
- HTTPS and SVCB (RFC 9460): connection hints such as ALPN, so a browser can learn that a site speaks HTTP/3 before it connects.
- NAPTR: used with SRV in SIP and ENUM.
They will ask next
Why must Active Directory clients use the AD DNS servers?
They find domain controllers, Kerberos and LDAP through SRV records that only the AD DNS zones hold. Point a domain member at a public resolver and logons, GPOs and domain joins fail.
How do SPF, DKIM and DMARC use TXT records?
SPF lists which servers may send mail for the domain. DKIM publishes the public key used to check message signatures, under a selector name. DMARC, at
_dmarc.example.com, tells receivers what to do when SPF or DKIM fail and where to send reports.
Traps
- Saying the higher MX preference wins. Lower is preferred.
- Pointing an MX or NS record at a CNAME. RFC 2181 forbids it and some mail servers fail on it.
How did you do?Book 9.3 Infrastructure ApplicationsOwn pageHow does reverse DNS work?
Say this first
A PTR record maps an address back to a name. The address is written backwards under a special domain: 192.0.2.25 becomes 25.2.0.192.in-addr.arpa. IPv6 uses ip6.arpa with every hex nibble written in reverse. Whoever holds the address block controls the reverse zone, usually your ISP or your RIR delegation, not whoever owns the forward domain.
Go deeper
Why backwards
DNS names get more specific from right to left. IP addresses get more specific from left to right. Reversing the octets lets reverse zones be delegated along address boundaries: the /24 owner gets
2.0.192.in-addr.arpa.IPv6
2001:db8::25is expanded to 32 nibbles and reversed:Output 5.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpadig -x 2001:db8::25builds that name for you.Blocks smaller than /24
Reverse delegation follows octet boundaries. For a /28, RFC 2317 classless delegation uses CNAMEs in the ISP's zone that point into a zone you host. Otherwise you ask the ISP to create the PTRs.
Where it matters
- Mail: receivers check that a sending IP has a PTR and that the name resolves back to the same IP (forward-confirmed reverse DNS). Missing or mismatched records hurt delivery.
- Logs and traceroute output become readable.
- Some servers do reverse lookups on every login (OpenSSH
UseDNS), which makes logins slow when reverse DNS times out.
They will ask next
You have a /28 from your ISP. How do you get PTR records for it?
Ask the ISP to create them, or ask for an RFC 2317 delegation so you can manage them in your own DNS. Adding PTRs to your example.com zone does nothing, because nobody looks there.
How do you look up a PTR?
dig -x 192.0.2.25 +shorton Linux, ornslookup 192.0.2.25. Both build the in-addr.arpa name for you.
Traps
- Thinking PTR records for public addresses live in your own forward zone.
How did you do?Book 9.3 Infrastructure ApplicationsOwn pageExplain inside local, inside global, outside local and outside global using a real example.
Say this first
"Inside" and "outside" say whose address it is: one of my hosts, or a host out there. "Local" and "global" say where you are looking from: from my inside network, or from the outside. PC1 at 192.168.10.10 browsing to 198.51.100.80 through R1's PAT: inside local is 192.168.10.10, inside global is 203.0.113.2 (R1's outside address), and outside local and outside global are both 198.51.100.80, because I do not translate the far end.
Go deeper
The example
R1 has
Gi0/0/1inside (192.168.10.1/24) andGi0/0/0outside (203.0.113.2/29), with PAT on the outside interface.Term Whose address Seen from Value Inside local PC1 inside 192.168.10.10 Inside global PC1 outside 203.0.113.2 Outside local the web server inside 198.51.100.80 Outside global the web server outside 198.51.100.80 The packet walk
- PC1 sends
192.168.10.10:51004 to 198.51.100.80:443: inside local to outside local. - R1 routes it to
Gi0/0/0and rewrites the source:203.0.113.2:51004 to 198.51.100.80:443, which is inside global to outside global. - The reply comes back to 203.0.113.2:51004. R1 rewrites the destination to 192.168.10.10:51004 and routes it inside.
Output R1# show ip nat translations Pro Inside global Inside local Outside local Outside global tcp 203.0.113.2:51004 192.168.10.10:51004 198.51.100.80:443 198.51.100.80:443 Total number of translations: 1The column order is worth memorising: inside global, inside local, outside local, outside global.
When outside local differs
Only with outside NAT, usually for overlapping networks. After a merger the partner's server 10.1.1.50 clashes with our own 10.1.1.0/24, so we make it appear to our users as 172.31.1.50:
Cisco IOS ip nat outside source static 10.1.1.50 172.31.1.50 add-routeOutside global is 10.1.1.50 (its real address), outside local is 172.31.1.50 (what our users use).
add-routeinstalls a route to 172.31.1.50 so the router can forward toward it.They will ask next
Which of the four addresses does PC1 ever see?
Only inside local (itself) and outside local (the far end). The web server only sees inside global and outside global. The router is the one place where all four meet.
Can an inside global address be a private address?
Yes. When you NAT between two private networks, for example toward a partner over a VPN, the inside global can be RFC 1918 space. The terms are about point of view, not public or private.
Traps
- Defining local as private and global as public. It usually works out that way, but the terms mean point of view.
- Getting the column order of show ip nat translations wrong when reading it aloud.
How did you do?Book 3.3 Internet (IP)Own page- PC1 sends
What are the types of NAT, and when do you use each one?
Say this first
Static NAT maps one inside address to one global address permanently, in both directions: for servers that must be reachable from outside. Dynamic NAT maps inside hosts one-to-one onto a pool of global addresses, first come first served, and runs out when the pool is used up. PAT (overload) puts many inside hosts behind one global address by translating source ports as well: that is what nearly every office and home router does. Static PAT, or port forwarding, maps one global address and port to one inside host and port.
Go deeper
The base: mark the interfaces
Cisco IOS interface GigabitEthernet0/0/0 ip address 203.0.113.2 255.255.255.248 ip nat outside interface GigabitEthernet0/0/1 ip address 192.168.10.1 255.255.255.0 ip nat inside interface GigabitEthernet0/0/2 ip address 192.168.20.1 255.255.255.0 ip nat inside ! ip access-list standard NAT-USERS permit 192.168.10.0 0.0.0.255Static NAT, one to one
Cisco IOS ip nat inside source static 192.168.20.10 203.0.113.5Dynamic NAT from a pool
Cisco IOS ip nat pool PUBLIC 203.0.113.3 203.0.113.4 netmask 255.255.255.248 ip nat inside source list NAT-USERS pool PUBLICPAT on the interface address
Cisco IOS ip nat inside source list NAT-USERS interface GigabitEthernet0/0/0 overloadUse the PAT line instead of the dynamic pool line, not with it: one rule per access list.
Type Mapping Inbound connections Typical use Static 1 to 1, permanent yes servers, devices that need a fixed public identity Dynamic 1 to 1 from a pool only while mapped rare today PAT many to 1, by port no user internet access Static PAT 1 address and port to 1 host and port yes, that port only publishing a service on a shared address Policy NAT (
ip nat inside source route-map ...) chooses the translation based on destination too, for example a different address toward a partner network.They will ask next
What happens when a dynamic NAT pool is used up?
The next host gets no translation and its traffic is dropped until an entry times out. That is why plain dynamic NAT is rare now and PAT is the default.
Why does a server need static NAT rather than PAT?
A connection from the internet needs a mapping that already exists. With PAT, an inbound packet that matches no entry is dropped. Static NAT or static PAT creates the mapping in advance.
Traps
- Forgetting
overload. Without it the interface rule is one-to-one, so only one inside host at a time gets out.
How did you do?Book 3.3 Internet (IP)Own pageHow do you publish an internal web server to the internet when you only have one public IP address?
Say this first
Static PAT, also called port forwarding: map the public address and port to the server's private address and port. On IOS,
ip nat inside source static tcp 192.168.20.20 443 interface GigabitEthernet0/0/0 443forwards TCP 443 on R1's outside address to the server, while everyone else keeps sharing that address through PAT. Then permit the traffic to the public address and port, and test from the outside, not from the LAN.Go deeper
Configuration
Cisco IOS interface GigabitEthernet0/0/0 ip address 203.0.113.2 255.255.255.248 ip nat outside interface GigabitEthernet0/0/2 ip address 192.168.20.1 255.255.255.0 ip nat inside ! ip nat inside source static tcp 192.168.20.20 443 interface GigabitEthernet0/0/0 443 ip nat inside source static tcp 192.168.20.30 22 interface GigabitEthernet0/0/0 2222The second line also changes the port: outside users connect to 203.0.113.2 port 2222 and land on SSH port 22 of 192.168.20.30.
Output R1# show ip nat translations Pro Inside global Inside local Outside local Outside global tcp 203.0.113.2:443 192.168.20.20:443 --- --- tcp 203.0.113.2:2222 192.168.20.30:22 --- --- tcp 203.0.113.2:443 192.168.20.20:443 198.51.100.77:50112 198.51.100.77:50112 Total number of translations: 3The lines with
---are the static entries. The third line is a live session from an internet client at 198.51.100.77.Checklist
- The inbound ACL or firewall permits TCP 443 to 203.0.113.2, the global address.
- The server's default gateway is R1. If replies leave through another router, they are never untranslated and the client drops them.
- The ISP does not filter the port.
- Test from outside. Testing from the LAN hits the hairpin problem.
On Linux
Shell iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j DNAT --to-destination 192.168.20.20:443 iptables -A FORWARD -i eth0 -d 192.168.20.20 -p tcp --dport 443 -j ACCEPTThey will ask next
It works from the internet but not from inside the office using the public name. Why?
Hairpinning. Inside users reach the public address through an inside interface, where the router does not translate the destination. Split DNS, which gives inside users the private address, is the clean fix.
The server's default gateway is a different router. What happens?
The SYN arrives through R1 and is translated, but the SYN-ACK leaves through the other router with the private source address. The client never matches it to its connection. Fix the gateway, or source-NAT the inbound traffic on R1 so replies have to come back to it.
Traps
- Testing from inside the LAN and concluding the forward is broken.
How did you do?Book 3.3 Internet (IP)Own pageIs NAT a security feature?
Say this first
Not really. PAT has a side effect that looks like security: an unsolicited inbound packet matches no translation, so it gets dropped. But NAT does no inspection, a static mapping exposes the host completely, and anything an inside host connects to can talk back over that connection. The security comes from a stateful firewall, which does the "replies only" job on purpose and with a policy. On IPv6, where there is usually no NAT, the firewall is all you have.
Go deeper
What NAT is for
Address conservation: RFC 1918 space inside and PAT at the edge. Hiding the internal addressing is a minor bonus, not a control.
What it costs
- It breaks end-to-end addressing, which is why ALGs and NAT traversal exist.
- It makes attribution harder. To know which inside host made a connection at a given time you need translation logs. Carriers running CGNAT keep them for legal requests.
- It complicates troubleshooting: the same flow has different addresses on each side of the box.
The interview answer
Security comes from a stateful firewall policy: default deny inbound, explicit permits for published services, inspection where needed. NAT runs alongside it.
They will ask next
How does an IPv6 home or office network stay protected without NAT?
A stateful firewall on the edge router that blocks unsolicited inbound traffic by default, the same behaviour PAT gave you by accident. RFC 6092 recommends exactly that for home routers.
How do you log NAT on IOS for attribution?
ip nat log translations syslogsends a message for each translation created and deleted. On busy routers, NetFlow or IPFIX based NAT logging is lighter than syslog.
Traps
- Telling an interviewer NAT is your firewall.
How did you do?Book 3.3 Internet (IP)Book 8.5 Example SystemsOwn pageWhat is an NTP stratum, and why does accurate time matter on a network?
Say this first
Stratum is the distance from a reference clock. Stratum 0 is the reference itself (GPS, an atomic clock), stratum 1 is a server attached to it, and each NTP hop adds one, up to 15. Stratum 16 means unsynchronized. Time matters because so much depends on it: lining up logs from many devices, certificate validity for VPNs, 802.1X and HTTPS, Kerberos (Active Directory rejects more than 5 minutes of skew by default), one-time passwords, and evidence that holds up after an incident.
Go deeper
How NTP works
NTP runs on UDP 123 (NTPv4 is RFC 5905). The client stamps four times per exchange:
Stamp Taken when T1 client sends the request T2 server receives it T3 server sends the reply T4 client receives the reply Round-trip delay is
(T4 - T1) - (T3 - T2)and the clock offset is((T2 - T1) + (T3 - T4)) / 2. The formula assumes the path is symmetric, so asymmetric paths show up as offset error. Small errors are slewed (the clock is sped up or slowed down), large ones are stepped. IOS polls between 64 and 1024 seconds by default.A sensible design
- Two to four internal time servers, each fed by several external or GPS sources.
- Every network device syncs to the internal servers, sourced from a loopback.
- Devices log in UTC with millisecond timestamps.
Cisco IOS ntp server 10.0.0.123 prefer ntp server 10.0.0.124 ntp source Loopback0 ntp update-calendar service timestamps log datetime msec show-timezonentp update-calendarkeeps the hardware clock in step, so the router boots with sane time.ntp mastermakes a router serve its own clock (stratum 8 by default): fine in a lab or an isolated network, wrong anywhere real sources exist.They will ask next
Is a stratum 1 server always better than a stratum 2?
No. Stratum counts hops, not accuracy. A stratum 2 server on your LAN usually beats a stratum 1 across the internet, because path delay and jitter dominate the error.
What is SNTP?
Simple NTP: a client that takes time from a server without NTP's filtering and multi-server selection. Good enough for small devices, not for anything that serves time to others.
Traps
- Calling stratum 16 a low-quality sync. It means not synchronized at all.
- Using
ntp masterin production when real time sources exist.
How did you do?Book 9.3 Infrastructure ApplicationsOwn pageWhat are the differences between SNMP v1, v2c and v3?
Say this first
All three share one model: a manager polls agents on UDP 161, and agents send notifications to the manager on UDP 162. v1 and v2c authenticate with a community string sent in clear text. v2c adds GetBulk, 64-bit counters and informs. v3 replaces communities with users and adds real security: authentication with HMAC (MD5 or SHA), encryption (DES or AES) and view-based access control. In production I use v3 with authPriv, and v2c only read-only, locked down with an ACL, on a management network.
Go deeper
v1 v2c v3 Security community, clear text community, clear text users, authentication, encryption Counters 32-bit 32-bit and 64-bit 32-bit and 64-bit Bulk retrieval no GetBulk GetBulk Notifications trap trap, inform trap, inform Operations
Get, GetNext, GetBulk (v2c and later), Set, Response, Trap, Inform, and Report (v3 error and discovery messages).
Read-write is dangerous
A write community or user can change the device. On Cisco, a Set against the config copy MIB can make the router send its whole configuration to a TFTP server. Avoid RW; if you need it, use v3 and a tight view.
A locked-down v2c baseline
Cisco IOS ip access-list standard SNMP-MGRS permit 10.0.0.50 snmp-server community Oct3t-R0-2026 RO SNMP-MGRSWhere it is going
Streaming telemetry (model-driven, gNMI) pushes counters every few seconds instead of waiting to be polled. SNMP stays everywhere for inventory, basic counters and alarms.
They will ask next
Why do 64-bit counters matter?
A 32-bit octet counter wraps after 2^32 bytes, about 34 gigabits. On a 10 Gbps link that is 3.4 seconds, so a 5 minute poll cannot tell how many times it wrapped.
ifHCInOctetsand friends are 64-bit and need v2c or v3.Why does SNMP run over UDP?
It is light, polls tolerate loss, and managers simply retry. A management protocol also has to work when the network is struggling, and UDP needs no connection state for that.
Traps
- Treating community strings as passwords that protect anything. They cross the wire in clear text.
- Configuring RW communities just in case.
How did you do?Book 9.3 Infrastructure ApplicationsOwn pageList the syslog severity levels and explain how logging levels work on a Cisco device.
Say this first
Eight levels, 0 to 7: 0 emergencies, 1 alerts, 2 critical, 3 errors, 4 warnings, 5 notifications, 6 informational, 7 debugging. A lower number is more severe. Setting a level gives you that level and everything more severe:
logging trap warningssends levels 0 to 4. Cisco messages carry the level in their tag, as in%LINK-3-UPDOWN: facility LINK, severity 3, mnemonic UPDOWN.Go deeper
Level Keyword Typical messages 0 emergencies system unusable 1 alerts act now, for example temperature alarms 2 critical critical conditions 3 errors %LINK-3-UPDOWNinterface down4 warnings warnings 5 notifications %LINEPROTO-5-UPDOWN,%SYS-5-CONFIG_I,%OSPF-5-ADJCHG,%BGP-5-ADJCHANGE6 informational ACL log hits such as %SEC-6-IPACCESSLOGP7 debugging debug output A memory aid: Every Awesome Cisco Engineer Will Need Ice cream Daily.
Where logs go on IOS
Destination Command Default level Console logging consoledebugging SSH and telnet sessions logging monitor, plusterminal monitorper sessiondebugging Local buffer logging buffereddebugging Syslog servers logging trapinformational Cisco IOS service timestamps log datetime msec show-timezone service sequence-numbers logging buffered 64000 informational logging console warnings logging source-interface Loopback0 logging host 10.0.0.60 logging trap informationalSyslog uses UDP 514 by default. TCP and TLS (port 6514) are available where the platform supports them. Cisco devices use facility local7 by default.
They will ask next
Why not send debugging level to the syslog server?
Volume. A single debug can produce thousands of lines a second and bury the messages that matter. Informational (6) is the usual level for the servers.
You are on SSH and see no log messages. Why?
Logs go to vty sessions only after
terminal monitorin that session.A syslog server shows priority 189 on Cisco messages. What does that mean?
PRI is facility times 8 plus severity. local7 is facility 23, so 23 x 8 + 5 = 189: a level 5 notification such as an interface line protocol change.
Traps
- Getting the direction wrong.
logging trap 4sends 0 to 4, not 4 to 7. - Logging without NTP and timestamps. Logs with wrong times are close to useless in an incident.
How did you do?Book 9.3 Infrastructure ApplicationsOwn pageCompare TFTP, FTP, SCP and SFTP. Which do you use to move images and configs to network devices?
Say this first
TFTP is UDP 69 with no authentication and no encryption, sending one 512-byte block at a time: simple enough for boot ROMs, PXE and IP phones, but slow and insecure. FTP uses TCP 21 for control plus a separate data connection, with credentials in clear text. SCP and SFTP both run over SSH on TCP 22, so they are authenticated and encrypted. SCP only copies files, while SFTP is a full file protocol with listing, resume and rename. For network devices I use SCP or HTTPS and keep TFTP for boot-time cases that have nothing else.
Go deeper
Protocol Transport Authentication Encryption Notes TFTP UDP 69, then ephemeral ports none none lock-step 512-byte blocks by default FTP TCP 21 control; data from port 20 (active) or to a server port (passive) user and password in clear none (FTPS adds TLS) two connections, painful through NAT SCP SSH, TCP 22 SSH yes copy only SFTP SSH subsystem, TCP 22 SSH yes not FTP over SSH, a separate protocol TFTP limits
The server answers from a new ephemeral port, so stateful firewalls need a TFTP helper. Block numbers are 16 bits, so with 512-byte blocks a file over about 32 MB fails unless both ends support the blocksize option (RFC 2348) or block number rollover.
SCP on IOS
Cisco IOS ip ssh version 2 aaa new-model aaa authentication login default local aaa authorization exec default local ip scp server enablePull an image from a server:
Cisco IOS R1# copy scp://admin@10.0.0.5/isr4400-universalk9.17.09.04a.SPA.bin bootflash: R1# verify /md5 bootflash:isr4400-universalk9.17.09.04a.SPA.binCompare the hash with the one the vendor publishes before you boot it.
OpenSSH 9.0 and later run the SFTP protocol under the
scpcommand by default. To push a file to a device that only has an SCP server, usescp -Ofor the legacy protocol.They will ask next
Why is TFTP so slow over a WAN?
It is lock-step: one block, then wait for its ACK. With 512-byte blocks and a 50 ms round trip that is about 10 KB per second, however fast the link is.
Why does active FTP break through firewalls and NAT?
The server opens the data connection back to the client, to an address and port the client sent inside the PORT command. NAT and firewalls must read and rewrite that payload. Passive mode keeps every connection client-initiated.
Traps
- Saying SFTP is FTP over SSL. That is FTPS. SFTP is part of SSH.
- Assuming TFTP can move a file of any size.
How did you do?Book 9.1 Traditional ApplicationsOwn pageWhat is the difference between CDP and LLDP?
Say this first
Both are layer 2 discovery protocols: each device announces its name, port, platform and management address to directly connected neighbours. CDP is Cisco proprietary, on by default on Cisco gear, sent every 60 seconds with a 180 second holdtime. LLDP is the IEEE 802.1AB standard every vendor speaks, sent every 30 seconds with a 120 second hold time, and often off by default on Cisco (
lldp runturns it on). LLDP-MED extends it for phones: voice VLAN, PoE power and location.Go deeper
CDP LLDP Standard Cisco IEEE 802.1AB Destination MAC 01:00:0C:CC:CC:CC 01:80:C2:00:00:0E Timers 60 s, holdtime 180 s 30 s, hold multiplier 4, so a TTL of 120 s On by default on Cisco IOS yes usually no Extras v2 reports native VLAN and duplex mismatches LLDP-MED: network policy (voice VLAN, DSCP), PoE, inventory, location LLDP frames use EtherType 0x88CC. The mandatory TLVs are Chassis ID, Port ID, TTL and End of LLDPDU.
Security
Both give away platform, software version and addresses, which is useful reconnaissance for an attacker. Keep them on infrastructure links and turn them off on internet-facing and untrusted ports:
Cisco IOS lldp run interface GigabitEthernet0/0/0 no cdp enable no lldp transmit no lldp receiveA subtle one
A switch that does not understand CDP floods it like any other multicast. Two Cisco devices behind an unmanaged switch then list each other as direct neighbours. Standard bridges never forward LLDP sent to the nearest-bridge address.
Verify with
show cdp neighbors detailandshow lldp neighbors detail; on Linux,lldpctlfrom lldpd.They will ask next
How does an IP phone learn its voice VLAN?
A Cisco phone learns it from the switch through CDP. Other vendors' phones use the LLDP-MED network policy TLV. Some fall back to DHCP options when neither is available.
Two Cisco routers list each other as CDP neighbours, but a switch sits between them. How?
The switch does not run CDP, for example an unmanaged switch, so it floods the CDP multicast to all ports and the routers hear each other.
Traps
- Leaving CDP enabled on the internet-facing interface.
How did you do?Book 3.2 Switched EthernetOwn page
Working17
How does DHCP relay work, and what does the giaddr field do?
Say this first
A DISCOVER is a broadcast, so it stops at the router. With
ip helper-addresson the interface that faces the clients, the router picks it up, writes that interface's address intogiaddr, and unicasts it to the server. The server usesgiaddrto choose the scope for that subnet and sends its reply togiaddr. The relay then delivers it to the client on port 68.Go deeper
Step by step
- PC1 in VLAN 20 broadcasts a DISCOVER. The gateway SVI is
10.20.0.1/24withip helper-address 10.0.12.1. - The relay sets
giaddrto 10.20.0.1, the primary address of the interface the request came in on. It adds 1 to thehopsfield and unicasts the packet to 10.0.12.1 on UDP 67. - The server finds the pool whose network contains
giaddr. No matching pool means no offer. - The server unicasts the OFFER to
giaddron UDP 67. A relay listens on 67. - The relay forwards the OFFER to the client on UDP 68, as broadcast or unicast per the broadcast flag.
- REQUEST and ACK take the same path.
Configuration
Cisco IOS interface Vlan20 ip address 10.20.0.1 255.255.255.0 ip helper-address 10.0.12.1 ip helper-address 10.0.12.2With two helpers the relay sends a copy to each server. That is how you feed a failover pair.
NX-OS feature dhcp interface Vlan20 ip dhcp relay address 10.0.12.1What breaks it
- The server has no route back to the client subnet. It must reach
giaddr. - The helper is on the wrong interface. It belongs on the client-facing interface.
- No scope on the server for the
giaddrsubnet, or the scope is full. - A firewall between relay and server blocks UDP 67.
- Renewals at T1 are unicast from the client straight to the server address in option 54, not through the relay. The client subnet needs a routed, permitted path to the server as well.
They will ask next
Why is giaddr the receiving interface address and not the one facing the server?
giaddrtells the server which subnet the client lives on. The address of the interface toward the server would only identify a transit link, and the server would pick the wrong scope or none.The VLAN has a primary and a secondary subnet. Which one do clients get?
The relay uses the primary address as
giaddr, so the server answers from the primary subnet. To serve both, the server must treat them as one shared network: a superscope on Windows, ashared-networkblock in ISC DHCP.What does the hops field do?
Each relay adds 1. Relays drop the packet when it exceeds a limit, which stops relay loops when two relays point at each other.
Traps
- Putting the helper address on the uplink toward the server instead of on the client-facing interface.
- Forgetting the return route. The DISCOVER arrives, the server offers, and the OFFER is routed into nothing.
How did you do?Book 3.3 Internet (IP)Own page- PC1 in VLAN 20 broadcasts a DISCOVER. The gateway SVI is
Does ip helper-address forward only DHCP?
Say this first
No. By default Cisco IOS forwards eight UDP broadcast services to every helper address: Time (37), TACACS (49), DNS (53), BOOTP/DHCP server (67) and client (68), TFTP (69), NetBIOS name service (137) and NetBIOS datagram service (138). I trim the list with
no ip forward-protocol udp <port>and add ports withip forward-protocol udp <port>.Go deeper
Why it matters
Every Windows host broadcasting NetBIOS on that VLAN gets relayed to the DHCP servers. It is noise at best. On a clean build I remove what I do not need.
Cisco IOS no ip forward-protocol udp 37 no ip forward-protocol udp 49 no ip forward-protocol udp 137 no ip forward-protocol udp 138Adding a port
Wake-on-LAN magic packets are often sent to UDP 9. To relay them, add the port and point a helper at the directed broadcast of the target subnet:
Cisco IOS ip forward-protocol udp 9 ! interface Vlan20 ip helper-address 10.30.0.255 ! interface Vlan30 ip address 10.30.0.1 255.255.255.0 ip directed-broadcast 110ip directed-broadcast 110lets the router turn the packet into a layer 2 broadcast on VLAN 30, only for traffic that access list 110 permits (for example the WoL server). Directed broadcasts are off by default since IOS 12.0.They will ask next
Why are directed broadcasts disabled by default?
Smurf attacks. An attacker pings a subnet's broadcast address with the victim's address as the source, and every host on that subnet replies to the victim. Turning the router into an amplifier is not something you want by default.
Does the helper forward unicast DHCP traffic too?
No. It catches UDP broadcasts arriving on that interface for the forwarded ports. Unicast renewals already go straight to the server by normal routing.
Traps
- Saying the helper is DHCP-only. Interviewers like the list of eight.
- Enabling
ip directed-broadcastwithout an access list on the target interface.
How did you do?Book 3.3 Internet (IP)Own pageWhat happens as a DHCP lease runs out? Explain T1, T2 and DHCPNAK.
Say this first
At T1, half the lease by default, the client unicasts a REQUEST to the server that gave it the lease. If that fails, at T2 (87.5 percent of the lease) it broadcasts a REQUEST to any server: that is rebinding. If the lease expires with no answer, the client must stop using the address and start again with DISCOVER. A server sends DHCPNAK when the client asks for an address that is wrong for its subnet, for example a laptop that moved to another VLAN.
Go deeper
Client states
State When What it sends BOUND after the ACK nothing RENEWING at T1 (option 58) unicast REQUEST to the option 54 server, ciaddrfilled inREBINDING at T2 (option 59) broadcast REQUEST to any server INIT lease expired or NAK DISCOVER, from scratch INIT-REBOOT after a reboot with a remembered address broadcast REQUEST with option 50 NAK and silence
After a reboot the client asks for its old address. A server that knows the subnet is wrong answers with a NAK, and the client restarts at DISCOVER. A server with no record of the client should stay silent. ISC dhcpd only sends NAKs for a network when it is marked
authoritative.Release
ipconfig /releaseordhclient -rsends DHCPRELEASE, which returns the address early.Choosing lease times
- Guest Wi-Fi and busy shared spaces: short leases (1 to 8 hours) so the pool recycles.
- Wired desktops: long leases. The Windows Server default is 8 days, the IOS default is 1 day.
- A long lease also lets existing clients ride out a DHCP server outage longer.
They will ask next
With a 24 hour lease, when does the client first try to renew?
At 12 hours (T1). Rebinding starts at 21 hours (T2 is 87.5 percent), and the address is lost at 24 hours if nobody answers.
The DHCP server died an hour ago. Who notices first?
New devices and devices coming back from sleep with an expired lease. Existing clients keep working until their lease runs out, so a dead DHCP server is often discovered hours later.
Why must the client subnet be able to reach the server directly?
The renewal at T1 is a unicast to the server address, not a broadcast through the relay. If an ACL or firewall blocks UDP 67 from the client subnet, clients fall back to rebinding at T2 and the problem stays hidden until something else changes.
Traps
- Saying the renewal is a broadcast. Only rebinding at T2 is.
How did you do?Book 3.3 Internet (IP)Own pageHow does DHCP avoid handing out an address that is already in use?
Say this first
Two checks. The server can ping an address before offering it: Cisco IOS sends 2 pings with a 500 ms timeout by default, and if anything replies it records a conflict and skips that address. Then the client probes the address with ARP before using it and sends DHCPDECLINE if another host answers. Excluding the ranges used by static devices prevents most conflicts in the first place.
Go deeper
On a Cisco IOS server
Cisco IOS ip dhcp excluded-address 10.20.0.1 10.20.0.10 ip dhcp ping packets 2 ip dhcp ping timeout 500 ip dhcp database bootflash:dhcp-bindingsThe ping values shown are the defaults.
show ip dhcp conflictlists conflicted addresses and how they were found (ping or gratuitous ARP). They stay out of the pool until you runclear ip dhcp conflict *.Without
ip dhcp database, IOS forgets its bindings on reload and may offer an address a client still holds. Cisco's advice is to either configure the database agent or turn off conflict logging withno ip dhcp conflict logging.On the client
RFC 5227 ARP probes use sender IP 0.0.0.0, so they do not poison anyone's ARP cache. If a reply comes back, the client sends DECLINE and the server marks the address as bad.
Usual causes of conflicts
- Printers or servers configured statically inside the pool range.
- A rogue DHCP server handing out the same subnet.
- The server lost its bindings (reload without a database).
They will ask next
Why might the ping check miss a host that is really there?
Host firewalls often drop ICMP echo; Windows Firewall blocks inbound echo requests by default. The client's ARP probe still catches it, because a host cannot ignore ARP and keep working on the LAN.
How do you stop a rogue DHCP server?
DHCP snooping on the access switches: trust only the uplinks toward real servers, and server messages arriving on any other port are dropped.
Traps
- Forgetting that excluded addresses are your job. The server does not know about static devices.
How did you do?Book 3.3 Internet (IP)Own pageWhat is the difference between a recursive and an iterative DNS query?
Say this first
A recursive query asks for the final answer or an error, and the server does all the work. Stubs on laptops send recursive queries with the RD (recursion desired) bit set. An iterative query accepts a referral, "ask that server next". Resolvers send iterative queries to root, TLD and authoritative servers, which answer only from their own data. Authoritative servers should not offer recursion to the internet.
Go deeper
The flags
Flag Set by Meaning RD client recursion desired RA server recursion available on this server AA server authoritative answer A typical resolver reply shows
flags: qr rd ra. A query sent withdig +norecursestraight to an authoritative server returnsflags: qr aa.Keep the roles apart
- Recursive resolvers serve your own clients and cache.
- Authoritative servers publish your zones to the world and should refuse recursion. In BIND that is
recursion no;on the authoritative instance, orallow-recursionlimited to internal clients.
Why it matters
An open resolver (recursion for anyone) gets used for DNS amplification: small spoofed queries, large answers aimed at the victim. It also gives attackers a cache to try to poison. Resolver defences against poisoning include source port randomisation and DNSSEC validation.
They will ask next
How do you query an authoritative server directly?
dig @ns1.example.com www.example.com +norecurse. Check thataais in the flags. If it is missing, that server is not authoritative for the zone, which points at a lame delegation.Why is an open resolver dangerous for you, not only for the victim?
Your bandwidth and your address become the attack source. Upstream providers will rate-limit or block you, and your address ends up on abuse lists.
Traps
- Saying stubs send iterative queries.
How did you do?Book 9.3 Infrastructure ApplicationsOwn pageWhy can't you put a CNAME at the root of a zone, and how do DNS providers work around it?
Say this first
A CNAME says the name is only an alias, so no other record may exist at the same name. The zone apex (example.com itself) must carry SOA and NS records, so a CNAME there is illegal. Providers work around it with ALIAS, ANAME or CNAME-flattening records: the provider resolves the target itself and serves the result as ordinary A and AAAA records at the apex. AWS Route 53 does the same with alias records.
Go deeper
The rule
RFC 1034: if a CNAME exists at a name, no other data may exist there. Only DNSSEC records are allowed alongside it. That rules out a CNAME at the apex and next to MX, TXT or any other record.
Why people want it
Cloud load balancers and CDNs give you a hostname, not a fixed address, because their addresses change.
wwwcan be a CNAME to it. The bareexample.comcannot.The workarounds
- Flattening, ALIAS, ANAME: the provider looks up the target and answers with A and AAAA records. Fine for most cases. The provider resolves the target from its own location, so geo-based answers reflect the provider, not the user, unless the platform handles that.
- Route 53 alias records: point the apex at AWS resources directly.
- HTTPS record in alias mode (RFC 9460): designed partly for this, but it only helps clients that query HTTPS records.
- Redirect: serve the apex from a fixed address that redirects to
www.
They will ask next
Can a CNAME point to another CNAME?
Yes, resolvers follow chains. Every hop is another lookup and another TTL to manage, so keep chains short.
What happens if someone adds an MX record at a name that already has a CNAME?
A strict server refuses to load the zone. BIND reports "CNAME and other data". Some web consoles refuse the change instead.
Traps
- Saying a CNAME at the apex works because the provider's console allowed it. The console is flattening it behind the scenes.
How did you do?Book 9.3 Infrastructure ApplicationsOwn pageHow do DNS TTLs and negative caching work, and how do you use them when you change a record?
Say this first
Every record has a TTL in seconds. A resolver that caches it counts the TTL down and serves the cached copy until it reaches zero, then asks again. "No such name" (NXDOMAIN) and "no record of that type" (NODATA) answers are cached too, for the smaller of the SOA record's own TTL and the SOA minimum field (RFC 2308). Before a planned change I lower the TTL at least one old TTL ahead, make the change, then raise it again.
Go deeper
Positive caching
Each resolver counts down on its own. Users behind different resolvers can see different answers for up to one full TTL after a change, and you cannot flush other people's resolvers.
Negative caching
A negative answer carries the zone's SOA in the authority section. With
SOA ... 2026111001 7200 3600 1209600 3600and an SOA TTL of 3600, a "does not exist" answer is cached for an hour. The classic trap: someone tests a name before it is created, the resolver caches NXDOMAIN, and the new record stays invisible to them for up to an hour.Resolvers also cap TTLs. BIND by default keeps positive answers at most 1 week and negative answers at most 3 hours.
Migration recipe
When Action Two days before Lower the TTL from 86400 to 300. Wait at least 86400 seconds Change window Change the address. Old answers drain within 5 minutes Day after Raise the TTL again Keep the old server answering, or proxying to the new one, until the old TTL has passed.
Flushing caches you do control
Where Command BIND rndc flushname www.example.comUnbound unbound-control flush www.example.comWindows DNS server Clear-DnsServerCacheWindows client ipconfig /flushdnsLinux systemd-resolved resolvectl flush-cachesThey will ask next
Why not put every record on a 60 second TTL?
More queries, more cache misses that add round trips for users, and less resilience: if your authoritative servers go down, records vanish from caches within a minute. Short TTLs are for planned changes and records used for failover.
You lowered the TTL an hour ago. Will the change be fast now?
No. Resolvers that cached the record under the old 86400 TTL keep it for up to a day. The short TTL only applies to copies fetched after you lowered it.
Some clients hit the old address long after every TTL expired. Why?
Applications cache too. Some runtimes and connection pools resolve once at startup and keep long-lived connections open. They need a restart or a connection drain, not DNS work.
Traps
- Lowering the TTL at the same moment as the change.
- Forgetting negative caching when a brand new name "does not exist" for some users.
How did you do?Book 9.3 Infrastructure ApplicationsOwn pageWhat is in an SOA record, and how do secondary DNS servers stay in sync?
Say this first
The SOA names the primary server (MNAME) and the admin mailbox (RNAME), then five numbers: serial, refresh, retry, expire and minimum. Secondaries check the primary's serial every refresh interval, or at once when the primary sends a NOTIFY. If the serial went up they pull the zone with IXFR (just the changes) or AXFR (the whole zone) over TCP 53. If they cannot reach the primary for the expire time, they stop answering for the zone. The minimum field is now the negative caching TTL.
Go deeper
An SOA, field by field
Output example.com. 3600 IN SOA ns1.example.com. hostmaster.example.com. ( 2026111001 ; serial, YYYYMMDDnn by convention 7200 ; refresh, 2 hours 3600 ; retry, 1 hour 1209600 ; expire, 14 days 3600 ) ; minimum, the negative caching TTLhostmaster.example.com.means the mailbox hostmaster@example.com: the first dot stands for the @.Rules
- The serial must go up on every change. Lower it by mistake and secondaries ignore the change. Serial arithmetic (RFC 1982) lets you move forward past a mistake in steps.
- NOTIFY (RFC 1996) makes updates near instant. Refresh is the safety net.
- Restrict transfers to your secondaries by address and sign them with TSIG keys. An open AXFR hands anyone your whole zone, which is free reconnaissance.
Hidden primary
A common design: the primary is not listed in the NS records and only feeds the public secondaries. It can live behind a firewall and nobody queries it directly.
They will ask next
One secondary still serves old data after a change. What do you check?
Compare serials:
dig @ns1.example.com example.com SOA +shortand the same against each secondary. Then check that the serial was raised, that the secondary can reach the primary on TCP 53, that it is in the transfer ACL with the right TSIG key, and that NOTIFY is sent to it.What happens when the expire timer runs out?
The secondary stops answering for the zone and returns SERVFAIL rather than serve stale data. A primary dead for longer than expire takes every secondary down with it.
Why do zone transfers use TCP?
A zone is far larger than one UDP message and has to arrive complete and in order.
Traps
- Editing a zone file by hand and forgetting to raise the serial.
How did you do?Book 9.3 Infrastructure ApplicationsOwn pageHow do you troubleshoot a DNS problem?
Say this first
First I separate DNS from the network: does the name fail while the IP address works? Then I query with dig and read the status. NXDOMAIN means the name does not exist where I asked. SERVFAIL means the resolver could not get a valid answer, often DNSSEC or a broken delegation. REFUSED means the server will not answer me. A timeout means nothing came back. Then I narrow it down: another resolver, the authoritative server directly, and
dig +traceto walk the delegation myself.Go deeper
The toolkit
Shell dig www.example.com # what my configured resolver says dig @10.0.0.53 www.example.com # a specific resolver dig @ns1.example.com www.example.com +norecurse # the source of truth, look for aa dig +trace www.example.com # walk from the root myself dig @ns1.example.com example.com SOA +short # compare serials on every NS dig +cd www.example.com # skip DNSSEC checks: works now means DNSSEC is broken resolvectl status # which resolver Linux is really usingReading the status
Status Meaning Usual cause NOERROR, answers fine if wrong, a stale cache or split DNS NOERROR, no answers NODATA, the name exists without that type AAAA missing, for example NXDOMAIN name does not exist typo, missing record, wrong search domain, negative cache SERVFAIL resolver failed DNSSEC failure, lame delegation, unreachable authoritative servers REFUSED policy resolver not allowing recursion for you timeout no reply wrong resolver address, UDP or TCP 53 blocked Classic causes
Wrong resolver handed out by DHCP, VPN split DNS rules, a stale hosts file entry, a forgotten search domain, a secondary out of sync, expired DNSSEC signatures, TCP 53 blocked.
They will ask next
nslookup returns the right address but the application still fails. Why?
On Windows, nslookup talks to the DNS server directly and ignores the hosts file, the client cache and VPN name resolution policies. Applications use the system resolver. Test the way the app does with
Resolve-DnsNameon Windows orgetent hostson Linux.What is a lame delegation?
The parent zone lists a name server that is not authoritative for the child: it refuses, or answers without the
aaflag. Resolvers waste time on it and may return SERVFAIL.
Traps
- Trusting nslookup alone on Windows.
- Looking only for an answer and ignoring the status code.
How did you do?Book 9.3 Infrastructure ApplicationsOwn pageHow does PAT let thousands of hosts share one public IP address?
Say this first
PAT tracks each connection by address and port, not by address alone. R1 rewrites the source address to its global address and, when it has to, the source port too, so every inside connection gets a unique global address and port. Replies come back to that pair and R1 looks up which inside host and port it belongs to. One global address has roughly 64,000 usable ports per protocol, and each entry lives only as long as its timer.
Go deeper
A busy translation table
Output R1# show ip nat translations Pro Inside global Inside local Outside local Outside global tcp 203.0.113.2:51004 192.168.10.10:51004 198.51.100.80:443 198.51.100.80:443 tcp 203.0.113.2:49731 192.168.10.11:49731 198.51.100.80:443 198.51.100.80:443 udp 203.0.113.2:61812 192.168.10.12:61812 198.51.100.53:53 198.51.100.53:53 icmp 203.0.113.2:1 192.168.10.10:1 198.51.100.80:1 198.51.100.80:1 Total number of translations: 4Three hosts, one global address. ICMP echo has no ports, so PAT uses the ICMP query identifier in their place.
Port choice on classic IOS
IOS keeps the original source port when it is free on the global address. If it is taken, it picks the first free port in the same group: below 512, 512 to 1023, or 1024 and up. With a pool and
overload, it moves to the next global address when one runs out of ports.Timers (IOS defaults)
Entry Timeout TCP 86400 s (24 hours) TCP after FIN or RST 60 s UDP 300 s DNS 60 s ICMP 60 s Tuned with
ip nat translation tcp-timeout,udp-timeoutand friends. A long TCP timer means abandoned connections hold ports. A short UDP timer breaks quiet VoIP and VPN flows.They will ask next
How many users can share one public address?
Plan by concurrent connections, not users. If users average around 300 flows each, 64,000 ports is a couple of hundred users. Add addresses to the pool with
overloadbefore you get close.Why do VoIP phones behind PAT sometimes stop receiving calls?
Their mapping expired during a quiet period, so the provider's inbound INVITE matches no entry. Phones send registration or keepalive packets more often than the NAT UDP timeout to keep it alive.
Traps
- Saying PAT always changes the source port. IOS keeps it when it is free.
How did you do?Book 3.3 Internet (IP)Own pageNAT is configured but inside users cannot reach the internet. What do you check?
Say this first
In order: the interfaces are marked
ip nat insideandip nat outsideon the right sides; the NAT access list matches the users' real source addresses; there is a default route out the outside interface; translations appear inshow ip nat translationswhen a user tries; and the ISP routes the global address back to me.show ip nat statisticsand a filtereddebug ip natusually point at the broken piece within minutes.Go deeper
Symptom to cause
Symptom Likely cause No translations created at all interface roles missing or swapped, ACL does not match, traffic not routed out the outside interface Translations created, no replies ISP not routing the pool addresses back, upstream filtering Some users work, others do not ACL covers only part of the range, or a dynamic pool without overloadis fullVPN broke when NAT was added no NAT exemption for VPN traffic Inbound to a server fails ACL written with the private address, wrong static entry, server gateway Read the statistics
Output R1# show ip nat statistics Total active translations: 3 (1 static, 2 dynamic; 2 extended) Outside interfaces: GigabitEthernet0/0/0 Inside interfaces: GigabitEthernet0/0/1, GigabitEthernet0/0/2 Hits: 1520 Misses: 4 Expired translations: 2 Dynamic mappings: -- Inside Source [Id: 1] access-list NAT-USERS interface GigabitEthernet0/0/0 refcount 2The interface lists catch swapped roles. The dynamic mapping shows which ACL and target are in use.
Watch it happen
Filter the debug with a numbered ACL that matches one test host:
Cisco IOS R1(config)# access-list 99 permit 192.168.10.10 R1# debug ip nat 99Lines like
NAT*: s=192.168.10.10->203.0.113.2, d=198.51.100.80prove the translation. Outbound lines with no return lines put the problem upstream.Classic ACL mistakes
- A subnet mask where a wildcard belongs:
permit 192.168.10.0 255.255.255.0matches the wrong addresses. permit any: the router starts translating traffic it should not, such as VPN and its own management traffic.
They will ask next
You fixed the NAT ACL, but some hosts still behave the old way. Why?
Existing translations stay until they expire, and TCP entries last 24 hours by default.
clear ip nat translation *removes the dynamic entries, but it also cuts every session through them, so do it in a window.The pool addresses are not on the outside interface subnet. What extra step is needed?
The ISP must route that block to your outside address. If the pool addresses are inside the outside interface subnet, the router answers ARP for them itself.
Traps
- Running an unfiltered
debug ip naton a busy router.
How did you do?Book 3.3 Internet (IP)Own page- A subnet mask where a wildcard belongs:
Which protocols have trouble with NAT, and why?
Say this first
Protocols that carry addresses or ports inside the payload, and protocols with no ports at all. FTP puts addresses in its PORT and PASV commands. SIP and SDP carry the RTP media address. IPsec AH protects the IP header, so any rewrite breaks it, and ESP has no ports for PAT to use. NAT devices patch some of this with application layer gateways (ALGs), IPsec uses NAT traversal over UDP 4500, and VoIP usually relies on STUN, TURN and ICE or a session border controller.
Go deeper
Protocol Problem Usual fix FTP active client sends PORTwith its private address, server connects back to itFTP ALG, or passive mode FTP passive, server behind NAT the PASVreply carries the server's private addressALG, or tell the server its public address SIP SDP carries the private RTP address and port SBC, STUN, TURN, ICE; ALGs often make it worse IPsec AH integrity check covers the IP addresses cannot be NATed, use ESP IPsec ESP no ports, PAT cannot tell flows apart NAT-T, ESP wrapped in UDP 4500 PPTP GRE with no ports ALG, though PPTP itself is obsolete Inbound peer to peer no mapping exists port forwarding, UPnP or PCP, hole punching ALGs on IOS
IOS NAT inspects and rewrites FTP, SIP and other protocols by default. Voice providers often ask you to turn the SIP ALG off because it mangles messages their SBC already handles:
Cisco IOS no ip nat service sip udp port 5060 no ip nat service sip tcp port 5060Timers
Quiet UDP flows lose their mapping when the NAT UDP timer expires (300 seconds on IOS, often less on consumer routers). Keepalives from the endpoints keep mappings alive.
They will ask next
Calls connect through NAT but audio only flows one way. Where do you look?
The SDP in the SIP messages. If the
c=line carries a private address, the far end sends media to an address it cannot reach. Then check whether an ALG rewrote it wrongly and whether the firewall lets the RTP ports back in.How does IPsec know there is a NAT in the path?
IKE peers exchange NAT detection payloads, hashes of the addresses and ports they think they are using. If the hashes do not match what arrives, a NAT changed something, so the peers move from UDP 500 to UDP 4500 and wrap ESP in UDP.
Traps
- Saying IPsec cannot work through NAT. ESP with NAT-T works; only AH cannot.
How did you do?Book 3.3 Internet (IP)Book 8.5 Example SystemsOwn pageHow do you secure NTP, and how do you configure NTP authentication on IOS?
Say this first
Three layers. Authenticate the servers with symmetric keys, so a device only accepts time from a source that proves it knows the key. Restrict who may sync or query with
ntp access-groupand infrastructure ACLs on UDP 123. And use several sources, so one bad clock gets outvoted. An IOS client needs four pieces: the key,ntp authenticate, the key marked trusted, and the server tied to the key.Go deeper
Client configuration
Cisco IOS ntp authentication-key 1 md5 N7p-Octet-Key ntp authenticate ntp trusted-key 1 ntp server 10.0.0.123 key 1 ntp server 10.0.0.124 key 1 ntp source Loopback0The running config shows the key string encrypted with type 7.
show ntp associations detailshows the wordauthenticatedfor each server that passes.ntp authenticatemeans "only sync to authenticated sources". Any server configured without a working key keeps answering but is never selected.Who may talk to you
Cisco IOS access-list 10 permit 10.0.0.123 access-list 10 permit 10.0.0.124 access-list 20 permit 10.0.0.0 0.255.255.255 ntp access-group peer 10 ntp access-group serve-only 20peersources may sync this device,serve-onlyclients may only ask for time,query-onlyallows control queries only. Once any access group is set, everything not permitted is refused.Junos
Junos set system ntp authentication-key 1 type md5 value "N7p-Octet-Key" set system ntp trusted-key 1 set system ntp server 10.0.0.123 key 1Beyond MD5 keys
Symmetric MD5 keys are old but interoperate everywhere. Network Time Security (NTS, RFC 8915) uses TLS to agree keys and then authenticates every NTP packet. chrony and NTPsec support it; network devices mostly do not yet.
They will ask next
You enabled ntp authenticate and the router lost sync with its upstream servers. Why?
The upstream servers do not use keys, for example public pool servers. With
ntp authenticateon, unauthenticated sources are no longer eligible. Sync that box to keyed internal servers instead.Why was NTP a DDoS problem?
Old ntpd answered the
monlistquery with a list of up to 600 recent clients: a tiny spoofed request produced a huge reply. Current software drops it; still restrict queries to your own networks.Does NTP authentication encrypt the time?
No. It adds a keyed digest that proves where the packet came from and that it was not changed. The time itself is not secret.
Traps
- Defining the key and the server but forgetting
ntp trusted-key. The client never syncs. - Turning on
ntp authenticateon a box whose upstream servers have no keys.
What are the SNMPv3 security levels, and how do you configure SNMPv3 on IOS?
Say this first
Three levels. noAuthNoPriv: a username only, no authentication, no encryption. authNoPriv: messages are authenticated with an HMAC (MD5 or SHA) but sent in clear. authPriv: authenticated and encrypted (DES, 3DES or AES). I use authPriv with SHA and AES. On IOS you create a view, a group that sets the security level and the view, then a user in that group with its authentication and privacy passwords.
Go deeper
Configuration
Cisco IOS ip access-list standard SNMP-MGRS permit 10.0.0.50 ! snmp-server view NMS-VIEW iso included snmp-server group NMS-RO v3 priv read NMS-VIEW access SNMP-MGRS snmp-server user nmsuser NMS-RO v3 auth sha Auth-Pass-2026 priv aes 128 Priv-Pass-2026RFC name IOS group keyword Authentication Encryption noAuthNoPriv noauthno no authNoPriv authyes no authPriv privyes yes The security model is USM (user-based, RFC 3414) and access control is VACM (view-based, RFC 3415).
Things that catch people
snmp-server userlines never appear in the running config. Check withshow snmp user.- User keys are localized to the engine ID. Change
snmp-server engineID localand every user stops working until you re-create it. - The group's level is a minimum. A request at authNoPriv against a
privgroup is refused. - net-snmp rejects passphrases shorter than 8 characters.
- Informs over v3 need the manager's engine ID (
snmp-server engineID remote) and the user defined against it with theremotekeyword.
Test from the NMS
Shell snmpget -v3 -l authPriv -u nmsuser -a SHA -A 'Auth-Pass-2026' -x AES -X 'Priv-Pass-2026' 10.255.0.1 SNMPv2-MIB::sysName.0MD5 and DES are weak. SHA with AES-128 is the common baseline, and newer platforms add SHA-2 options.
They will ask next
Someone changed the engine ID and the NMS lost access. Why?
SNMPv3 derives each user's keys from the password and the engine ID. New engine ID, old keys: every request fails authentication. Re-create the users.
Your config backups do not contain the SNMPv3 users. Is the backup broken?
No, IOS keeps them out of the running config by design. Your build scripts or automation must create them, or a restored device comes back with no SNMPv3 access.
Traps
- Saying authNoPriv encrypts. It only authenticates.
- Misreading the IOS keyword.
privon the group means authPriv.
What is the difference between an SNMP trap and an inform, and what are MIBs and OIDs?
Say this first
A trap is a one-way notification from agent to manager on UDP 162. If it is lost, nobody knows. An inform is the same notification but the manager must acknowledge it, and the agent retries until it does. An OID is the dotted address of one piece of data in a global tree, for example 1.3.6.1.2.1.1.5.0 for sysName. A MIB is a module that defines a set of OIDs with their types and meanings, so the manager knows what the numbers are.
Go deeper
The OID tree
Output 1.3.6.1 iso.org.dod.internet 1.3.6.1.2.1 mib-2, the standard MIBs 1.3.6.1.2.1.1 system: sysDescr .1, sysUpTime .3, sysName .5 1.3.6.1.2.1.2.2.1 ifEntry: ifDescr .2, ifOperStatus .8, ifInOctets .10 1.3.6.1.2.1.31.1.1.1 ifXEntry: ifHCInOctets .6 (64-bit) 1.3.6.1.4.1 enterprises: Cisco is 1.3.6.1.4.1.9Scalars end in
.0, as insysName.0. Table cells end in the row index, usually the ifIndex:ifInOctets.3is interface index 3.snmp-server ifindex persistkeeps ifIndex values stable across reloads.Trap or inform
Trap Inform Acknowledged no yes, with a Response Retries none until acknowledged or retries run out Cost on the device send and forget each inform held in memory until acknowledged Versions v1, v2c, v3 v2c, v3 Cisco IOS snmp-server enable traps snmp linkdown linkup coldstart warmstart snmp-server host 10.0.0.50 version 3 priv nmsuser snmp-server host 10.0.0.51 informs version 2c Oct3t-Trap-2026They will ask next
Why must ifIndex stay the same after a reload?
Monitoring systems key graphs and alerts by ifIndex. If indexes shift after a reload, a year of history for Gi0/0/1 quietly continues on a different interface.
What does snmpwalk actually do?
It sends GetNext (or GetBulk with snmpbulkwalk) from a starting OID, again and again, until the reply leaves that subtree. That is how you dump a whole table without knowing its indexes.
Traps
- Calling informs secure traps. They are acknowledged traps; security comes from v3.
How did you do?Book 9.3 Infrastructure ApplicationsOwn pageCompare NetFlow v5, NetFlow v9, IPFIX and sFlow.
Say this first
NetFlow v5 exports fixed-format records about IPv4 flows only. v9 is template-based: the exporter first sends templates that describe the fields, so it can carry IPv6, MPLS and anything else. IPFIX is the IETF standard built from v9 (its header says version 10), adds variable-length and vendor-defined fields, and uses UDP 4739 by default. sFlow is different in kind: the device keeps no flow cache, it samples 1 in N packets and sends their headers plus interface counters to the collector.
Go deeper
What a flow is
A one-way stream of packets that share key fields. Traditional NetFlow uses seven keys: source and destination address, source and destination port, IP protocol, ToS byte and input interface. The device keeps flows in a cache and exports a record when a flow ends, when it goes idle (inactive timeout, 15 seconds by default) or when it has run for the active timeout (30 minutes by default on IOS). Set the active timeout to about 60 seconds, or long flows appear as spikes.
NetFlow v5 NetFlow v9 IPFIX sFlow Defined by Cisco Cisco, RFC 3954 IETF, RFC 7011 sFlow.org Format fixed 48-byte records templates templates, variable-length fields sampled headers plus counters IPv6, MPLS no yes yes yes, it sees raw headers Flow cache on the device yes yes yes no Usual collector port UDP 2055 by convention UDP 2055 by convention UDP 4739 UDP 6343 With v9 and IPFIX the collector cannot decode data until it has the template, so a collector that restarts shows a gap until the next template refresh.
Flexible NetFlow on IOS-XE
Cisco IOS flow exporter EXP-COLLECTOR destination 10.0.0.70 source Loopback0 transport udp 4739 export-protocol ipfix ! flow monitor MON-V4 exporter EXP-COLLECTOR record netflow ipv4 original-input cache timeout active 60 ! interface GigabitEthernet0/0/0 ip flow monitor MON-V4 inputUses: top talkers, capacity planning, DDoS detection, security investigations, billing.
They will ask next
Should you monitor input, output or both?
Flows are one-way. Monitoring input on every interface sees each packet once. Adding output on the same interfaces counts traffic twice, so only do it when you need egress records and the collector knows how to handle them.
When would you pick sFlow over NetFlow or IPFIX?
On high-speed switches without flow cache hardware, or a multi-vendor switching fabric, where statistical sampling is good enough. When you need every flow, for security or billing, use a flow cache with IPFIX.
Traps
- Saying NetFlow captures packets. It summarises flows and carries no payload.
- Leaving the active timeout at 30 minutes and trusting the graphs.
How did you do?Book 9.3 Infrastructure ApplicationsOwn pageWhat is IP SLA, and how do you use it to fail over a default route?
Say this first
IP SLA is Cisco's built-in probe engine. The router sends synthetic traffic on a schedule (ICMP echo, UDP jitter, TCP connect, HTTP, DNS and more) and records reachability, latency, jitter and loss. Paired with object tracking it drives decisions: a track object follows the probe result, a static route tied to that track is withdrawn when the probe fails, and a floating static route to a backup ISP takes over.
Go deeper
Configuration
Cisco IOS ip sla 1 icmp-echo 198.51.100.200 source-interface GigabitEthernet0/0/0 timeout 2000 threshold 1000 frequency 10 ip sla schedule 1 life forever start-time now ! track 1 ip sla 1 reachability delay down 10 up 30 ! ip route 0.0.0.0 0.0.0.0 203.0.113.1 track 1 ip route 0.0.0.0 0.0.0.0 192.0.2.9 250 ip route 198.51.100.200 255.255.255.255 203.0.113.1- The probe target 198.51.100.200 sits beyond ISP1's first hop. ISP1's router at 203.0.113.1 can answer while its upstream is broken.
timeoutandthresholdare in milliseconds,frequencyin seconds. The defaults are 5000 ms, 5000 ms and 60 seconds.delay down 10 up 30stops a flapping path from flapping the route.- The host route keeps the probe on ISP1. Without it, after failover the probe would follow the backup default, succeed, and bring the primary route back: a loop of flaps.
- The backup default to ISP2 (192.0.2.9) has distance 250, so it only installs when the tracked route is gone.
Other probes
udp-jittermeasures one-way jitter, loss and latency for voice and needsip sla responderon the far Cisco device. With a codec option it also estimates a MOS score.Verify
show ip sla statistics 1,show track 1,show ip route static. On Junos the equivalent is RPM (real-time performance monitoring) probes with ip-monitoring.They will ask next
Why not just ping the ISP's next hop?
The next hop is on a directly connected link. It can answer happily while everything behind it is broken. Probe something further upstream that the ISP agrees will answer.
What does a udp-jitter probe need on the far end?
ip sla responderon a Cisco device. The responder timestamps the probes, so the sender can remove processing time and measure jitter and loss in each direction.
Traps
- Forgetting
ip sla schedule. Without it the probe is defined but never runs. - Probing the ISP next hop on the directly connected link.
How did you do?Book 3.4 RoutingOwn page
Expert7
What is DHCP option 82, and why can clients stop getting addresses right after you enable DHCP snooping?
Say this first
Option 82 (relay agent information) lets a relay or access switch tag a request with where it came from: circuit ID (VLAN and port) and remote ID (the switch). Catalyst switches insert it by default when DHCP snooping is on, but they are not relays, so
giaddrstays 0.0.0.0. A Cisco IOS relay or DHCP server that receives option 82 with a zerogiaddron an untrusted interface drops the packet. The fix is one line:ip dhcp relay information trustedon the router interface, orno ip dhcp snooping information optionon the switch.Go deeper
What option 82 carries
- Sub-option 1, circuit ID: usually the VLAN, module and port of the client.
- Sub-option 2, remote ID: usually the switch MAC address.
The server can use it for policy (fixed address per port, subscriber identity at service providers) and logs it. The relay strips it from the reply before the client sees it.
Why the router drops it
RFC 3046 tells a relay to discard a packet that arrives on an untrusted circuit with option 82 already present and
giaddrzero, because a client could be forging it. A snooping switch creates exactly that packet.debug ip dhcp server packeton the router shows it complaining that the relay information option is present whilegiaddris zero.Fixes
On the router, trust the option on the interface facing the switch, or everywhere:
Cisco IOS interface GigabitEthernet0/0/1.40 ip dhcp relay information trusted ! ip dhcp relay information trust-allOr stop the switch inserting it:
Cisco IOS no ip dhcp snooping information optionIf the server really uses option 82 (service provider style), keep the insertion and trust it on the relay. Otherwise turn insertion off at the access layer.
They will ask next
The uplink is already trusted for DHCP snooping. Why does that not fix it?
Snooping trust on the switch uplink lets server messages (OFFER, ACK) in through that port. It says nothing about whether the router accepts the option 82 the switch added. Different device, different trust setting.
What does a snooping switch do with option 82 arriving on an untrusted access port?
It drops the packet by default, since an access port should never carry option 82. On an aggregation switch that receives already-tagged requests from edge switches, you allow it with
ip dhcp snooping information option allow-untrusted.
Traps
- Assuming snooping trust on the uplink covers this.
- Turning DHCP snooping off to make DHCP work again. That removes the protection when one line fixes it.
How did you do?Book 3.3 Internet (IP)Own pageHow do you make DHCP highly available?
Say this first
Two servers that can each answer for every scope, and every relay pointing at both. The choices are split scopes (each server owns part of the range, often 80/20), or a failover pair that shares lease state: Windows Server DHCP failover in load-balance or hot-standby mode, or ISC Kea with its HA hook. Whichever I choose, every SVI gets a helper address for each server.
Go deeper
Split scope
Both servers hold the same subnet with non-overlapping ranges. No sync, simple to run. Each part must cover demand on its own if the other server is down, and reservations must exist on both.
Failover with shared state
- Windows Server (2012 and later): two partners replicate leases. Load-balance mode shares the pool (50/50 by default). Hot-standby keeps a reserve on the standby (5 percent by default). The maximum client lead time (MCLT, 1 hour by default) bounds how far one partner can extend a lease beyond what the other knows.
- ISC Kea: the high availability hook supports load-balancing, hot-standby and passive-backup modes, with the partners sending lease updates to each other.
- ISC dhcpd: has a failover protocol between two peers, but ISC has ended maintenance of dhcpd and points users to Kea.
Branches
A branch that depends on central DHCP over the WAN loses new leases when the WAN fails. Existing clients keep their addresses until expiry. A long lease or a small local IOS DHCP server covers that. The IOS server has no failover of its own, so give it
ip dhcp databaseso a reload keeps bindings.They will ask next
The WAN to the data centre DHCP servers is down for six hours. Who breaks?
New devices, and every client whose lease expires during those six hours. Everyone else keeps working. With 1-day leases a fair share of clients will expire in that window; with 8-day leases almost nobody does.
Is adding a second ip helper-address enough?
Only if the second server actually has the scopes and either shares state or holds its own split of the range. A helper pointing at a server with no matching scope just gets ignored.
Traps
- Overlapping split-scope ranges. Two servers can then lease the same address to two clients.
- Forgetting reservations on the second server. Printers and phones with reservations get a random address during a failover.
How did you do?Book 3.3 Internet (IP)Own pageDoes DNS use UDP or TCP, and what happens with large responses?
Say this first
Both, on port 53. Most queries use UDP. Classic DNS capped UDP answers at 512 bytes. EDNS(0) lets the client advertise a bigger buffer, and 1232 bytes is today's recommended size because it avoids IP fragmentation. If an answer does not fit, the server sets the TC (truncated) bit and the client retries over TCP. Zone transfers always use TCP. A firewall that blocks TCP 53 or drops fragments breaks only the large answers, which makes it a confusing fault.
Go deeper
The pieces
- EDNS(0) (RFC 6891): an OPT pseudo-record in the additional section carries the client's UDP buffer size and the DO bit that asks for DNSSEC records.
- 1232 bytes: the IPv6 minimum MTU of 1280, minus 40 bytes of IPv6 header and 8 of UDP. It was the value agreed for DNS Flag Day 2020.
- TCP: RFC 7766 makes TCP support mandatory for DNS software. It is not just for transfers.
What produces big answers
DNSSEC signatures, long TXT records (SPF, verification tokens), names with many A or AAAA records.
The symptom
Most names resolve, a few fail with SERVFAIL or time out. When an answer is too big, dig prints this line before it retries over TCP:
Output ;; Truncated, retrying in TCP mode.If
dig +tcpto the same server then times out, TCP 53 is blocked. Older firewall DNS inspection profiles also capped messages at 512 bytes and dropped EDNS answers.Encrypted DNS
Protocol Transport DNS over TLS (DoT) TCP 853 DNS over HTTPS (DoH) TCP 443, or HTTP/3 over UDP 443 DNS over QUIC (DoQ) UDP 853 DoH matters to network teams because it looks like ordinary web traffic and can bypass the internal resolvers that enforce policy.
They will ask next
Why is 1232 the magic number?
It is the largest DNS payload that fits in a 1280-byte IPv6 packet, the minimum every IPv6 link must carry, so the answer never needs fragmenting.
How do you prove TCP 53 is blocked between a resolver and a server?
Run
dig @server nameanddig +tcp @server namefrom the resolver. UDP answers and TCP times out: something in the path drops TCP 53.
Traps
- Saying DNS uses UDP and TCP is only for zone transfers. TCP carries any answer too big for UDP.
What does DNSSEC protect against, and what does it not do?
Say this first
DNSSEC lets a validating resolver prove an answer came from the zone owner unchanged. Each record set is signed (RRSIG), the zone publishes its public keys (DNSKEY), and the parent vouches for the child's key with a DS record, up to the root's trust anchor. It stops cache poisoning and spoofed answers. It does not encrypt anything, does not hide which names you look up, and does not protect the hop between a non-validating stub and its resolver.
Go deeper
The chain of trust
- The resolver trusts the root key (the trust anchor).
- The root zone signs a DS record for
com., a hash of the .com key. - The .com zone signs a DS record for
example.com.. - example.com signs its records with keys that match that DS.
Zones usually have a key-signing key (KSK, the one the parent's DS points at) and a zone-signing key (ZSK, which signs the records). NSEC or NSEC3 records prove that a name does not exist.
What a validating resolver does
Valid answers get the AD (authenticated data) bit. Answers that fail validation become SERVFAIL. The client gets no answer at all rather than a forged one.
How DNSSEC outages happen
- Signatures expire because the signing job stopped.
- A key rollover without updating the DS at the registrar.
- Moving to a new DNS provider while the old DS stays at the parent.
dig +dnssecshows the RRSIGs,dig +cdturns checking off for a comparison, anddelvexplains validation step by step.They will ask next
A domain returns SERVFAIL from your resolver but works with dig +cd. What is going on?
Validation fails: most likely expired signatures or a DS that no longer matches the zone's key. The domain owner has to fix it. A resolver operator can add a temporary negative trust anchor (RFC 7646) for that domain in the meantime.
What is the difference between NSEC and NSEC3?
NSEC proves a name does not exist by naming the next existing name, which lets anyone walk the whole zone. NSEC3 uses hashed names to make that walk much harder.
If DNSSEC does not encrypt, what does?
DNS over TLS, DNS over HTTPS or DNS over QUIC between the client and its resolver. They protect privacy on that hop; DNSSEC protects the data's integrity from end to end.
Traps
- Saying DNSSEC encrypts DNS.
What is the NAT order of operations on a Cisco IOS router, and why does it matter?
Say this first
It depends on the direction. Inside to outside, IOS routes first and then translates. Outside to inside, it translates first and then routes. In both directions the inbound ACL runs before NAT, and crypto maps and outbound ACLs run after it. So an ACL inbound on the outside interface must match the global address, the router needs a route to the inside local address for incoming traffic, and VPN traffic must be exempted from NAT or it stops matching the crypto ACL.
Go deeper
The sequence, trimmed to what matters
Step Inside to outside Outside to inside 1 IPsec decryption, if any IPsec decryption, if any 2 Input ACL Input ACL 3 Policy routing NAT, global to local 4 Routing Policy routing 5 NAT, local to global Routing 6 Crypto map check Crypto map check 7 Output ACL Output ACL What follows from it
- Inbound ACL on the outside interface sees pre-NAT addresses. To let the internet reach SRV1
(192.168.20.10, published as 203.0.113.5), permit
host 203.0.113.5, not the private address. - Outbound ACL on the outside interface sees post-NAT addresses, so the sources are inside global.
- Inbound ACL on an inside interface sees inside local addresses.
- Outside to inside, routing uses the translated destination. R1 needs a route to 192.168.20.10.
- Crypto runs after NAT. Traffic to a VPN peer's private network gets PATed first, then no longer matches the private-to-private crypto ACL. Exempt it in the NAT rule:
Cisco IOS ip access-list extended NAT-USERS deny ip 192.168.10.0 0.0.0.255 10.200.0.0 0.0.255.255 permit ip 192.168.10.0 0.0.0.255 any ! ip nat inside source list NAT-USERS interface GigabitEthernet0/0/0 overload- Translation happens only when a packet crosses between an
ip nat insideand anip nat outsideinterface. Inside to inside is never translated.
Other platforms do it differently
- Cisco ASA (8.3 and later) matches ACLs against the real, untranslated address: the opposite habit.
- Linux netfilter does DNAT in PREROUTING, before the routing decision, and SNAT in POSTROUTING, after it. Filter rules in FORWARD see the private destination of a port forward.
They will ask next
Connections to a published server fail and the permit line in the outside ACL has zero matches. Why?
The line permits the server's private address. The inbound ACL runs before translation, when the destination is still the public address, so the line never matches and the implicit deny drops the traffic. Rewrite it with the global address.
Does policy-based routing see the translated address?
Inside to outside, no: PBR runs before NAT and sees the inside local source. Outside to inside, yes: NAT has already rewritten the destination to the inside local address.
Traps
- Saying NAT happens before routing in both directions.
- Writing the outside interface ACL with private addresses.
How did you do?Book 3.3 Internet (IP)Own page- Inbound ACL on the outside interface sees pre-NAT addresses. To let the internet reach SRV1
(192.168.20.10, published as 203.0.113.5), permit
Inside users cannot reach an internal server by its public address, but internet users can. Why, and how do you fix it?
Say this first
That is NAT hairpinning, also called NAT loopback or reflection. The user's packet to 203.0.113.5 enters R1 on an inside interface, and IOS only translates a global destination back to the local one for packets that arrive on an outside interface, so nothing rewrites it. Even on devices that do rewrite it, a server on the same subnet as the user replies straight to the user from its private address, and the user drops that reply. The clean fix is split DNS. If you must hairpin, the device has to translate both destination and source.
Go deeper
Why it fails
- PC1 (192.168.10.10) resolves app.example.com to 203.0.113.5 and sends a SYN to it.
- The SYN enters R1 on
Gi0/0/1, an inside interface. Outside-to-inside translation only applies to packets arriving on an outside interface, so the destination stays 203.0.113.5 and the packet never reaches SRV1 at 192.168.20.10.
The same-subnet trap
Suppose a device does rewrite the destination (Linux DNAT applies on any interface). If the client sits on the server's own subnet, the server replies directly from 192.168.20.10. The client sent its SYN to 203.0.113.5, so it discards the reply. The device has to rewrite the source as well, so the reply comes back through it.
Fixes, best first
- Split DNS: the internal view of app.example.com returns 192.168.20.10. No hairpin at all.
- A DMZ on its own interface: clients and servers on different interfaces, so replies always return through the edge device.
- Hairpin NAT on the edge device. On Linux:
Shell iptables -t nat -A PREROUTING -d 203.0.113.5 -p tcp --dport 443 -j DNAT --to-destination 192.168.20.10 iptables -t nat -A POSTROUTING -s 192.168.20.0/24 -d 192.168.20.10 -p tcp --dport 443 -j MASQUERADEThe first rule has no
-i, so it applies to inside traffic too. The second source-NATs clients on the server's own subnet so their replies return through the router.On classic IOS the NAT Virtual Interface (
ip nat enableon interfaces,ip nat source ...rules without inside or outside) supports hairpinning, but NVI is not supported on IOS-XE.They will ask next
Why is split DNS better than hairpin NAT?
Traffic stays local instead of going through the edge device, the server logs the real client address, and nothing depends on a NAT feature some platforms lack.
After hairpin NAT is enabled, the server logs show every internal user as the router. Why?
The source translation that makes hairpinning work hides the real client address. That is expected, and one more reason to prefer split DNS.
Traps
- Testing a new port forward from inside the LAN and declaring it broken.
How does NTP decide which server to trust, and why should a device have at least four sources?
Say this first
The client keeps the best recent samples from each server, works out an offset and an error range for each, and looks for the largest group of servers whose ranges overlap. Servers outside that group are falsetickers and are thrown out. The survivors are clustered and combined, and one becomes the system peer. With one source you cannot detect a bad clock, with two you cannot tell which one is wrong, three let a majority outvote one liar, and four still leave three to vote when one fails. The NTP best current practice, RFC 8633, recommends at least four.
Go deeper
The pipeline
- Clock filter: per server, keep the last 8 samples and use the one with the lowest delay. Low delay means the least room for error.
- Selection: an intersection algorithm finds the range most servers agree on. Servers outside it are falsetickers.
- Cluster: prune the survivors that sit furthest from the rest.
- Combine: a weighted average of the survivors. One of them is the system peer.
- Discipline: steer the local clock. ntpd slews offsets below 128 ms and steps larger ones.
Reading it on IOS
Output R1# show ntp associations address ref clock st when poll reach delay offset disp *~10.0.0.123 .GPS. 1 38 64 377 0.412 0.087 0.952 +~10.0.0.124 .GPS. 1 51 64 377 0.530 0.142 1.104 -~192.0.2.123 .PPS. 1 17 64 377 18.230 2.904 3.517 x~198.51.100.123 .GPS. 1 44 64 377 21.904 812.335 2.871 * sys.peer, # selected, + candidate, - outlyer, x falseticker, ~ configured198.51.100.123 claims stratum 1 yet sits 812 ms away from the other three, so it is marked as a falseticker and ignored. Delay, offset and dispersion are in milliseconds.
reachis an 8-bit register shown in octal: 377 means the last eight polls were all answered.They will ask next
What does reach 376 tell you?
376 is 11111110 in binary. The newest result shifts in on the right, so the most recent poll got no answer while the seven before it did. A reach of 0 means nothing has come back.
What do ntpd and chrony do with a huge offset at boot?
ntpd refuses to correct an offset over 1000 seconds (the panic threshold) and exits, unless it was started with
-gto allow one large first correction. chrony is told when to step with amakestepline, for examplemakestep 1.0 3: step if the offset is over 1 second during the first three updates.
Traps
- Configuring exactly two NTP servers for redundancy. When they disagree, there is no majority.
How did you do?Book 9.3 Infrastructure ApplicationsOwn page