Do you like this site? Remember to share it to all your friends on Facebook and Twitter!

Showing posts with label VLAN. Show all posts
Showing posts with label VLAN. Show all posts

Sunday, April 20, 2014

Default reserved VLAN numbers on Cisco IOS and NX-OS

Fire-like Kapok blossoms in Taipei City, Taiwan

To show the reserved VLAN numbers on both IOS and NX-OS, the common command is:
show vlan internal usage

Thursday, May 14, 2009

Provide across 3 VLANs, Layer 3 connectivity using a router with single LAN interface (CNA-03-007)

CCNA Exploration 4.0, Semester 3, "Provide across 3 VLANs, Layer 3 connectivity using a router with single LAN interface" Packet Tracer 5.0 practice file (CNA-03-007).




What?! Single one LAN interface to service 3 VLANs? Yes, no problem! We only have to configure it with new commands we have not learned!

Remember that in a trunk connection among switches, we have to "tag" every frame so switches can tell which frame belongs to which VLAN. If a router can also recognize and add the same tags just like switches, we can make this router "virtually" connect to all the VLANs on the switches, and thus providing across VLAN routing, using single physical LAN interface!

We usually call such router a nick name: "Router on a stick". That is, a (LAN) router with only one interface (leg)!

Since VLAN tagging is a hardware functionality, we have to remember in mind that not all routers and not all LAN interface card can support this function: router's LAN interface has to be at least 100Mbps (FastEthernet, in Cisco's term). If your router is bought recently, such as the new ISR (Integrated Service Routers) models, then this requirement is quite enough.

Our "Router on a stick" routes packets among sub-interfaces. Each sub-interface stands for a logical (virtual) interface plugged in a VLAN. The configuration is like this:


interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.100
 encapsulation dot1Q 10
 ip address 172.17.10.1 255.255.255.0
!
interface FastEthernet0/0.200
 encapsulation dot1Q 20
 ip address 172.17.20.1 255.255.255.0
!
interface FastEthernet0/0.300
 encapsulation dot1Q 30
 ip address 172.17.30.1 255.255.255.0
!

The numbers after "encapsulation dot1q 10", "encapsulation dot1q 20", and "encapsulation dot1q 30" are exactly the VLAN's ID number, used in 802.1Q tagging.

However, the number of sub-interface has no special meaning at all. I intentionally choose different sub-interface numbers (100, 200, 300) from VLAN numbers in this example.

We also have to do some configuration on switch side. We have to configure the switch port connected to the router as "Trunk mode". Router needs this to receive and send frames from and to different VLANs.

interface FastEthernet0/11
 switchport mode trunk
!

"Router on a stick" in fact solves one additional problem: scalability. No matter across how many VLANs we have to route packets, we always need only one physical LAN interface!

Consider this then you will see the problem: suppose we have to provide routing among 100 VLANs and without this function, we would be in serious trouble finding a router with 100 LAN interfaces!

Thursday, May 7, 2009

Enable VTP to distribute VLAN information, and provide two Virtual LAN (VLAN), using 3 connected switches (CNA-03-004)

CCNA Exploration 4.0, Semester 3, "Enable VTP to distribute VLAN information, and provide two Virtual LAN (VLAN), using 3 connected switches" Packet Tracer 5.0 practice file (CNA-03-004).




The diagram is in fact the same as the previous example. You must have noticed that it is really bothering to add VLANs on switches one after one. In this case, we are going to make use of a special automatic method by IOS itself: the VTP protocol.

VTP stands for VLAN Trunking Protocol. It is a proprietary protocols among Cisco switches to distribute VLAN information.

Although it is not difficult for you to "peep" at "CoreSwitch"'s configuration in this Packet Tracer file, I wish you do not try it. What I want you to feel is to enable VTP only and then observe "Switch1" and "Switch2" getting VLAN information automatically!

In this case, "Switch1" and "Switch2" can play the VTP role as "Client". That is, it listens VLAN information advertised from the VTP "Server" role switches.

Client Configs:


Switch1(config)#vtp mode client
Switch1(config)#vtp domain ccna
Switch1(config)#

Server Configs:


CoreSwitch(config)#vtp mode server
CoreSwitch(config)#vtp domain ccna
CoreSwitch(config)#

Just like the VLAN information, we cannot see them in the running configuration. We can issue "show vtp status" command to check VTP status.

Switch1:

Switch1#show vtp status
VTP Version                     : 2
Configuration Revision          : 4
Maximum VLANs supported locally : 255
Number of existing VLANs        : 7
VTP Operating Mode              : Client
VTP Domain Name                 : ccna
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x9E 0x49 0xD8 0xC7 0xED 0x7C 0xB2 0x01 
Configuration last modified by 20.1.1.101 at 3-1-93 00:01:58
Switch1#

CoreSwitch:

CoreSwitch#show vtp status
VTP Version                     : 2
Configuration Revision          : 4
Maximum VLANs supported locally : 255
Number of existing VLANs        : 7
VTP Operating Mode              : Server
VTP Domain Name                 : ccna
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x9E 0x49 0xD8 0xC7 0xED 0x7C 0xB2 0x01 
Configuration last modified by 20.1.1.101 at 3-1-93 00:01:58
Local updater ID is 20.1.1.101 on interface Vl1 (lowest numbered VLAN interface found)
CoreSwitch#

Providing two Virtual LAN (VLAN), using 3 connected switches (CNA-03-003)

CCNA Exploration 4.0, Semester 3, "Providing two Virtual LAN (VLAN), using 3 connected switches" Packet Tracer 5.0 practice file (CNA-03-003).




This practice is continued from previous Practice 1 and Practice 2. Essentially, we must configure the two "Inter-switch Links" manually as "Trunk Link".

But that's not enough. One thing I have to point out is we also have to declare VLAN 10 and VLAN 20 in the middle switch: "CoreSwitch". We often forget about this when we implement LAN switching.

Why should we do this? This is because of the design of a hardware switch. It cannot "guess" how many VLANs could be there. Switches only separate and forward frames tagged as certain VLANs when it knows those VLANs exist. If we forget to declare them, then the "CoreSwitch" will not recognize frames tagged as VLAN 10 and VLAN 20, and thus drops all frames of them. We lose connectivity for both VLAN 10 and VLAN 20 in the end.

Then why we do not have to "declare" VLAN 10 and VLAN 20 in previous examples? This is because when we configure some switch port as access link of "VLAN 10", Cisco IOS add "VLAN 10" automatically for us. The same thing happens for VLAN 20, too. However, because we do not configure any switch ports in "CoreSwitch" as neither VLAN 10 nor VLAN 20, we have to declare them by ourselves.

CoreSwitch(config)#vlan 10
CoreSwitch(config-vlan)#exit
CoreSwitch(config)#vlan 20
CoreSwitch(config-vlan)#exit
CoreSwitch(config)#

We cannot know from "running-config" about which VLANs are added. We have to issue "show vlan" command to display the VLANs we successfully declared.


Before we add VLANs:

CoreSwitch#show vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
                                                Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16
                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20
                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24
                                                Gig1/1, Gig1/2
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active    

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        0      0
1002 enet  101002     1500  -      -      -        -    -        0      0
1003 enet  101003     1500  -      -      -        -    -        0      0
1004 enet  101004     1500  -      -      -        -    -        0      0
1005 enet  101005     1500  -      -      -        -    -        0      0

CoreSwitch#



After we declared VLANs, we will see the differences:

CoreSwitch#show vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
                                                Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/13, Fa0/14
                                                Fa0/15, Fa0/16, Fa0/17, Fa0/18
                                                Fa0/19, Fa0/20, Fa0/21, Fa0/22
                                                Fa0/23, Fa0/24, Gig1/1, Gig1/2
10   VLAN0010                         active    
20   VLAN0020                         active    
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active    

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        0      0
10   enet  100010     1500  -      -      -        -    -        0      0
20   enet  100020     1500  -      -      -        -    -        0      0
1002 enet  101002     1500  -      -      -        -    -        0      0
1003 enet  101003     1500  -      -      -        -    -        0      0
1004 enet  101004     1500  -      -      -        -    -        0      0
1005 enet  101005     1500  -      -      -        -    -        0      0

CoreSwitch#

Tuesday, May 5, 2009

Providing two Virtual LAN (VLAN), using 2 connected switches (CNA-03-002)

CCNA Exploration 4.0, Semester 3, "Providing two Virtual LAN (VLAN), using 2 connected switches" Packet Tracer 5.0 practice file (CNA-03-002).




Continuing from previous example, but we add one more switch to do the same thing.

Looking at the only link between the two switches in the diagram, we now have to "mix" frames in the two Virtual LANs (VLANs) going through that link. Of course, if we add up more VLANs, the same link would get more frames belonging to more different VLANs mixing in that link.

Then how can a switch tell which frame belongs to which VLAN? Yes, adding tags on each frame is a great solution! Cisco 2950s and Cisco 2960s support only one type of tagging: IEEE 802.1Q.

If a inter-switch link is mixing frames from different VLANs,  we call it a "Trunk Link". The ports of its both sides are called "Trunk Ports" Just like a real tree, while the "trunk" nourishes branches and leaves, a "trunk link" services several VLANs.

If a switch port is used for one PC or one server only, then we do not have to mix and add tags. These ports are just "normal" Ethernet switch ports without any tagging. We call them "Access Link". The switch ports of its both sides are called "Access Ports".

From the diagram and above discussion, we know we have to configure the only link as "Trunk Link". The simplest way to do so is to "manually" configure both sides of the link into mode "Trunk".

The example is like this:

interface FastEthernet0/11
 switchport mode trunk

The other configuration is just the same as the previous example. You can check the Packet Tracer files yourself!

Popular Posts