IP services: DHCP, DNS, NTP, syslog, SNMP and a little QoS
The supporting cast that makes a network usable — how addresses are handed out and relayed across subnets, why clocks matter more than they look, the eight syslog levels, what SNMP still does, and the parts of quality of service worth knowing.
On this page
Routing gets the attention, but a network where routing works perfectly and DHCP is broken is a network where nobody can do anything. This article covers the services that sit alongside forwarding: the one that hands out addresses, the one that turns names into them, the one that makes every timestamp comparable, the two that tell you what is happening, and the one that decides whose packet gets dropped when the link is full.
The map
Read this first when short on time. Every branch is a section below.
DHCP: how a host gets an address
A host powering on has no address, no gateway and no resolver. DHCP supplies all three in a four-message exchange, remembered as DORA.
sequenceDiagram autonumber participant C as Client participant S as DHCP server C->>S: DISCOVER, broadcast from 0.0.0.0 S-->>C: OFFER, here is 10.1.1.55 and a lease C->>S: REQUEST, broadcast, I accept that one S-->>C: ACK, it is yours until the lease expires
The lease carries more than an address: mask, default gateway, DNS servers, domain name, and often NTP servers and a TFTP boot server. A client renews at half the lease time, and can keep using the address while it retries.
Configuring a router as a DHCP server is short, and the excluded range matters as much as the pool:
! reserve the addresses used by infrastructure before defining the pool
Router(config)# ip dhcp excluded-address 10.1.1.1 10.1.1.20
Router(config)# ip dhcp pool VLAN10
Router(dhcp-config)# network 10.1.1.0 255.255.255.0
Router(dhcp-config)# default-router 10.1.1.1
Router(dhcp-config)# dns-server 10.1.1.10 10.1.1.11
Router(dhcp-config)# domain-name example.local
Router(dhcp-config)# lease 7Crossing a subnet boundary
A DHCP discover is a broadcast, and routers do not forward broadcasts. So a central DHCP server on one subnet cannot hear clients on any other, and every subnet would need its own server.
DHCP relay solves it. Configure the client's default gateway to catch DHCP broadcasts and forward them as unicast to the server, inserting the subnet's own address so the server knows which pool to use:
Router(config)# interface vlan 10
Router(config-if)# ip helper-address 10.99.0.5Worth knowing: ip helper-address is not DHCP-specific. It forwards eight UDP broadcast services by default, including TFTP, DNS, TACACS and NetBIOS. That is usually harmless and occasionally surprising, and the list can be trimmed with ip forward-protocol.
The helper address goes on the interface facing the clients, not the one facing the server. It has to be on the interface that receives the broadcast. Putting it on the wrong interface is the single most common DHCP relay error, and it produces a subnet where nothing gets an address while the server looks perfectly healthy.
A client that ends up with a 169.254.x.x address has been through this and failed. The checklist is short: does the client's port have the right VLAN, does the gateway have a helper address, can the router reach the server, does the server have a pool for that subnet, and is the pool exhausted?
DNS, from the device's point of view
Clients get their resolvers from DHCP and everything is handled by the operating system. What matters here is the network device as a DNS client, which it needs to be for a few specific things.
Router(config)# ip domain-name example.local
Router(config)# ip name-server 10.1.1.10 10.1.1.11
Router(config)# ip domain-lookupThe domain name is required before an SSH key can be generated, because the key is labelled hostname.domain. Name resolution itself is needed if you want to configure an NTP server or a syslog target by name rather than address.
And the counterpart, which appears in nearly every configuration for the reason given in the IOS article: no ip domain-lookup stops a mistyped command being treated as a hostname and hanging the session for thirty seconds. Configure name servers if the device needs them, and disable lookup if it does not.
NTP: why anyone cares what time it is
Clock accuracy sounds like housekeeping and is not. Three things depend on it directly:
- Correlating logs. A fault that touches four devices produces four log streams. If their clocks differ by two minutes, reconstructing the order of events is guesswork.
- Certificates. Every certificate has a validity window. A device whose clock is wrong by a year rejects valid certificates and accepts expired ones.
- Authentication protocols. Kerberos rejects requests with more than five minutes of clock skew, so a wrong clock breaks Windows domain login outright.
NTP distributes time in a hierarchy measured in strata. Stratum 0 is a reference clock — an atomic clock or GPS receiver. A device synchronised directly to one is stratum 1, a device synchronised to that is stratum 2, and so on. Lower is more authoritative, and 16 means unsynchronised.
! most devices: point at an internal source
Switch(config)# ntp server 10.99.0.1
Switch(config)# clock timezone GMT 0
! the core router: sync to the internet and serve everyone else
Router(config)# ntp server 0.pool.ntp.org
Router(config)# ntp master 3
! authenticate, so nobody can feed the network a false time
Router(config)# ntp authentication-key 1 md5 SharedNtpSecret
Router(config)# ntp authenticate
Router(config)# ntp trusted-key 1
Switch# show ntp status
Switch# show ntp associationsThe standard design is a hierarchy: one or two devices synchronise to external sources, everything else synchronises to them. It reduces external dependency, and it means the whole network is consistent with itself even when the internet link is down — which is exactly when you are reading logs.
Setting the time zone is separate from setting the time. NTP distributes UTC; clock timezone decides how the device displays it. Many organisations leave every device on UTC precisely so that logs from different sites need no mental arithmetic.
Syslog: eight levels, and which ones to use
Every IOS message carries a severity from 0 to 7, and lower is more serious — which is the opposite of most people's instinct.
| Level | Name | Means |
|---|---|---|
| 0 | Emergency | The system is unusable |
| 1 | Alert | Immediate action needed |
| 2 | Critical | A critical condition, such as a failing power supply |
| 3 | Error | An error condition |
| 4 | Warning | A warning — duplex mismatch, native VLAN mismatch |
| 5 | Notification | Normal but significant: an interface changing state |
| 6 | Informational | Routine information |
| 7 | Debugging | Output from debug commands |
Configuring a level means "this level and everything more serious". Setting a destination to level 5 sends levels 0 through 5.
Router(config)# logging host 10.99.0.20
Router(config)# logging trap notifications ! levels 0 to 5 to the server
Router(config)# logging buffered 16384 informational
Router(config)# service timestamps log datetime msec localtime
Router(config)# no logging console ! keep debug output off the console
Router(config)# line vty 0 15
Router(config-line)# logging synchronousservice timestamps deserves its line. Without it, messages are stamped with uptime rather than a date, which makes correlating two devices impossible even when both are synchronised to NTP.
A message looks like this, and the format is worth being able to parse at a glance:
*Sep 9 14:22:07.331: %LINEPROTO-5-UPDOWN: Line protocol on Interface
GigabitEthernet1/0/24, changed state to downFacility LINEPROTO, severity 5, mnemonic UPDOWN, then the description. Grepping a syslog collector for -3- and below is a fast way to find everything that actually went wrong across a whole estate.
Leaving debug running on a busy production router can generate enough messages to consume the CPU and make the device unresponsive — including to your own session. Use terminal monitor to send output to a vty session rather than the console, and undebug all is the command to have ready before you start.
SNMP: polling and traps
Simple Network Management Protocol is how monitoring systems read counters from devices. It works in two directions:
- Polling — the manager asks the agent for a value, typically every five minutes. This is how interface utilisation graphs are drawn.
- Traps — the agent tells the manager that something happened, without being asked. An inform is the same thing with an acknowledgement, so it can be retried.
Values live in a numbered tree. An OID is a path in that tree, and a MIB is a document mapping readable names to those numbers. 1.3.6.1.2.1.2.2.1.10 is ifInOctets, the input byte counter for an interface — the number behind every bandwidth graph you have looked at.
| Version | Authentication | Encryption | Verdict |
|---|---|---|---|
| v1 | Community string in clear text | None | Obsolete |
| v2c | Community string in clear text | None | Still common, still sends the password in the clear |
| v3 | Username with authentication | Yes | The only version to deploy on a network you care about |
A community string is a shared password, and in v1 and v2c it travels unencrypted in every packet. Anyone who captures one read-only poll has the string. If it is a read-write community, they can reconfigure the device. The historical defaults, public and private, are the first thing any scanner tries.
! v2c, read-only, restricted by access list — acceptable only on a trusted management network
Router(config)# access-list 20 permit 10.99.0.20
Router(config)# snmp-server community Rd0nly-Str1ng RO 20
! v3 with authentication and encryption — the right answer
Router(config)# snmp-server group MONITOR v3 priv
Router(config)# snmp-server user nms MONITOR v3 auth sha AuthPass priv aes 128 PrivPass
Router(config)# snmp-server host 10.99.0.20 version 3 priv nms
Router(config)# snmp-server enable trapsSNMP is being displaced for configuration by NETCONF and RESTCONF, which are covered in the automation article, but it remains the standard way to read counters and will be in production networks for a long time yet.
Quality of service, briefly but properly
When a link is full, packets are dropped. Without quality of service, the ones dropped are simply whichever arrived when the queue was full — which means a file transfer can destroy a phone call, because the transfer will happily use every byte available.
QoS is the machinery for deciding whose packets suffer. It matters because different traffic breaks in different ways:
| Traffic | Sensitive to | Tolerates |
|---|---|---|
| Voice | Delay above 150 ms, jitter above 30 ms, loss above 1 percent | Low bandwidth is fine — about 80 kbps per call |
| Video conferencing | Jitter and loss | Bursty, needs real bandwidth |
| Interactive applications | Delay | Some loss, since TCP retransmits |
| Backups and file transfer | Almost nothing | Delay, loss, anything — it will just take longer |
Three ideas cover most of it.
Classify and mark, once, at the edge. Identify traffic as close to its source as possible and write a marking into the packet header so every device downstream can act on it without re-inspecting anything. The marking is DSCP, six bits in the IP header. EF (expedited forwarding, DSCP 46) is voice; the AF classes carry everything else in tiers; the default is 0.
Establish a trust boundary. Any host can set its own DSCP, so a laptop could mark all its traffic EF and jump every queue. The rule is: trust markings from devices you control — an IP phone — and rewrite everything else to zero at the access port.
Queue accordingly. On a congested interface, a low-latency queue serves voice first, with a bandwidth cap so it cannot starve everything else; the remaining classes get weighted shares of what is left; anything unclassified takes the leftovers.
The last pair of terms worth separating:
| Shaping | Policing | |
|---|---|---|
| Excess traffic is | Buffered and sent later | Dropped or re-marked immediately |
| Effect on TCP | Delays it, so it slows down gracefully | Causes retransmissions |
| Adds | Latency | Loss |
| Used | Outbound, to match a provider's contracted rate | Inbound, to enforce a limit on someone else |
Shaping smooths, policing punishes. A provider polices what you send them; you shape what you send to match, so that the smoothing happens in your buffer rather than as loss in theirs.
- Voice deployments are the reason most enterprises implement QoS at all — a phone system is the first application where users notice queueing delay directly and immediately.
- Cisco switches ship a
mls qos trust device cisco-phonestyle configuration precisely so the trust boundary sits at the phone and not at the PC behind it. - Internet paths do not honour your markings: providers routinely reset DSCP at their edge, so QoS is only reliable within a network you control or across a contracted WAN service.
- DORA
- The DHCP exchange: discover, offer, request, acknowledge.
- DHCP relay
- A router configured with
ip helper-address, converting a client's broadcast into a unicast to a server on another subnet. - Stratum
- An NTP device's distance from a reference clock. Stratum 1 is directly attached to one; 16 means unsynchronised.
- DSCP
- Differentiated services code point: six bits in the IP header carrying a traffic class, used by every device downstream to decide queueing.
- Trust boundary
- The point in the network beyond which QoS markings are believed. Markings from untrusted devices are rewritten there.
Recap
- DHCP is a four-message exchange — discover, offer, request, acknowledge — carrying address, mask, gateway, DNS and lease.
- Exclude infrastructure addresses before defining a pool, or the server will hand out an address you already used.
ip helper-addressrelays DHCP across a router, and it belongs on the client-facing interface.- A 169.254 address means the DORA exchange failed somewhere; check VLAN, helper, reachability and pool exhaustion in that order.
- A device needs a domain name before it can generate an SSH key, and
no ip domain-lookupstops typos hanging the session. - Correct time is required to correlate logs, validate certificates and authenticate with Kerberos.
- NTP stratum counts hops from a reference clock; lower is more authoritative and 16 means unsynchronised.
- Syslog severity runs 0 emergency to 7 debugging, and lower is more serious.
service timestamps log datetimeis what makes logs from two devices comparable.- SNMP v1 and v2c send community strings in clear text; v3 adds authentication and encryption and is the only version worth deploying.
- QoS classifies and marks at the edge with DSCP, establishes a trust boundary, and queues voice first with a cap.
- Shaping buffers excess traffic and adds delay; policing drops it and adds loss.
Questions
Say the answer out loud before opening it.
Walk through the DHCP exchange.
Discover, offer, request, acknowledge — the client broadcasts, a server offers an address, the client broadcasts its acceptance, and the server confirms with a lease.
- The discover comes from source 0.0.0.0 to 255.255.255.255, since the client has no address yet.
- The request is broadcast rather than unicast so other servers learn their offers were declined.
- The acknowledge carries mask, gateway, DNS servers, domain name and lease time.
Renewal starts at half the lease and is a unicast request and acknowledge, so a client keeps working through a brief server outage.
Why does DHCP need a relay, and where does the helper address go?
Because a discover is a broadcast and routers do not forward broadcasts; the helper address goes on the interface facing the clients.
- The router converts the broadcast into a unicast addressed to the server.
- It inserts the receiving interface's address so the server knows which pool to use.
- Putting the helper on the server-facing interface does nothing, because that interface never receives the broadcast.
ip helper-address also relays several other UDP broadcast services by default, which can be trimmed with ip forward-protocol if that is unwanted.
A client has a 169.254 address. What do you check, and in what order?
The switch port's VLAN, the gateway's helper address, reachability from router to server, and whether the pool is exhausted.
- A wrong VLAN means the broadcast never reaches a router that would relay it.
- A missing helper means it reaches the router and stops there.
- An exhausted pool means the server hears the discover and has nothing to offer.
Checking the server's lease list is decisive: if the discover appears there, the problem is on the return path or in the pool; if it does not, the problem is between client and server.
Why does a network device need to know its domain name?
Because an RSA key pair for SSH is labelled with hostname.domain, so key generation fails without both.
ip domain-namesets it, and it need not be a real internet domain.- Name servers are separately required if the device is to resolve names for NTP or syslog targets.
no ip domain-lookupdisables resolution entirely, which stops typos hanging the session.
Changing the hostname or domain after generating a key invalidates it, so SSH stops working until a new key is generated.
Why does accurate time matter on network devices?
Because log correlation, certificate validation and authentication protocols all depend on it.
- Reconstructing an incident across four devices is impossible if their clocks disagree.
- A device with a wrong clock rejects valid certificates and may accept expired ones.
- Kerberos rejects requests with more than five minutes of skew, which breaks domain logins outright.
Timestamps also need service timestamps log datetime, since IOS otherwise stamps messages with uptime, which is uncorrelatable no matter how accurate the clock is.
What does NTP stratum mean?
The number of hops from a reference clock: stratum 0 is the reference itself, a device synchronised directly to one is stratum 1, and each further hop adds one.
- Lower stratum is more authoritative.
- Stratum 16 means unsynchronised, and such a source is not used.
ntp master 3makes a device claim stratum 3, typically as an internal source.
The usual design has one or two devices synchronised externally and everything else synchronised to them, so the network stays internally consistent even when the internet link is down.
What are the syslog severity levels, and which way round are they?
Zero to seven, with zero the most serious: emergency, alert, critical, error, warning, notification, informational, debugging.
- Configuring a level includes that level and everything more serious.
- Level 5 notifications include interface state changes, which is usually the right level for a syslog server.
- Level 7 is
debugoutput and should never be a default destination on a production device.
Filtering a central log collector for severity 3 and below is a quick way to surface everything that actually failed across an entire estate.
Why is leaving debug enabled on a production router dangerous?
Because the volume of messages can consume the CPU and make the device unresponsive, including to your own session.
- Debug output is generated at process level and is expensive per packet.
- Console logging is especially slow, so
no logging consolewithterminal monitoris safer. undebug allstops everything and is worth typing before starting.
Conditional debugging, which restricts output to one interface or one address, makes the risk manageable when a debug genuinely is the only way to see what is happening.
What is the difference between SNMP polling and traps?
Polling is the manager asking the agent for values on a schedule; a trap is the agent notifying the manager that something happened.
- Polling produces the regular counters behind utilisation graphs.
- Traps are unacknowledged, so one lost in transit is simply lost.
- An inform is a trap with an acknowledgement, so it can be retried.
Because polling is periodic, an event between polls is invisible to it, which is why most systems use both — traps for events and polling for trends.
Why should SNMP v2c be avoided where possible?
Because the community string is a password sent in clear text in every packet, and there is no encryption of the data either.
- Anyone who captures one poll has the string.
- A read-write community allows an attacker to reconfigure the device.
- The historical defaults, public and private, are the first thing any scanner tries.
Where v2c is unavoidable, restricting it to read-only, binding it to an access list of specific manager addresses, and confining it to a management network reduces but does not remove the exposure.
Why does voice traffic need quality of service when it uses so little bandwidth?
Because it is sensitive to delay, jitter and loss rather than to bandwidth, and a congested queue produces all three.
- A call needs roughly 80 kbps but breaks above 150 ms of one-way delay or 1 percent loss.
- A file transfer will use every byte available and does not slow down politely.
- Without prioritisation, voice packets sit behind whatever arrived first.
Loss matters more for voice than for data because there is no retransmission — a lost packet is simply a gap in the audio, whereas TCP recovers a lost segment invisibly.
What is a QoS trust boundary and why does it exist?
The point beyond which DSCP markings are believed; it exists because any host can set its own markings and would otherwise be able to jump every queue.
- Markings from managed devices such as IP phones are trusted.
- Markings from user PCs are rewritten to zero at the access port.
- Classification is done once at the edge so downstream devices act on the marking without re-inspecting traffic.
Setting the boundary at the phone rather than the switch port is deliberate, because the PC plugged into the phone must not inherit the phone's trusted status.
What is the difference between shaping and policing?
Shaping buffers traffic above the rate and sends it later; policing drops or re-marks it immediately.
- Shaping adds latency, policing adds loss.
- Shaping is applied outbound, typically to match a provider's contracted rate.
- Policing is applied inbound, to enforce a limit on someone else's traffic.
Shaping is gentler on TCP, which interprets delay as mild congestion and slows down, whereas policing causes retransmissions and a sharper collapse in throughput.
What does DSCP EF mean and where is it used?
Expedited forwarding, DSCP value 46, the marking reserved for voice.
- It maps to a low-latency queue that is served before all others.
- The queue is bandwidth-capped so it cannot starve everything else.
- The AF classes carry other prioritised traffic in tiers, and 0 is best effort.
Markings are only honoured within networks you control: internet providers routinely reset DSCP at their edge, so end-to-end QoS across the public internet does not exist.
Why exclude addresses before configuring a DHCP pool?
Because the pool covers the whole subnet by default, including the addresses already assigned statically to routers, switches, printers and servers.
ip dhcp excluded-addressreserves a range before the pool is defined.- Without it the server will eventually hand out the gateway's own address to a client.
- The resulting duplicate-address conflict affects everyone on the subnet, not just that client.
The usual convention is to exclude the first twenty or so addresses of every subnet and keep all infrastructure inside that range, so the rule is the same everywhere.