Designate a separate VLAN for Layer 2 Switch management

Requirements
  • GNS3
  • Cisco IOS image(c3725-adventerprisek9-mz.124-15.T5 in this example)
  • NM-16ESW switching module for EtherSwitch
Topology

management vlan

PC Setting

On PC1

PC1(config)# no ip routing
PC1(config)# ip default-gateway 192.168.10.254
PC1(config)# interface fastethernet 0/0
PC1(config-if)# ip address 192.168.10.1 255.255.255.0
PC1(config-if)# no shutdown

On PC2

PC2(config)# no ip routing
PC2(config)# ip default-gateway 192.168.20.254
PC2(config)# interface fastethernet 0/0
PC2(config-if)# ip address 192.168.20.1 255.255.255.0
PC2(config-if)# no shutdown
Switch Setting

To simulate a switch on GNS3, disable routing function of the EtherSwitch

SW1#configure terminal
SW1(config)#no ip routing

Add vlan 10(for PC1), 20(for PC2) and 255(managing vlan for switch)

SW1(config)#vlan 10
SW1(config-vlan)#exit
SW1(config)#vlan 20
SW1(config-vlan)#exit
SW1(config)#vlan 255
SW1(config-vlan)#exit

Configure interface 1/1(for PC1) and interface 1/2(for PC2) to access mode while interface 1/0(for R1) to trunk mode

SW1(config)#interface fastEthernet 1/1
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 10
SW1(config-if)#exit
SW1(config)#interface fastEthernet 1/2
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 20
SW1(config-if)#exit
SW1(config)#interface fastEthernet 1/0
SW1(config-if)#switchport mode trunk
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#exit
SW1(config)#interface vlan 255
SW1(config-if)#ip address 192.168.255.1 255.255.255.0
SW1(config-if)#exit
SW1(config)#ip default-gateway 192.168.255.254
SW1(config)#exit

Line VTY configuration

SW1(config)#line vty 0 4
SW1(config-line)#pass
SW1(config-line)#password switch
SW1(config-line)#login
SW1(config-line)#exit
SW1(config)#ip default-gateway 192.168.255.254
SW1(config)#exit

Check vlan setting

SW1#show vlan-switch brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa1/3, Fa1/4, Fa1/5, Fa1/6
                                                Fa1/7, Fa1/8, Fa1/9, Fa1/10
                                                Fa1/11, Fa1/12, Fa1/13, Fa1/14
                                                Fa1/15
10   VLAN0010                         active    Fa1/1
20   VLAN0020                         active    Fa1/2
255  VLAN0255                         active
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup

Finally, save configuration.

SW1#write
Building configuration...
[OK]
Router Setting

First, enable interface 0/0

R1#conf terminal
R1(config)#interface fastEthernet 0/0
R1(config-if)#no shutdown
R1(config-if)#exit

Configure sub-interface for vlan 10

R1(config)#interface fastEthernet 0/0.10
R1(config-subif)#encapsulation dot1Q 10
R1(config-subif)#ip address 192.168.10.254 255.255.255.0
R1(config-subif)#exit

Configure sub-interface for vlan 20

R1(config)#interface fastEthernet 0/0.20
R1(config-subif)#encapsulation dot1Q 20
R1(config-subif)#ip address 192.168.20.254 255.255.255.0
R1(config-subif)#exit

Configure sub-interface for vlan 255

R1(config)#interface fastEthernet 0/0.255
R1(config-subif)#encapsulation dot1Q 255
R1(config-subif)#ip address 192.168.255.254 255.255.255.0
R1(config-subif)#exit

Check interface status

R1#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  up                    up
FastEthernet0/0.10         192.168.10.254  YES manual up                    up
FastEthernet0/0.20         192.168.20.254  YES manual up                    up
FastEthernet0/0.255        192.168.255.254 YES manual up                    up
FastEthernet0/1            unassigned      YES unset  administratively down down

Save change

R1#write
Building configuration...
[OK]
Show Comments