Configuration Example


Virtual LANs


Virtual LANs (VLANs) enable network managers to group users logically rather than by physical location.

With VLANs, switches can support more than one subnet (or VLAN) on each switch, and can give routers and switches the opportunity to support multiple subnets on a single physical link. Layer 3 switching software supports VLAN frame encapsulation through implementation of the Inter-Switch Link (ISL) protocol and the IEEE 802.1Q standard. ISL is a Cisco protocol for interconnecting multiple switches and maintaining VLAN information as traffic travels between switches. The IEEE 802.1Q standard provides a method for secure bridging of data across a shared backbone.


Command

Purpose

Switch# configure terminal

Switch(config)#

Enters global configuration mode.

Switch(config)# interface {gigabitethernet fastethernet} card/subcard/port.subinterface

Switch(config-subif)#

Enters subinterface configuration mode.

Switch(config-subif)#

encapsulation isl vlan-id


or

Switch(config-subif)# encap dot1q

vlan-id native

Specifies ISL encapsulation for the Ethernet frames sent from this subinterface, with a header that maintains the specified VLAN ID between network nodes.

or

Specifies 802.1Q encapsulation for Ethernet frames sent from the subinterface, with a header that maintains the specified native VLAN ID between network nodes.

Switch(config-subif)# bridge-group bridge-group

Assigns the subinterface a bridge group number.

Switch(config-subif)# interface {gigabitethernet fastethernet} card/subcard/port

Switch(config-if)#

Enters interface configuration mode to configure the Ethernet main interface.

Switch(config-if)# bridge-group bridge-group

Assigns the main interface to the bridge group.

Switch(config-if)# exit

Returns to global configuration mode.

Switch(config)# bridge bridge-group protocol ieee

Specifies that the bridge group will use the IEEE Ethernet Spanning Tree Protocol.



5-5

Example

Switch> enable

Switch# configure terminal

Switch(config)# interface gigabitethernet 0/0/1.1

Switch(config-subif)# encapsulation isl 50

Switch(config-subif)# bridge-group 1

Switch(config-subif)# interface gigabitethernet 11/0/0

Switch(config-if)# bridge-group 1

Switch(config-if)# exit

Switch(config)# bridge 1 protocol ieee

Switch(config)# interface fastethernet 10/0/1.2

Switch(config-subif)# encapsulation isl 100

Switch(config-subif)# bridge-group 2

Switch(config-subif)# interface fastethernet 9/0/2

Switch(config-if)# bridge-group 2

Switch(config-if)# exit

Switch(config)# bridge 2 protocol ieee

Switch(config)# exit

Switch# copy system:running-config nvram:startup-config



Verifying

Switch# show vlan 50

Virtual LAN ID: 50 (Inter Switch Link Encapsulation)

vLAN Trunk Interface: GigabitEthernet0/0/1.

Protocols Configured: Address: Received: Transmitted:

Bridging Bridge Group 1 0

Switch# more system:running-config

!

<Information deleted>

!

interface GigabitEthernet0/0/1.1

encapsulation isl 50

no ip redirects

no ip route-cache

bridge-group 1

!

<Information deleted>


Ether-Channel

EtherChannel is a logical aggregation of multiple Ethernet interfaces. EtherChannel is designed primarily for host-to-switch connectivity or Inter-Switch Link (ISL) switch-to-switch connectivity.


Configuring a Fast EtherChannel (FEC) or a Gigabit EtherChannel (GEC) consists of the following two-step process:

Step 1: Create an EtherChannel interface (port channel) and assign a network address.

Step 2: Assign the Fast Ethernet or Gigabit Ethernet interfaces (up to four) to the port channel.


When assigning interfaces to a specific port channel, the interfaces must all be Fast Ethernet, Gigabit Ethernet, or Enhanced Gigabit Ethernet. You cannot mix interface types within a single port-channel.


Command

Purpose

Switch> enable

Enters privileged EXEC mode.

Switch# configure terminal

Switch(config)#

Enters global configuration mode.

Switch(config)# interface port-channel channel-number

Switch(config-if)#

Creates the EtherChannel interface and enters interface configuration mode. The channel number can be from 1 to 64 for FECs and GECs.

Switch(config-if)# ip address ip-address subnet-mask

Assigns an IP address and subnet mask to the EtherChannel interface.

Switch(config-if)# no shutdown

Enables the EtherChannel interface.

Switch(config-if)# exit

Switch(config)#

Exits interface configuration mode. Optionally, you can remain in interface configuration mode and enable other supported interface commands to meet

your requirements.

Switch(config)# interface {gigabitethernet fastethernet} card/subcard/port

Switch(config-if)

Enters interface configuration mode.

Switch(config-if)# no ip address

Disables the IP address.

Note If the Fast Ethernet or Gigabit Ethernet interface already exists and has an IP address assigned,

you must disable it before performing the next step.

The Ethernet interface uses the IP address assigned to the EtherChannel interface.

Switch(config-if)# channel-group channel-number

Assigns the Fast Ethernet or Gigabit Ethernet interfaces to the EtherChannel. The channel number must be the same channel number you assigned to the

EtherChannel interface.

Switch(config-if)# exit

Switch(config)#

Returns to global configuration mode. Repeat Steps 7 through 9 to add up to four Fast Ethernet or Gigabit Ethernet interfaces to the Fast EtherChannel.

Switch(config)# end

Switch#

Returns to privileged EXEC mode.

Switch# copy system:running-config nvram:startup-config

Saves your configuration changes to NVRAM.



Example

Switch> enable

Switch# configure terminal

Switch(config)# interface port-channel 5

Switch(config-if)# ip address 209.165.200.225 255.255.255.224

Switch(config-if)# no shutdown

Switch(config-if)# exit

Switch(config)# interface fastethernet 0/0/0

Switch(config-if)# no ip address

Switch(config-if)# channel-group 5

Switch(config-if)# end

Switch# copy system:running-config nvram:startup-config



HSRP

HSRP is a Cisco-proprietary protocol developed to allow several routers or multilayer switches to appear as a single gateway IP address for internal hosts.


HSRP Operation:

HSRP active router election is based on a priority value (0 to 255) that is configured on each router in the group. Default priority is 100. The router with the highest priority value (255 is highest) becomes the active router for the group. If all router priorities are equal or set to the default value, the router with the highest IP address on the HSRP interface becomes the active router. Active router, exchange HSRP hello messages
(to the multicast destination 224.0.0.2 using UDP port 1985) at regular intervals and only the standby router monitors the hello messages from the HSRP active router. By default, hellos are sent every 3 seconds. If hellos are missed for the duration of the holdtime timer (default 10 seconds, or three times the hello timer), the active router is presumed to be down. The standby router is then clear to assume the active role. At that point, if other routers are sitting in the Listen state, the next-highest priority router is allowed to become the new standby router.

A router can be configured as pre-empt to immediately take over the active role if its priority is the highest at any time. By default pre-empt is off.


HSRP Messages:

HSRP-configured routers exchange three types of multicast messages:

  • Hello—Hello message conveys router's HSRP priority and state information to other HSRP routers. By default, an HSRP router sends hello messages every three seconds.
  • Coup—When a standby router assumes the function of the active router, it sends a coup message.
  • Resign—A router that is the active router sends this message when it is about to shut down or when a router that has a higher priority sends a hello message.


At any time, HSRP-configured routers are in one of the following states:

1. Active—The router is performing packet-transfer functions.

2. Standby—The router is prepared to assume packet-transfer functions if the active router fails.

3. Speaking and listening—The router is sending and receiving hello messages.

4. Listening—The router is receiving hello messages.


Configuration for Router A:

hostname RouterA

!

interface ethernet 0

ip address 1.0.0.1 255.0.0.0

standby 1 ip 1.0.0.3

standby 1 preempt

standby 1 priority 110

standby 1 authentication denmark

standby 1 timers 5 15

!

interface ethernet 1

ip address 3.0.0.1 255.0.0.0

!

router eigrp 1

network 1.0.0.0

network 3.0.0.0



Configuration for Router B:

hostname RouterB

!

interface ethernet 0

ip address 1.0.0.2 255.0.0.0

standby 1 ip 1.0.0.3

standby 1 preempt

standby 1 authentication denmark

standby 1 timers 5 15

!

interface ethernet 1

ip address 2.0.0.2 255.0.0.0

!

router eigrp 1

network 1.0.0.0

network 2.0.0.0


The standby ip interface configuration command enables HSRP and establishes 1.0.0.3 as the IP address of the virtual router. The configurations of both routers include this command so that both routers share the same virtual IP address. The 1 establishes Hot Standby group 1. (If you do not specify a group number, the default is group 0). The configuration for at least one of the routers in the Hot Standby group must specify the IP address of the virtual router; specifying the IP address of the virtual router is optional for other routers in the same Hot Standby group.


The standby preempt interface configuration command allows the router to become the active router when its priority is higher than all other HSRP-configured routers in this Hot Standby group at any time. The configurations of both routers include this command so that each router can be the standby router for the other router. The 1 indicates that this command applies to Hot Standby group 1. If you do not use the standby preempt command in the configuration for a router, that router cannot become the active router automatically.


The standby priority interface configuration command sets the router's HSRP priority to 110, which is higher than the default priority of 100. Only the configuration of Router A includes this command, which makes Router A the default active router. The 1 indicates that this command applies to Hot Standby group 1.


The standby authentication interface configuration command establishes an authentication string whose value is an unencrypted eight-character string that is incorporated in each HSRP multicast message. This command is optional. If you choose to use it, each HSRP-configured router in the group should use the same string so that each router can authenticate the source of the HSRP messages that it receives. The "1" indicates that this command applies to Hot Standby group 1.


The standby timers interface configuration command sets the interval in seconds between hello messages (called the hello time) to five seconds and sets the duration in seconds that a router waits before it declares the active router to be down (called the hold time) to eight seconds. (The defaults are three and 10 seconds, respectively.) If you decide to modify the default values, you must configure each router to use the same hello time and hold time. The "1" indicates that this command applies to Hot Standby group 1.


Configuration Commands

Switch(config-if)# standby group ip ip-address [secondary]

Switch(config-if)# standby group priority priority

Switch(config-if)# standby group timers [msec] hello [msec] holdtime

Switch(config-if)# standby group preempt [delay [minimum seconds] [reload seconds]]

Switch(config-if)# standby group authentication string

Switch(config-if)# standby group authentication md5 key-string [0 | 7] string