|
|
This chapter contains these sections:
Network devices in different VLANs cannot communicate with one another without a router to route traffic between the VLANs. In most network environments, VLANs are associated with individual networks or subnetworks.
For example, in an IP network, each subnetwork is mapped to an individual VLAN. In an IPX network, each VLAN is mapped to an IPX network number.
Configuring VLANs helps control the size of the broadcast domain and keeps local traffic local. However, when an end station in one VLAN needs to communicate with an end station in another VLAN, interVLAN communication is required. This communication is supported by interVLAN routing. You configure one or more routers to route traffic to the appropriate destination VLAN.
Figure 2-1 shows a basic interVLAN routing topology. Switch A is in VLAN 10 and Switch B is in VLAN 20. The router has an interface in each VLAN.

When Host A in VLAN 10 needs to communicate with Host B in VLAN 10, it sends a packet addressed to that host. Switch A forwards the packet directly to Host B, without sending it to the router.
When Host A sends a packet to Host C in VLAN 20, Switch A forwards the packet to the router, which receives the traffic on the VLAN 10 interface. The router checks the routing table, determines the correct outgoing interface, and forwards the packet out the VLAN 20 interface to Switch B. Switch B receives the packet and forwards it to Host C.
To configure the MSFC for interVLAN routing, you must configure VLAN Trunk Protocol (VTP) and create and configure VLANs on the switch.
To configure VTP and VLANs on the switch, perform this task in privileged mode:
| Task | Command |
|---|---|
Step 1 Specify the VTP mode. | set vtp mode {client | server | transparent} |
Step 2 Configure a VTP domain (if you configured the switch as a VTP client or server). | set vtp domain name |
Step 3 Create VLANs on the switch. | set vlan vlan_num |
Step 4 Assign ports to the VLAN. | set vlan vlan_num mod_num/port_num |
This example shows how to configure VTP, create two VLANs, and assign switch ports to those VLANs:
Console> (enable) set vtp mode server
VTP domain modified
Console> (enable) set vtp domain Corp_Net
VTP domain Corp_Net modified
Console> (enable) set vlan 100
Vlan 100 configuration successful
Console> (enable) set vlan 200
Vlan 200 configuration successful
Console> (enable) set vlan 100 3/1-12
VLAN 100 modified.
VLAN 1 modified.
VLAN Mod/Ports
---- -----------------------
100 1/1-2
3/1-12
Console> (enable) set vlan 200 3/13-24
VLAN 200 modified.
VLAN 1 modified.
VLAN Mod/Ports
---- -----------------------
200 1/1-2
3/13-24
Console> (enable)
These sections describe basic router configuration tasks you need to understand before you configure interVLAN routing:
These sections describe how to access the MSFC from a directly connected console port or from a Telnet session:
You can use the switch console command to access the MSFC from the switch command-line interface (CLI) directly connected to the supervisor engine console port. To exit from the router CLI and return to the switch CLI, enter ^C^C^C at the Router> prompt.
To access the MSFC from the switch command-line interface, perform this task:
| Task | Command |
|---|---|
Access the MSFC from the switch CLI. | Console> (enable) switch console [mod_num]1 |
This example shows how to access the active MSFC from the switch CLI from the active supervisor engine, and how to exit the router CLI and return to the switch CLI:
Console> (enable) switch console 15 Trying Router-15... Connected to Router-15. Type ^C^C^C to switch back... Router>^C^C^C Console> (enable)
You can use the session mod_num command to access the MSFC from the switch CLI using a Telnet session. To exit from the router CLI back to the switch CLI, enter the exit command at the Router> prompt.
This example shows how to access the MSFC from the switch CLI, and how to exit the router CLI and return to the switch CLI:
Console> (enable) session 15 Router> exit Console> (enable)
To access configuration mode on the router, perform this task:
| Task | Command |
|---|---|
Step 1 If you are in the switch CLI, enter the router CLI. | Console> switch console [mod_num] |
Step 2 At the EXEC prompt, enter enable mode. | Router> enable |
Step 3 At the privileged EXEC prompt, enter global configuration mode. | Router# configure terminal |
Step 4 Enter the commands to configure interVLAN routing. | (Refer to the appropriate configuration tasks later in this chapter.) |
Step 5 Exit configuration mode. | Router(config)# Ctrl-Z |
To view and save the configuration after you make changes, perform this task:
| Task | Command |
|---|---|
Step 1 View the current operating configuration at the privileged EXEC prompt. | Router# show running-config |
Step 2 View the configuration in NVRAM. | Router# show startup-config |
Step 3 Save the current configuration to NVRAM. | Router# copy running-config startup-config |
In some cases, a router interface might be administratively shutdown. You can check the status of an interface using the show interface command.
To bring up a router interface that is administratively shutdown, perform this task in privileged mode:
| Task | Command |
|---|---|
Step 1 Specify the interface to bring up. | Router(config)# interface interface_type interface_number |
Step 2 Bring the interface up. | Router(config-if)# no shutdown |
Step 3 Exit configuration mode. | Router(config-if)# Ctrl-Z |
These sections describe how to configure interVLAN routing on the MSFC:
Configuring interVLAN routing on the MSFC consists of two main procedures:
1. You must create and configure VLANs on the switch and assign VLAN membership to switch ports. For more information, see the "Configuring VLAN Trunk Protocol and VLANs on the Switch" section.
2. You must create and configure VLAN interfaces for interVLAN routing on the MSFC. You must configure a VLAN interface between each VLAN you want to route traffic.
VLAN interfaces on the MSFC are virtual interfaces. However, you configure them much as you do a physical router interface.
To configure interVLAN routing for IP, perform this task:
| Task | Command |
|---|---|
Step 1 (Optional) Enable IP routing on the router1. | Router(config)# ip routing |
Step 2 (Optional) Specify an IP routing protocol2. | Router(config)# router ip_routing_protocol |
Step 3 Specify a VLAN interface on the MSFC. | Router(config)# interface vlan-id |
Step 4 Assign an IP address to the VLAN. | Router(config-if)# ip address n.n.n.n mask |
Step 5 Exit configuration mode. | Router(config-if)# Ctrl-Z |
This example shows how to enable IP routing on the MSFC, create a VLAN interface, and assign the interface an IP address:
Router# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# ip routing Router(config)# router rip Router(config-router)# network 10.0.0.0 Router(config-router)# interface vlan 100 Router(config-if)# ip address 10.1.1.1 255.0.0.0 Router(config-if)# ^Z Router#
To configure interVLAN routing for Internetwork Packet Exchange (IPX), perform this task:
| Task | Command |
|---|---|
Step 1 (Optional) Enable IPX routing on the router1. | Router(config)# ipx routing |
Step 2 (Optional) Specify an IPX routing protocol2. | Router(config)# ipx router ipx_routing_protocol |
Step 3 Specify a VLAN interface on the MSFC. | Router(config)# interface vlan-id |
Step 4 Assign a network number to the VLAN3. | Router(config-if)# ipx network [network | unnumbered] encapsulation encapsulation-type |
Step 5 Exit configuration mode. | Router(config-if)# Ctrl-Z |
This example shows how to enable IPX routing on the MSFC, create a VLAN interface, and assign the interface an IPX network address:
Router# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# ipx routing Router(config)# ipx router rip Router(config-ipx-router)# network all Router(config-ipx-router)# interface vlan100 Router(config-if)# ipx network 100 encapsulation snap Router(config-if)# ^Z Router#
To configure interVLAN routing for AppleTalk, perform this task:
| Task | Command |
|---|---|
Step 1 (Optional) Enable AppleTalk routing on the router1. | Router(config)# appletalk routing |
Step 2 Specify a VLAN interface on the MSFC. | Router(config)# interface vlan-id |
Step 3 Assign a cable range to the VLAN. | Router(config-if)# appletalk cable-range cable-range |
Step 4 Assign a zone name to the VLAN. | Router(config-if)# appletalk zone zone-name |
Step 5 Exit configuration mode. | Router(config-if)# Ctrl-Z |
| 1This step is necessary if you have multiple routers in the network. |
This example shows how to enable AppleTalk routing on the MSFC, create a VLAN interface, and assign the interface an AppleTalk cable-range and zone name:
Router# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# appletalk routing Router(config)# interface vlan100 Router(config-if)# appletalk cable-range 100-100 Router(config-if)# appletalk zone Engineering Router(config-if)# ^Z Router#
You can configure one or more Hot Standby Routing Protocol (HSRP) groups on MSFC VLAN interfaces to provide automatic routing backup for your network. Each VLAN interface in an HSRP group shares a virtual IP address and MAC address. You can configure end stations and other devices to use the HSRP address as the default gateway so that if one router interface fails, service is not interrupted to those devices.
The interface with the highest HSRP priority is the active interface for that HSRP group.
To use HSRP, you must have one of the following configurations:
To configure HSRP on an MSFC VLAN interface, perform this task in interface configuration mode:
| Task | Command |
|---|---|
Step 1 Enable HSRP and specify the HSRP IP address. If you do not specify a group-number, group 0 is used. | Router(config-if)# standby [group-number] ip [ip-address] |
Step 2 Specify the priority for the HSRP interface. Increase the priority of at least one interface in the HSRP group (the default is 100). The interface with the highest priority becomes active for that HSRP group. | Router(config-if)# standby [group-number] priority priority |
Step 3 (Optional) Configure the interface to preempt the current active HSRP interface and become active if the interface priority is higher than the priority of the current active interface. | Router(config-if)# standby [group-number] preempt [delay delay] |
Step 4 (Optional) Set the HSRP hello timer and holdtime timer for the interface. The default values are 3 (hello) and 10 (holdtime). All interfaces in the HSRP group should use the same timer values. | Router(config-if)# standby [group-number] timers hellotime holdtime |
Step 5 (Optional) Specify a clear-text HSRP authentication string for the interface. All interfaces in the HSRP group should use the same authentication string. | Router(config-if)# standby [group-number] authentication string |
This example shows how to configure an interface as part of HSRP group 100:
Router# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# interface vlan100 Router(config-if)# standby 100 ip 172.20.100.10 Router(config-if)# standby 100 priority 110 Router(config-if)# standby 100 preempt Router(config-if)# standby 100 timers 5 15 Router(config-if)# standby 100 authentication Secret Router(config-if)# ^Z Router#
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Posted: Tue Feb 22 11:36:24 PST 2000
Copyright 1989 - 2000©Cisco Systems Inc.