These services act on the traffic that flows through the lab: a translation appears when a host's ping crosses the NAT router, and a lease when a PC asks for an address.
NAT and PAT
Router
Under interface Gi0/1
ip nat inside
The LAN side.
Under interface Gi0/0
ip nat outside
The Internet side.
In global configuration
access-list 1 permit 10.0.0.0 0.0.255.255
Which inside addresses may be translated.
ip nat inside source list 1 interface Gi0/0 overload
PAT: every inside host shares the outside interface's address.
ip nat pool PUBLIC 203.0.113.10 203.0.113.14 netmask 255.255.255.248
A pool of outside addresses (prefix-length 29 works too).
ip nat inside source list 1 pool PUBLIC overload
PAT over the pool (without overload: one address per host).
ip nat inside source static 10.0.10.20 203.0.113.20
Static NAT: a server always has this outside address.
ip nat inside source static tcp 10.0.10.21 80 203.0.113.21 8080
Port forwarding: outside TCP 8080 reaches the server's port 80.
In privileged EXEC
show ip nat translations
The translations in use, with inside and outside, local and global addresses.
show ip nat statistics
Hits, misses, and the inside and outside interfaces.
clear ip nat translation *
Removes the dynamic translations.
DHCP server, relay and client
Router
In global configuration
ip dhcp excluded-address 10.0.10.1 10.0.10.10
Addresses the server never leases.
Under ip dhcp pool USERS
network 10.0.10.0 255.255.255.0
The pool's subnet.
default-router 10.0.10.1
The gateway the clients get.
dns-server 8.8.8.8
The DNS server they get.
domain-name ntpath.lab
Their domain name.
In privileged EXEC
show ip dhcp binding
Each lease: address, client and expiry.
show ip dhcp pool
Each pool's range and how much of it is leased.
Under interface Gi0/2
ip helper-address 10.0.12.2
Relays the DHCP broadcasts heard on Gi0/2 to that server as unicast, with this interface's address as giaddr. The server picks the pool that contains giaddr and needs a route back to it.
Under interface Gi0/0
ip address dhcp
The router takes its address from a DHCP server on the link, and a default route to the lease's gateway with distance 254.
In privileged EXEC
show dhcp lease
The router's own leases: address, server, gateway and timers.
A client gets an address with ip dhcp on a PC, ipconfig /renew on Windows, sudo ipconfig set en0 DHCP on macOS or sudo dhclient on Linux. The server must be on the client's subnet: there is no DHCP relay yet (see Limits).
DHCPv6
The router's RAs tell hosts how to configure. M (managed) asks them to get the address from DHCPv6; O (other) only DNS and the domain, keeping SLAAC. A prefix with no-autoconfig isn't used for SLAAC. A relay forwards to the server, which picks the pool of the interface the request arrives on; the pool's prefix must contain the relay's link address, and the server needs a route back to it.
Router
In global configuration
ipv6 dhcp pool BRANCH
A DHCPv6 pool.
Under ipv6 dhcp pool BRANCH
address prefix 2001:db8:1:1::/64
Stateful: the addresses it hands out (lifetime VALID PREFERRED optional).
dns-server 2001:db8:2:2::53
A DNS server.
domain-name ntpath.lab
The domain.
Under interface Gi0/0
ipv6 dhcp server BRANCH
Serves the pool on the interface (rapid-commit optional).
Under interface Gi0/1
ipv6 dhcp relay destination 2001:db8:12::2
Relays the link's requests to a server.
ipv6 nd managed-config-flag
M: hosts get their address from DHCPv6.
ipv6 nd other-config-flag
O: hosts get DNS and the domain from DHCPv6.
ipv6 nd prefix 2001:db8:1:1::/64 no-autoconfig
No SLAAC for that prefix (ipv6 nd prefix default no-autoconfig for all).
In privileged EXEC
show ipv6 dhcp pool
Each pool: prefix, lifetimes, DNS, domain and active clients.
show ipv6 dhcp binding
Each client: link-local address, DUID, interface, IA and address.
show ipv6 dhcp interface
Which interfaces serve or relay.
show ipv6 dhcp
The router's own DUID.
Clients: ipconfig /all on Windows shows the address, the DHCPv6 IAID and DUID and the DNS servers; ip -6 addr and resolvectl status on Linux; ifconfig on macOS.
HSRP and VRRP
Router
Under interface Gi0/1
standby version 2
HSRP version 2 (version 1 is the default).
standby 10 ip 10.0.10.254
The virtual gateway address of group 10.
standby 10 priority 110
Higher wins the active role (100 is the default).
standby 10 preempt
Takes the active role back when it has the higher priority.
standby 10 track 1 decrement 20
Lowers the priority by 20 while track 1 is down, so the other router takes over.
In privileged EXEC
show standby brief
Each group: state (Active, Standby), priority, active and standby routers, virtual IP.
show standby
The same in detail, with the virtual MAC.
VRRP (version 2) does the same job with an open standard: the highest priority is master and every other router is a backup. Unlike HSRP it preempts by default, and a router whose own interface address is the virtual address owns it (priority 255). The virtual MAC is 0000.5e00.01xx, with the group number in hex.
Router
Under interface Gi0/1
vrrp 20 ip 10.0.10.253
The virtual gateway address of VRRP group 20.
vrrp 20 priority 110
Higher wins the master role (100 is the default, 1 to 254).
no vrrp 20 preempt
Turns preemption off (it is on by default).
vrrp 20 track 1 decrement 20
Lowers the priority by 20 while track 1 is down.
In privileged EXEC
show vrrp brief
Each group: priority, master down time, owner, preempt, state (Master, Backup), master address and virtual address.
show vrrp
The same in detail, with the virtual MAC and the timers.
IP SLA and object tracking
An IP SLA operation probes a path every few seconds. A track object follows its result (or an interface's line protocol), and a static route (ip route … track 1) or an HSRP group follows the track. Lab links can carry latency, jitter and loss, so round trips, jitter and voice scores follow the path. A track's state is up only when the return code is OK; its reachability also accepts Over threshold (the target answered, but late).
Router
Under ip sla 1
icmp-echo 8.8.8.8 source-interface Gi0/0
The probe: ping 8.8.8.8 from Gi0/0.
frequency 5
Every 5 seconds.
threshold 100
A reply slower than 100 ms reports Over threshold (5000 ms by default).
timeout 1000
A reply slower than 1000 ms counts as a Timeout.
Under ip sla 10
udp-jitter 10.4.4.4 16384 codec g729a
A train of UDP packets (with a codec: 1000 packets every 20 ms) that measures round trip, jitter each way, loss and a voice score (ICPIF, MOS). Needs a responder.
Without a codec: your own packet count and interval.
Under ip sla 12
udp-echo 10.4.4.4 5000
One UDP echo through a responder.
In global configuration
ip sla responder
On the target: answers udp-jitter and udp-echo (control session on UDP 1967).
ip sla schedule 1 life forever start-time now
Starts it.
track 1 ip sla 1 reachability
Track 1 is up while the probe gets answers (state works too).
track 2 interface Gi0/0 line-protocol
Track 2 follows the interface.
ip route 0.0.0.0 0.0.0.0 10.0.12.2 track 1
The default route stays while track 1 is up; a floating route (a higher distance) takes over when it goes down.
In privileged EXEC
show ip sla statistics
The last result of each probe.
show ip sla configuration
Each probe's settings.
show track
Each track object, its state and what follows it.
show ip sla summary
One line per operation: type, destination, RTT, return code.
show ip sla responder
Whether the responder runs, and who has probed it.
NTP
Router
In global configuration
ntp master 3
This router is a time source, at stratum 3.
ntp server 10.0.12.2
Takes its time from another device.
In privileged EXEC
show ntp associations
The servers and which one is in use.
show ntp status
Whether the clock is synchronised, and its stratum.
Files: flash, SCP and SFTP
Flash holds the IOS image the device runs (and keeps its files through a reload). copy moves the configuration and flash files to and from a server over SCP or SFTP (SSH, TCP 22): it asks for the host, the user and the file name (Enter keeps each value in brackets), then the server's password. No server in the labs runs TFTP, so a TFTP copy times out.
Router
In privileged EXEC
dir flash:
The files in flash, their sizes, and the bytes free (show flash: too).
A switch or router resolves a name with its ip host entries first, then asks each ip name-server while ip domain lookup is on (the default). A name without a dot gets the ip domain name. ping, and the host in a copy URL, take names.
Router
In global configuration
ip name-server 10.1.99.53
The DNS server to ask (up to six).
ip domain name example.com
The domain added to a name without a dot.
ip host SRV1 10.1.99.20
A static name, used before DNS.
no ip domain lookup
Stops asking DNS (a typo is then not taken for a host name).
In privileged EXEC
show hosts
The name servers, the static names (perm) and the names learned from DNS (temp).