This chapter provides information and commands concerning the following topics:
Inter-VLAN communication
- Inter-VLAN communication using an external router: router-on-a-stick
- Inter-VLAN communication tips
- Inter-VLAN communication on a multilayer switch through a switch virtual interface
- - Removing L2 switchport capability of a switch port
- - Configuring SVI Autostate
- - Configuring a Layer 3 EtherChannel
- - Configuring inter-VLAN communication
- Configuration example: inter-VLAN communication
DHCP
- Configuring DHCP server on a Router or Layer 3 Switch
- Verifying and troubleshooting DHCP configuration
- Configuring a DHCP helper address
- DHCP client on a Cisco IOS Software Ethernet interface
- Configuration example: DHCP
CEF
- Configuring Cisco Express Forwarding (CEF)
- Verifying CEF
- Troubleshooting CEF
Inter-VLAN Communication Using an External Router: Router-on-a-Stick
|
Router(config)#interface fastethernet 0/0 |
Moves to interface configuration mode. |
|
Router(config-if)#duplex full |
Sets interface to full duplex. |
|
Router(config-if)#no shutdown |
Enables interface. |
|
Router(config-if)#interface fastethernet 0/0.1 |
Creates subinterface 0/0.1 and moves to subinterface configuration mode. |
|
Router(config-subif)#description Management VLAN 1 |
(Optional) Sets locally significant descriptor of the subinterface. |
|
Router(config-subif)#encapsulation dot1q 1 native |
Assigns VLAN 1 to this subinterface. VLAN 1 is the native VLAN. This subinterface uses the 802.1Q trunking protocol. |
|
Router(config-subif)#ip address 192.168.1.1 255.255.255.0 |
Assigns IP address and netmask. |
|
Router(config-subif)#interface fastethernet 0/0.10 |
Creates subinterface 0/0.10 and moves to subinterface configuration mode. |
|
Router(config-subif)#description Accounting VLAN 10 |
(Optional) Sets locally significant descriptor of the subinterface. |
|
Router(config-subif)#encapsulation dot1q 10 |
Assigns VLAN 10 to this subinterface. This subinterface uses the 802.1Q trunking protocol. |
|
Router(config-subif)#ip address 192.168.10.1 255.255.255.0 |
Assigns IP address and netmask. |
|
Router(config-subif)#exit |
Returns to interface configuration mode. |
|
Router(config-if)#exit |
Returns to global configuration mode. |
|
Router(config)# |
Inter-VLAN Communication Tips
- Although most routers support both Inter-Switch Link (ISL) and Dot1Q encapsulation, some switch models support only Dot1Q, such as the 2950 and 2960 series.
- If you need to use ISL as your trunking protocol, use the command encapsulation isl x, where x is the number of the VLAN to be assigned to that subinterface.
- Recommended best practice is to use the same number of the VLAN number for the subinterface number. It is easier to troubleshoot VLAN 10 on subinterface fastethernet0/0.10 than on fastethernet0/0.2.
- The native VLAN (usually VLAN 1) cannot be configured on a subinterface for Cisco IOS releases that are earlier than 12.1(3)T. Native VLAN IP addresses will, therefore, need to be configured on the physical interface. Other VLAN traffic will be configured on subinterfaces:
Router(config)#interface fastethernet 0/0 Router(config-if)#encapsulation dot1q 1 native Router(config-if)#ip address 192.168.1.1 255.255.255.0 Router(config-if)#interface fastethernet 0/0.10 Router(config-subif)#encapsulation dot1q 10 Router(config-subif)#ip address 192.168.10.1 255.255.255.0
Inter-VLAN Communication on a Multilayer Switch Through a Switch Virtual Interface
Rather than using an external router to provide inter-VLAN communication, a multilayer switch can perform the same task through the use of a switched virtual interface (SVI).
Removing L2 Switchport Capability of a Switch Port
|
3750Switch(config)#interface fastethernet 0/1 |
Moves to interface configuration mode. |
|
3750Switch(config-if)#no switchport |
Creates a Layer 3 port on the switch. |
|
NOTE: The no switchport command can be used on physical ports only on a Layer 3–capable switch. |
Configuring SVI Autostate
|
3750Switch(config)#interface fastethernet 0/1 |
Moves to interface configuration mode. |
|
3750Switch(config-if)#switchport auto-state exclude |
Excludes the access port/trunk in defining the status of an SVI as up or down. |
|
NOTE: This command is commonly used for ports that are used for monitoring, for example, so that a monitoring port does not cause the SVI to remain "up" when no other ports are active in the VLAN. |
Configuring a Layer 3 EtherChannel
|
Switch(config)#interface port-channel 1 |
Creates a virtual Layer 2 interface. |
|
Switch(config-if)#no switchport |
Changes interface to Layer 3 to enable the use of the IP address command. |
|
Switch(config-if)#ip address 172.32.52.10 255.255.255.0 |
Assigns an IP address to the Layer 3 port-channel interface. |
|
Switch(config)#interface range fastethernet 5/4 - 5 |
Moves to interface range configuration mode. |
|
Switch(config-if-range)#no switchport |
Creates Layer 3 ports on a switch. |
|
Switch(config-if-range)#channel-protocol pagp |
Configures port aggregation protocol. |
|
Switch(config-if-range)#channel-group 1 mode desirable |
Assigns the physical interfaces in the range to the EtherChannel group. |
Configuring Inter-VLAN Communication
|
3550Switch(config)#interface vlan 1 |
Creates a virtual interface for VLAN 1 and enters interface configuration mode. |
|
3550Switch(config-if)#ip address 172.16.1.1 255.255.255.0 |
Assigns IP address and netmask. |
|
3550Switch(config-if)#no shutdown |
Enables the interface. |
|
3550Switch(config)#interface vlan 10 |
Creates a virtual interface for VLAN 10 and enters interface configuration mode. |
|
3550Switch(config-if)#ip address 172.16.10.1 255.255.255.0 |
Assigns IP address and netmask. |
|
3550Switch(config-if)#no shutdown |
Enables the interface. |
|
3550Switch(config)#interface vlan 20 |
Creates a virtual interface for VLAN 20 and enters interface configuration mode. |
|
3550Switch(config-if)#ip address 172.16.20.1 255.255.255.0 |
Assigns IP address and netmask. |
|
3550Switch(config-if)#no shutdown |
Enables the interface. |
|
3550Switch(config-if)#exit |
Returns to global configuration mode. |
|
3550Switch(config)#ip routing |
Enables routing on the switch. |
Configuration Example: Inter-VLAN Communication
Figure 4-1 shows the network topology for the configuration that follows, which shows how to configure inter-VLAN communication using commands covered in this chapter. Some commands used in this configuration are from previous chapters.
Figure 4-1 Network Topology for Inter-VLAN Communication Configuration
ISP Router
|
Router>enable |
Moves to privileged mode. |
|
Router>#configure terminal |
Moves to global configuration mode. |
|
Router(config)#hostname ISP |
Sets the host name. |
|
ISP(config)#interface loopback 0 |
Moves to interface configuration mode. |
|
ISP(config-if)#description simulated address representing remote website |
Sets the locally significant interface description. |
|
ISP(config-if)#ip address 198.133.219.1 255.255.255.0 |
Assigns IP address and netmask. |
|
ISP(config-if)#interface serial 0/0/0 |
Moves to interface configuration mode. |
|
ISP(config-if)#description WAN link to the Corporate Router |
Sets the locally significant interface description. |
|
ISP(config-if)#ip address 192.31.7.5 255.255.255.252 |
Assigns IP address and netmask. |
|
ISP(config-if)#clock rate 56000 |
Assigns a clock rate to the interface—DCE cable is plugged in to this interface. |
|
ISP(config-if)#no shutdown |
Enables the interface. |
|
ISP(config-if)#exit |
Returns to global configuration mode. |
|
ISP(config-if)#router eigrp 10 |
Creates Enhanced Interior Gateway Routing Protocol (EIGRP) routing process 10. |
|
ISP(config-router)#network 198.133.219.0 |
Advertises directly connected networks (classful address only). |
|
ISP(config-router)#network 192.31.7.0 |
Advertises directly connected networks (classful address only). |
|
ISP(config-router)#no auto-summary |
Disables auto summarization. |
|
ISP(config-router)#exit |
Returns to global configuration mode. |
|
ISP(config)#exit |
Returns to privileged mode. |
|
ISP#copy running-config startup-config |
Saves the configuration to NVRAM. |
CORP Router
|
Router>enable |
Moves to privileged mode. |
|
Router>#configure terminal |
Moves to global configuration mode. |
|
Router(config)#hostname CORP |
Sets the host name. |
|
ISP(config)#interface serial 0/0/0 |
Moves to interface configuration mode. |
|
CORP(config-if)#description link to ISP |
Sets the locally significant interface description. |
|
CORP(config-if)#ip address 192.31.7.6 255.255.255.252 |
Assigns IP address and netmask. |
|
CORP(config-if)#no shutdown |
Enables the interface. |
|
CORP(config)#interface fastethernet 0/1 |
Moves to interface configuration mode. |
|
CORP(config-if)#description link to 3560 Switch |
Sets the locally significant interface description. |
|
CORP(config-if)#ip address 172.31.1.5 255.255.255.252 |
Assigns the IP address and netmask. |
|
CORP(config-if)#no shutdown |
Enables the interface. |
|
CORP(config-if)#exit |
Returns to global configuration mode. |
|
CORP(config)#interface fastethernet 0/0 |
Enters interface configuration mode. |
|
CORP(config-if)#duplex full |
Enables full-duplex operation to ensure trunking will take effect between here and L2Switch2. |
|
CORP(config-if)#no shutdown |
Enables the interface. |
|
CORP(config-if)#interface fastethernet 0/0.1 |
Creates a virtual subinterface and moves to subinterface configuration mode. |
|
CORP(config-subif)#description Management VLAN 1 – Native VLAN |
Sets the locally significant interface description. |
|
CORP(config-subif)#encapsulation dot1q 1 native |
Assigns VLAN 1 to this subinterface. VLAN 1 is the native VLAN. This subinterface uses the 802.1Q trunking protocol. |
|
CORP(config-subif)#ip address 192.168.1.1 255.255.255.0 |
Assigns the IP address and netmask. |
|
CORP(config-subif)#interface fastethernet 0/0.10 |
Creates a virtual subinterface and moves to subinterface configuration mode. |
|
CORP(config-subif)#description Sales VLAN 10 |
Sets the locally significant interface description. |
|
CORP(config-subif)#encapsulation dot1q 10 |
Assigns VLAN 10 to this subinterface. This subinterface uses the 802.1Q trunking protocol. |
|
CORP(config-subif)#ip address 192.168.10.1 255.255.255.0 |
Assigns the IP address and netmask. |
|
CORP(config-subif)#interface fastethernet 0/0.20 |
Creates a virtual subinterface and moves to subinterface configuration mode. |
|
CORP(config-subif)#description Engineering VLAN 20 |
Sets the locally significant interface description. |
|
CORP(config-subif)#encapsulation dot1q 20 |
Assigns VLAN 20 to this subinterface. This subinterface uses the 802.1Q trunking protocol. |
|
CORP(config-subif)#ip address 192.168.20.1 255.255.255.0 |
Assigns the IP address and netmask. |
|
CORP(config-subif)#interface fastethernet 0/0.30 |
Creates a virtual subinterface and moves to subinterface configuration mode. |
|
CORP(config-subif)#description Marketing VLAN 30 |
Sets the locally significant interface description. |
|
CORP(config-subif)#encapsulation dot1q 30 |
Assigns VLAN 30 to this subinterface. This subinterface uses the 802.1Q trunking protocol. |
|
CORP(config-subif)#ip add 192.168.30.1 255.255.255.0 |
Assigns the IP address and netmask. |
|
CORP(config-subif)#exit |
Returns to interface configuration mode. |
|
CORP(config-if)#exit |
Returns to global configuration mode. |
|
CORP(config)#router eigrp 10 |
Creates EIGRP routing process 10 and moves to router configuration mode. |
|
CORP(config-router)#network 192.168.1.0 |
Advertises the 192.168.1.0 network. |
|
CORP(config-router)#network 192.168.10.0 |
Advertises the 192.168.10.0 network. |
|
CORP(config-router)#network 192.168.20.0 |
Advertises the 192.168.20.0 network. |
|
CORP(config-router)#network 192.168.30.0 |
Advertises the 192.168.30.0 network. |
|
CORP(config-router)#network 172.31.0.0 |
Advertises the 172.31.0.0 network. |
|
CORP(config-router)#network 192.31.7.0 |
Advertises the 192.31.7.0 network. |
|
CORP(config-router)#no auto-summary |
Turns off automatic summarization at classful boundary. |
|
CORP(config-router)#exit |
Returns to global configuration mode. |
|
CORP(config)#exit |
Returns to privileged mode. |
|
CORP#copy running-config startup-config |
Saves the configuration in NVRAM. |
L2Switch2 (Catalyst 2960)
|
Switch>enable |
Moves to privileged mode. |
|
Switch#configure terminal |
Moves to global configuration mode. |
|
Switch(config)#hostname L2Switch2 |
Sets the host name. |
|
L2Switch2(config)#vlan 10 |
Creates VLAN 10 and enters VLAN-configuration mode. |
|
L2Switch2(config-vlan)#name Sales |
Assigns a name to the VLAN. |
|
L2Switch2(config-vlan)#exit |
Returns to global configuration mode. |
|
L2Switch2(config)#vlan 20 |
Creates VLAN 20 and enters VLAN-configuration mode. |
|
L2Switch2(config-vlan)#name Engineering |
Assigns a name to the VLAN. |
|
L2Switch2(config-vlan)#vlan 30 |
Creates VLAN 30 and enters VLAN-configuration mode. Note that you do not have to exit back to global configuration mode to execute this command. |
|
L2Switch2(config-vlan)#name Marketing |
Assigns a name to the VLAN. |
|
L2Switch2(config-vlan)#exit |
Returns to global configuration mode. |
|
L2Switch2(config)#interface range fastethernet 0/2 - 4 |
Enables you to set the same configuration parameters on multiple ports at the same time. |
|
L2Switch2(config-if-range)#switchport mode access |
Sets ports 2–4 as access ports. |
|
L2Switch2(config-if-range)#switchport access vlan 10 |
Assigns ports 2–4 to VLAN 10. |
|
L2Switch2(config-if-range)#interface range fastethernet 0/5 - 8 |
Enables you to set the same configuration parameters on multiple ports at the same time. |
|
L2Switch2(config-if-range)#switchport mode access |
Sets ports 5–8 as access ports. |
|
L2Switch2(config-if-range)#switchport access vlan 20 |
Assigns ports 5–8 to VLAN 20. |
|
L2Switch2(config-if-range)#interface range fastethernet 0/9 - 12 |
Enables you to set the same configuration parameters on multiple ports at the same time. |
|
L2Switch2(config-if-range)#switchport mode access |
Sets ports 9–12 as access ports. |
|
L2Switch2(config-if-range)#switchport access vlan 30 |
Assigns ports 9–12 to VLAN 30. |
|
L2Switch2(config-if-range)#exit |
Returns to global configuration mode. |
|
L2Switch2(config)#interface fastethernet 0/1 |
Moves to interface configuration mode. |
|
L2Switch2(config)#description Trunk Link to CORP Router |
Sets locally significant interface description. |
|
L2Switch2(config-if)#switchport mode trunk |
Puts the interface into trunking mode and negotiates to convert the link into a trunk link. |
|
L2Switch2(config-if)#exit |
Returns to global configuration mode. |
|
L2Switch2(config)#interface vlan 1 |
Creates virtual interface for VLAN 1 and enters interface configuration mode. |
|
L2Switch2(config-if)#ip address 192.168.1.2 255.255.255.0 |
Assigns the IP address and netmask. |
|
L2Switch2(config-if)#no shutdown |
Enables the interface. |
|
L2Switch2(config-if)#exit |
Returns to global configuration mode. |
|
L2Switch2(config)#ip default-gateway 192.168.1.1 |
Assigns the default gateway address. |
|
L2Switch2(config)#exit |
Returns to privileged mode. |
|
L2Switch2#copy running-config startup-config |
Saves the configuration in NVRAM. |
L3Switch1 (Catalyst 3560)
|
Switch>enable |
Moves to privileged mode. |
|
Switch#configure terminal |
Moves to global configuration mode. |
|
Switch(config)#hostname L3Switch1 |
Sets the host name. |
|
L3Switch1(config)#vtp mode sever |
Changes the switch to VTP server mode. |
|
L3Switch1(config)#vtp domain testdomain |
Configures the VTP domain name to testdomain. |
|
L3Switch1(config)#vlan 10 |
Creates VLAN 10 and enters VLAN-configuration mode. |
|
L3Switch1(config-vlan)#name Accounting |
Assigns a name to the VLAN. |
|
L3Switch1(config-vlan)#exit |
Returns to global configuration mode. |
|
L3Switch1(config)#vlan 20 |
Creates VLAN 20 and enters VLAN-configuration mode. |
|
L3Switch1(config-vlan)#name Marketing |
Assigns a name to the VLAN. |
|
L3Switch1(config-vlan)#exit |
Returns to global configuration mode. |
|
L3Switch1(config)#interface gigabitethernet 0/1 |
Moves to interface configuration mode. |
|
L3Switch1(config-if)#switchport trunk encapsulation dot1q |
Specifies 802.1Q encapsulation on the trunk link. |
|
L3Switch1(config-if)#switchport mode trunk |
Puts the interface into trunking mode and negotiates to convert the link into a trunk link. |
|
L3Switch1(config-if)#exit |
Returns to global configuration mode. |
|
L3Switch1(config)#ip routing |
Enables IP routing on this device. |
|
L3Switch1(config)#interface vlan 1 |
Creates a virtual interface for VLAN 1 and enters interface configuration mode. |
|
L3Switch1(config-if)#ip address 172.16.1.1 255.255.255.0 |
Assigns the IP address and netmask. |
|
L3Switch1(config-if)#no shutdown |
Enables the interface. |
|
L3Switch1(config-if)#interface vlan 10 |
Creates a virtual interface for VLAN 10 and enters interface configuration mode. |
|
L3Switch1(config-if)#ip address 172.16.10.1 255.255.255.0 |
Assigns the IP address and mask. |
|
L3Switch1(config-if)#no shutdown |
Enables the interface. |
|
L3Switch1(config-if)#interface vlan 20 |
Creates a virtual interface for VLAN 20 and enters interface configuration mode. |
|
L3Switch1(config-if)#ip address 172.16.20.1 255.255.255.0 |
Assigns the IP address and mask. |
|
L3Switch1(config-if)#no shutdown |
Enables the interface. |
|
L3Switch1(config-if)#exit |
Returns to global configuration mode. |
|
L3Switch1(config)#interface fastethernet 0/24 |
Enters interface configuration mode. |
|
L3Switch1(config-if)#no switchport |
Creates a Layer 3 port on the switch. |
|
L3Switch1(config-if)#ip address 172.31.1.6 255.255.255.252 |
Assigns the IP address and netmask. |
|
L3Switch1(config-if)#exit |
Returns to global configuration mode. |
|
L3Switch1(config)#router eigrp 10 |
Creates EIGRP routing process 10 and moves to router config mode. |
|
L3Switch1(config-router)#network 172.16.0.0 |
Advertises the 172.16.0.0 classful network. |
|
L3Switch1(config-router)#network 172.31.0.0 |
Advertises the 172.31.0.0 classful network. |
|
L3Switch1(config-router)#no auto-summary |
Turns off automatic summarization at classful boundary. |
|
L3Switch1(config-router)#exit |
Applies changes and returns to global configuration mode. |
|
L3Switch1(config)#exit |
Returns to privileged mode. |
|
L3Switch1#copy running-config startup-config |
Saves configuration in NVRAM. |
L2Switch1 (Catalyst 2960)
|
Switch>enable |
Moves to privileged mode. |
|
Switch#configure terminal |
Moves to global configuration mode. |
|
Switch(config)#hostname L2Switch1 |
Sets the host name. |
|
L2Switch1(config)#vtp domain testdomain |
Configures the VTP domain name to testdomain. |
|
L2Switch1(config)#vtp mode client |
Changes the switch to VTP client mode. |
|
L2Switch1(config)#interface range fastethernet 0/1 - 4 |
Enables you to set the same configuration parameters on multiple ports at the same time. |
|
L2Switch1(config-if-range)#switchport mode access |
Sets ports 1–4 as access ports. |
|
L2Switch1(config-if-range)#switchport access vlan 10 |
Assigns ports 1–4 to VLAN 10. |
|
L2Switch1(config-if-range)#interface range fastethernet 0/5 - 8 |
Enables you to set the same configuration parameters on multiple ports at the same time. |
|
L2Switch1(config-if-range)#switchport mode access |
Sets ports 5–8 as access ports. |
|
L2Switch1(config-if-range)#switchport access vlan 20 |
Assigns ports 5–8 to VLAN 20. |
|
L2Switch1(config-if-range)#exit |
Returns to global configuration mode. |
|
L2Switch1(config)#interface gigabitethernet 0/1 |
Moves to interface configuration mode. |
|
L2Switch1(config-if)#switchport mode trunk |
Puts the interface into trunking mode and negotiates to convert the link into a trunk link. |
|
L2Switch1(config-if)#exit |
Returns to global configuration mode. |
|
L2Switch1(config)#interface vlan 1 |
Creates a virtual interface for VLAN 1 and enters interface configuration mode. |
|
L2Switch1(config-if)#ip address 172.16.1.2 255.255.255.0 |
Assigns the IP address and netmask. |
|
L2Switch1(config-if)#no shutdown |
Enables the interface. |
|
L2Switch1(config-if)#exit |
Returns to global configuration mode. |
|
L2Switch1(config)#ip default-gateway 172.16.1.1 |
Assigns the default gateway address. |
|
L2Switch1(config)#exit |
Returns to privileged mode. |
|
L2Switch1#copy running-config startup-config |
Saves the configuration in NVRAM. |
Configuring DHCP Server on a Router or Layer 3 Switch
|
Router(config)#ip dhcp pool internal |
Creates a DHCP pool called internal. |
|
Router(dhcp-config)#network 172.16.10.0 255.255.255.0 |
Defines the range of addresses to be leased. |
|
Router(dhcp-config)#default-router 172.16.10.1 |
Defines the address of the default router for the client. |
|
Router(dhcp-config)#dns-server 172.16.10.10 |
Defines the address of the Domain Name System (DNS) server for the client. |
|
Router(dhcp-config)#netbios-name-server 172.16.10.10 |
Defines the address of the NetBIOS server for the client. |
|
Router(dhcp-config)#domain-name fakedomainname.ca |
Defines the domain name for the client. |
|
Router(dhcp-config)#lease 14 12 23 |
Defines the lease time to be 14 days, 12 hours, 23 minutes. |
|
Router(dhcp-config)#lease infinite |
Sets the lease time to infinity; the default time is 1 day. |
|
Router(dhcp-config)#exit |
Returns to global configuration mode. |
|
Router(config)#ip dhcp excluded-address 172.16.10.1 172.16.10.9 |
Specifies the range of addresses not to be leased out to clients. |
|
Router(config)#service dhcp |
Enables the DHCP service and relay features on a Cisco IOS router. |
|
Router(config)#no service dhcp |
Turns off the DHCP service. DHCP service is enabled by default in Cisco IOS Software. |
Verifying and Troubleshooting DHCP Configuration
|
Router#show ip dhcp binding |
Displays a list of all bindings created. |
|
Router#show ip dhcp binding w . x . y . z |
Displays the bindings for a specific DHCP client with an IP address of w.x.y.z. |
|
Router#clear ip dhcp binding a . b . c . d |
Clears an automatic address binding from the DHCP server database. |
|
Router#clear ip dhcp binding * |
Clears all automatic DHCP bindings. |
|
Router#show ip dhcp conflict |
Displays a list of all address conflicts recorded by the DHCP server. |
|
Router#clear ip dhcp conflict a.b.c.d |
Clears address conflict from the database. |
|
Router#clear ip dhcp conflict * |
Clears conflicts for all addresses. |
|
Router#show ip dhcp database |
Displays recent activity on the DHCP database. |
|
Router#show ip dhcp server statistics |
Displays a list of the number of messages sent and received by the DHCP server. |
|
Router#clear ip dhcp server statistics |
Resets all DHCP server counters to 0. |
|
Router#debug ip dhcp server {events | packets | linkage | class } |
Displays the DHCP process of addresses being leased and returned. |
Configuring a DHCP Helper Address
Router
|
Router(config)#interface fastethernet 0/0 |
Moves to interface configuration mode. |
|
Router(config-if)#ip helper-address 172.16.20.2 |
DHCP broadcasts will be forwarded as a unicast to this specific address rather than be dropped by the router. |
Layer 3 Switch
|
Switch(config)#interface vlan 10 |
Moves to SVI configuration mode. |
|
Switch(config-if)#ip helper-address 172.16.20.2 |
DHCP broadcasts will be forwarded as a unicast to this specific address rather than be dropped by the router. |
DHCP Client on a Cisco IOS Software Ethernet Interface
|
Router(config)#interface fastethernet 0/0 |
Moves to interface configuration mode. |
|
Router(config-if)#ip address dhcp |
Specifies that the interface acquire an IP address through DHCP. |
|
NOTE: The ip address dhcp command can also be applied on an L3 switch at the SVI as well as any port where the no switchport command has been used. |
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. |
Configuring Cisco Express Forwarding
|
Switch(config)#ip cef |
Enables standard CEF. |
|
Switch(config)#ip cef distributed |
Enables distributed CEF (dCEF). |
|
Switch(config)#no ip cef |
Disables CEF globally. |
|
Switch(config)#interface fastethernet 0/1 |
Moves to interface configuration mode. |
|
Switch(config-if)#ip route-cache cef |
Enables CEF on the interface. |
Verifying CEF
|
Switch#show ip cef |
Displays entries in the Forwarding Information Base (FIB). |
|
Switch#show ip cef summary |
Displays a summary of the FIB. |
|
Switch#show ip cef unresolved |
Displays unresolved FIB entries. |
|
Switch#show ip cef fastethernet 0/1 |
Displays the FIB entry for the specified interface. |
|
Switch#show ip cef fastethernet 0/1 detail |
Displays detailed information about the FIB for the interface. |
|
Switch#show interface fastethernet 0/1 | begin L3 |
Displays switching statistics for the interface beginning at the section for L3. |
|
Switch#showinterface gigabitethernet 1/1 | include switched |
Displays switching statistics that show statistics for each layer. |
|
Switch#show adjacency fastethernet 0/20 detail |
Displays the content of the information to be used during L2 encapsulation. |
|
NOTE: When using the show adjacency interface xx detail command, both the next hop-hop and local MAC addresses are displayed as well as the well-known Ethertype value of the encapsulation protocol (0x0800 for IP). |
|
|
Switch#show cef drop |
Displays packets that are dropped because adjacencies are incomplete or nonexistent. |
|
Switch#show ip interface vlan10 |
Verifies whether CEF is enabled on an interface. |
Troubleshooting CEF
|
Switch#debug ip cef |
Displays debug information for CEF. |
|
Switch#debug ip cef drops |
Displays debug information about dropped packets. |
|
Switch#debug ip cef drops x |
Records CEF dropped packets that match access-list x. |
|
Switch#debug ip cef receive |
Displays packets that are not switched using information from the FIB but that are received and sent to the next switching layer. |
|
Switch#debug ip cef events |
Displays general CEF events. |
|
Switch#debug ip cef prefix-ipc |
Displays updates related to IP prefix information. |
|
Switch#debug ip cef table |
Produces a table showing events related to the FIB table. |
|
Switch#ping ip |
Performs an extended ping. |
