Social Icons

Tuesday, May 20, 2014

CCNP SWITCH: 5. InterVLAN Routing

To transport packets between VLANs, you must use a Layer 3 device.
Traditionally, this has been a router’s function. The router must have a physical or logical connection to each VLAN so that it can forward packets between them.
Separate physical connections can be used, or the router can access each of the VLANs through a single trunk link.

A multilayer switch can assign a Layer 3 address to a physical interface or to a logical interface that represents an entire VLAN.
This is known as a switched virtual interface (SVI).

Note: The Layer 3 address you configure becomes the default gateway for any hosts that are connected to the interface or VLAN.

An interface is either in Layer 2 or Layer 3 mode, depending on the use of the switchport interface configuration command.
This can be verified by using:

Switch# show interface type mod/num switchport   (Enabled means Layer 2 mode)

Layer 2 port config:
If an interface is in Layer 3 mode and you need to reconfigure it for Layer 2 functionality use the following command sequence:
Switch(config)# interface type mod/num
Switch(config-if)# switchport

Layer 3 port config:
Physical switch ports also can operate as Layer 3 interfaces, where a Layer 3 network address is assigned and routing can occur:
Switch(config)# interface type mod/num
Switch(config-if)# no switchport
Switch(config-if)# ip address ip-address mask [secondary]

SVI port config:
The logical Layer 3 interface is known as an SVI.
Switch(config)# interface vlan vlan-id
Switch(config-if)# ip address ip-address mask [secondary]

Note: The VLAN must be defined and active on the switch before the SVI can be used and also configured with the no shutdown command.

In our topology, let's consider switches AS1, DS1 and DS2.
All switches have three additional VLANs configured:

AS1#show vlan-switch brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa1/0, Fa1/1, Fa1/3, Fa1/5
                                                Fa1/6, Fa1/7, Fa1/8, Fa1/9
                                                Fa1/10, Fa1/11, Fa1/12, Fa1/13
                                                Fa1/14, Fa1/15
2    VL002                            active  
3    VL003                            active  
4    VL004                            active  

1) We will configure L3 connectivity between AS1 and DS1 using L3 physical interfaces.
2) We will configure L3 connectivity between AS1 and DS1 using SVI interfaces, by including the trunk ports in a L3 VLAN.

AS1#show cdp neighbors 
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
DS1.lab.local    Fas 1/2            138        R S I      3660      Fas 1/2
DS2.lab.local    Fas 1/4            138        R S I      3660      Fas 1/4

First task:
AS1(config)#interface fastEthernet 1/2
AS1(config-if)#no switchport 
AS1(config-if)#ip address 192.168.1.100 255.255.255.0

DS1(config)#interface fastEthernet 1/2
DS1(config-if)#no switchport 
DS1(config-if)#ip address 192.168.1.200 255.255.255.0

L3 connection has been established:

AS1#ping 192.168.1.200

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.200, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/24/40 ms

Second task:
AS1#show vlan-switch | i VL004
4    VL004                            active    Fa1/4

DS2#show vlan-switch | i VL004
4    VL004                            active    Fa1/4

AS1(config)#interface vlan 4
AS1(config-if)#ip address 172.16.0.100 255.255.255.0
AS1(config-if)#no shutdown

DS2(config)#interface vlan 4
DS2(config-if)#ip address 172.16.0.200 255.255.255.0
DS2(config-if)#no shutdown

L3 connection has been established:

AS1#ping 172.16.0.200

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.200, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/24/36 ms  

Note: Creating or configuring the SVI doesn’t create or configure the VLAN.

Note: If when modifying the vlan database you encounter the following error you can erase the flash to resolve this issue:

% not enough space on flash to store vlan database. trying squeeze...First create squeeze log by erasing the entire device

% error squeezing flash - (Missing or corrupted log)
Error on database apply 40: NV storage failure
Use 'abort' command to exit


AS1(vlan)#abort
Aborting....

AS1#erase flash:
Erasing the flash filesystem will remove all files! Continue? [confirm]
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased
Erase of flash: complete 

Note: Although we reload the switches whenever we want new default configs, the VLAN and VTP information is still present.
The reason is that this VLAN and VTP information is actually kept in the VLAN.DAT file in Flash memory, and the contents of Flash are kept on a reload. The file has to be deleted manually. 
More info at: http://www.mcmcse.com/cisco/guides/vlandat.shtml

No comments:

Post a Comment