您的位置:首页 > 其它

CISCO 配置实验 --Trunk

2010-07-22 14:16 267 查看
实验拓扑[/b]


[/b]
实验目的:[/b][/b]
三台交换机配置三个VLAN命名为:VLAN10、VLAN20、VLAN30
配置f0/5-9为VLAN 10
配置f0/10-14为VLAN 20
配置f0/15-20为VLAN 30
配置第一台交换机[/b][/b]
Switch>en
Switch#vlan database
Switch(vlan)#vlan 2 name vlan10
Switch(vlan)#vlan 3 name vlan20
Switch(vlan)#vlan 4 name vlan30
Switch(vlan)#exit
Switch#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname sw1
sw1(config)#interface range fastEthernet 0/5 -9
sw1(config-if-range)#switchport mode access
sw1(config-if-range)#switchport access vlan 2
sw1(config)#interface range fastEthernet 0/10 -14
sw1(config-if-range)#switchport mode access
sw1(config-if-range)#switchport access vlan 3
sw1(config)#interface range fastEthernet 0/15 -20
sw1(config-if-range)#switchport mode access
sw1(config-if-range)#switchport access vlan 4
配置第二台交换机[/b][/b]
Switch>en
Switch#vlan database
Switch(vlan)#vlan 2 name vlan10
Switch(vlan)#vlan 3 name vlan20
Switch(vlan)#vlan 4 name vlan30
Switch(vlan)#exit
Switch#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname sw2
sw2(config)#interface range fastEthernet 0/5 -9
sw2(config-if-range)#switchport mode access
sw2(config-if-range)#switchport access vlan 2
sw2(config-if-range)#exit
sw2(config)#interface range fastEthernet 0/10 -14
sw2(config-if-range)#switchport mode access
sw2(config-if-range)#switchport access vlan 3
sw2(config-if-range)#exi
sw2(config)#interface range fastEthernet 0/15 -20
sw2(config-if-range)#switchport mode access
sw2(config-if-range)#switchport access vlan 4
配置第三台交换机[/b][/b]
Switch>en
Switch#vlan database
Switch(vlan)#vlan 2 name vlan10
Switch(vlan)#vlan 3 name vlan20
Switch(vlan)#vlan 4 name vlan30
Switch(vlan)#exit
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname sw3
Sw4(config)#interface range fastEthernet 0/5 -9
Sw4(config-if-range)#switchport mode access
Sw4(config-if-range)#switchport access vlan 2
Sw4(config-if-range)#exit
Sw4(config)#interface range fastEthernet 0/10 -14
Sw4(config-if-range)#switchport mode access
Sw4(config-if-range)#switchport access vlan 3
Sw4(config-if-range)#exi
Sw4(config)#interface range fastEthernet 0/15 -20
Sw4(config-if-range)#switchport mode access
Sw4(config-if-range)#switchport access vlan 4

配置汇聚链路[/b][/b]
sw1(config)#interface fastEthernet 0/1
sw1(config-if)#switchport mode trunk

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

sw2(config)#interface fastEthernet 0/2
sw2(config-if)#switchport mode trunk

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up
验证配置:[/b][/b]
可以利用以下命令验证端口是否启用汇聚
sw1#show interfaces fastEthernet 0/1 switchport
Name: Fa0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk

sw2#show interfaces fastEthernet 0/1 switchport
Name: Fa0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
实验结果:[/b][/b]
PC1能够PING通PC4和PC7其余不能PINNG通,因为他们都属于VLAN 1
PC2能够PING通PC5和PC8其余不能PINNG通,因为他们都属于VLAN 2
PC3能够PING通PC6和PC9其余不能PINNG通,因为他们都属于VLAN 3
本文出自 “静&贤” 博客,请务必保留此出处http://hjtyqs.blog.51cto.com/303382/355130
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: