Configuration Example: DHCP
Figure 4-2 illustrates the network topology for the configuration that follows, which shows how to configure DHCP services on a Cisco IOS router using the commands covered in this chapter.
Figure 4-2 Network Topology for DHCP Configuration
Edmonton Router
router>enable |
Moves to privileged mode. |
router#configure terminal |
Moves to global configuration mode. |
router(config)#host Edmonton |
Sets the host name. |
Edmonton(config)#interface fastethernet 0/0 |
Moves to interface configuration mode. |
Edmonton(config-if)#description LAN Interface |
Sets the local description of the interface. |
Edmonton(config-if)#ip address 10.0.0.1 255.0.0.0 |
Assigns an IP address and netmask. |
Edmonton(config-if)#no shutdown |
Enables the interface. |
Edmonton(config-if)#interface serial 0/0/0 |
Moves to interface configuration mode. |
Edmonton(config-if)#description Link to Gibbons Router |
Sets the local description of the interface. |
Edmonton(config-if)#ip address 192.168.1.2 255.255.255.252 |
Assigns an IP address and netmask. |
Edmonton(config-if)#clock rate 56000 |
Assigns the clock rate to the DCE cable on this side of link. |
Edmonton(config-if)#no shutdown |
Enables the interface. |
Edmonton(config-if)#exit |
Returns to global configuration mode. |
Edmonton(config)#router eigrp 10 |
Enables the EIGRP routing process for autonomous system 10. |
Edmonton(config-router)#network 10.0.0.0 |
Advertises the 10.0.0.0 network. |
Edmonton(config-router)#network 192.168.1.0 |
Advertises the 192.168.1.0 network. |
Edmonton(config-router)#exit |
Returns to global configuration mode. |
Edmonton(config)#service dhcp |
Verifies that the router can use DHCP services and that DHCP is enabled. |
Edmonton(config)#ip dhcp excluded-address 10.0.0.1 10.0.0.5 |
Specifies the range of addresses not to be leased out to clients. |
Edmonton(config)#ip dhcp pool 10 network |
Creates a DHCP pool called 10network. |
Edmonton(dhcp-config)#network 10.0.0.0 255.0.0.0 |
Defines the range of addresses to be leased. |
Edmonton(dhcp-config)#default-router 10.0.0.1 |
Defines the address of the default router for clients. |
Edmonton(dhcp-config)#netbios-name-server 10.0.0.2 |
Defines the address of the NetBIOS server for clients. |
Edmonton(dhcp-config)#dns-server 10.0.0.3 |
Defines the address of the DNS server for clients. |
Edmonton(dhcp-config)#domain-name fakedomainname.ca |
Defines the domain name for clients. |
Edmonton(dhcp-config)#lease 12 14 30 |
Sets the lease time to be 12 days, 14 hours, 30 minutes. |
Edmonton(dhcp-config)#exit |
Returns to global configuration mode. |
Edmonton(config)#ip dhcp pool 192.168.3network |
Creates a DHCP pool called the 192.168.3network. |
Edmonton(dhcp-config)#network 192.168.3.0 255.255.255.0 |
Defines the range of addresses to be leased. |
Edmonton(dhcp-config)#default-router 192.168.3.1 |
Defines the address of the default router for clients. |
Edmonton(dhcp-config)#netbios-name-server 10.0.0.2 |
Defines the address of the NetBIOS server for clients. |
Edmonton(dhcp-config)#dns-server 10.0.0.3 |
Defines the address of the DNS server for clients. |
Edmonton(dhcp-config)#domain-name fakedomainname.ca |
Defines the domain name for clients. |
Edmonton(dhcp-config)#lease 12 14 30 |
Sets the lease time to be 12 days, 14 hours, 30 minutes. |
Edmonton(dhcp-config)#exit |
Returns to global configuration mode. |
Edmonton(config)#exit |
Returns to privileged mode. |
Edmonton#copy running-config startup-config |
Saves the configuration to NVRAM. |
Gibbons Router
router>enable |
Enters privileged mode. |
router#configure terminal |
Enters global configuration mode. |
router(config)#host Gibbons |
Sets the host name. |
Gibbons(config)#interface fastethernet 0/0 |
Enters interface configuration mode. |
Gibbons(config-if)#description LAN Interface |
Sets the local description of the interface. |
Gibbons(config-if)#ip address 192.168.3.1 255.255.255.0 |
Assigns an IP address and netmask. |
Gibbons(config-if)#ip helper-address 192.168.1.2 |
DHCP broadcasts will be forwarded as a unicast to this address rather than be dropped. |
Gibbons(config-if)#no shutdown |
Enables the interface. |
Gibbons(config-if)#interface serial 0/0/1 |
Enters interface configuration mode. |
Gibbons(config-if)#description Link to Edmonton Router |
Sets the local description of the interface. |
Gibbons(config-if)#ip address 192.168.1.1 255.255.255.252 |
Assigns an IP address and netmask. |
Gibbons(config-if)#no shutdown |
Enables the interface. |
Gibbons(config-if)#exit |
Returns to global configuration mode. |
Gibbons(config)#router eigrp 10 |
Enables the EIGRP routing process for autonomous system 10. |
Gibbons(config-router)#network 192.168.3.0 |
Advertises the 192.168.3.0 network. |
Gibbons(config-router)#network 192.168.1.0 |
Advertises the 192.168.1.0 network. |
Gibbons(config-router)#exit |
Returns to global configuration mode. |
Gibbons(config)#exit |
Returns to privileged mode. |
Gibbons#copy running-config startup-config |
Saves the configuration to NVRAM. |