交换机专题2( 四 )


remove remove VLANs from the current list
6-3512xl(config-if)#switchport multi vlan 1,2,3
!-- VLANs 1, 2, and 3 are assigned to multi-VLAN port Fa0/1.
6-3512xl(config-if)#^Z
6-3512xl#
Step 3: Verify the configuration by issuing the show vlan and show interfaceswitchport commands.
6-3512xl#show interface fa0/1 switchport
Name: Fa0/1
Operational Mode: multi
!-- The port is in multi-VLAN mode.
Administrative Trunking Encapsulation: isl
Operational Trunking Encapsulation: isl
Negotiation of Trunking: Disabled
Access Mode VLAN: 0 ((Inactive))
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: NONE
Pruning VLANs Enabled: NONE
Priority for untagged frames: 0
Override vlan tag priority: FALSE
Voice VLAN: none
Appliance trust: none
6-3512xl#
6-3512xl#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/3, Fa0/6, Fa0/7,
Fa0/8, Fa0/9, Fa0/10, Fa0/1
Fa0/12, Gi0/1, Gi0/2
2 VLAN0002 active Fa0/1, Fa0/2, Fa0/4
!-- Note that previously, port Fa0/1 was only in VLAN 1, now it"s assigned to multiple VLANs, 1, 2, and 3.
3 VLAN0003 active Fa0/1, Fa0/5
4 VLAN0004 active
5 VLAN0005 active
Step 4: You can verify the multi-VLAN operation by issuing the ping command from switch to router. The ping command should get a reply from the router every time the management IP address is assigned to any of the VLANs 1, 2, or 3.
6-3512xl#configure t
Enter configuration commands, one per line. End with CNTL/Z.
6-3512xl(config)#int vlan 1
6-3512xl(config-if)#ip address 192.168.1.1 255.255.255.0
!-- The management IP address is assigned to VLAN 1.
6-3512xl(config-if)#^Z
6-3512xl#
23:56:54: %SYS-5-CONFIG_I: Configured from console by console
6-3512xl#ping 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
SUCcess rate is 100 percent (5/5), round-trip min/avg/max = 1/2/3 ms
6-3512xl#ping 192.168.1.2
!-- You can ping the router from VLAN 1.
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/3 ms
6-3512xl#
6-3512xl#configure t
Enter configuration commands, one per line. End with CNTL/Z.
6-3512xl(config)#int vlan 1
6-3512xl(config-if)#no ip address
!
-- The management IP address is removed from VLAN 1.
6-3512xl(config-if)#shutdown
6-3512xl(config-if)#exit
6-3512xl(config)#int vlan 2
6-3512xl(config-subif)#ip address 192.168.1.1 255.255.255.0
6-3512xl(config-subif)#no shutdown
!-- The management IP address is assigned to VLAN 2.
6-3512xl(config-subif)#exit
6-3512xl(config)#exit
6-3512xl#ping 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/3 ms
6-3512xl#ping 192.168.1.2
!-- We can ping the router from VLAN 2.
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/202/1004 ms
6-3512xl#
6-3512xl#configure t
Enter configuration commands, one per line. End with CNTL/Z.
6-3512xl(config)#int vlan 2
6-3512xl(config-subif)#no ip address
!-- The management IP address is removed from VLAN 2.
6-3512xl(config-subif)#shutdown
6-3512xl(config-subif)#exit
6-3512xl(config)#int vlan 3

推荐阅读