??给局域网的设计增加了灵活性,使管理员在划分工作组时,不再受限于用户所在的物理位置。具有灵活性和可扩展性等特点,还有以下好处:
静态VLAN:基于端口的VLAN,是目前常见的实现方式
动态VLAN:基于MAC地址的动态VLAN
trunk的作用:为了实现不同交换机上的相同VLAN之间的通信。
在交换网络中,有两种类型链路:接入链路和中继链路。
接入链路:通常属于一个VLAN,客户机与交换机之间的链路就是接入链路;
中继链路:可以承载多个VLAN,交换机与交换机之间的链路为中继链路实现承载多条VLAN通信;
通过捆绑多条以太链路来进行提高带宽,并运行一种机制将多条物理链路捆绑成一条逻辑链路。
以太网通道遵循以下规则:
GNS 3
SW1>en
SW1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)#no ip routing #关闭路由
SW1(config)#vlan 10,20 #创建vlan10,vlan20
SW1(config-vlan)#ex
SW1(config)#int f1/0
SW1(config-if)#sw mo acc
SW1(config-if)#sw acc vlan 10 #将接口加入vlan10
SW1(config-if)#ex
SW1(config)#int f1/1
SW1(config-if)#sw mo acc
SW1(config-if)#sw acc vlan 20 #将接口加入vlan20
SW1(config-if)#ex
SW1(config)#int f1/2
SW1(config-if)#sw mo tr
SW1(config-if)#sw tr en dot1q #该接口封装协议dot1q
SW1(config-if)#ex
SW1(config)#int f1/3
SW1(config-if)#sw mo tr
SW1(config-if)#sw tr en dot1q #该接口封装协议dot1q
SW1(config-if)#ex
SW1(config)#int rang f1/2 - 3
SW1(config-if-range)#channel-group 1 mode on #建立以太网通道
Creating a port-channel interface Port-channel1
SW1(config-if-range)#
*Mar 1 00:07:38.235: %EC-5-BUNDLE: Interface Fa1/2 joined port-channel Po1
*Mar 1 00:07:38.295: %EC-5-BUNDLE: Interface Fa1/3 joined port-channel Po1
SW1(config-if-range)#end
SW1#
*Mar 1 00:07:41.195: %LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to up
SW1#
*Mar 1 00:07:42.655: %SYS-5-CONFIG_I: Configured from console by console
SW1#show etherchannel 1 summary #查看以太网通道
Flags: D - down P - in port-channel
I - stand-alone s - suspended
R - Layer3 S - Layer2
U - in use
Group Port-channel Ports
-----+------------+-----------------------------------------------------------
1 Po1(SU) Fa1/2(P) Fa1/3(P)
SW2>en
SW2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW2(config)#no ip routing #关闭路由
SW2(config)#vlan 10,20 #创建vlan10,vlan20
SW2(config-vlan)#ex
SW2(config)#int f1/0
SW2(config-if)#sw mo acc
SW2(config-if)#sw acc vlan 10 #将接口加入vlan10
SW2(config-if)#ex
SW2(config)#int f1/1
SW2(config-if)#sw mo acc
SW2(config-if)#sw acc vlan 20 #将接口加入vlan20
SW2(config-if)#ex
SW2(config)#int f1/2
SW2(config-if)#sw mo tr
*Mar 1 00:09:15.299: %DTP-5-TRUNKPORTON: Port Fa1/2 has become dot1q trunk
SW2(config-if)#sw tr en dot1q #该接口封装协议dot1q
SW2(config-if)#ex
SW2(config)#int f1/3
SW2(config-if)#sw mo tr
*Mar 1 00:09:31.679: %DTP-5-TRUNKPORTON: Port Fa1/3 has become dot1q trunk
SW2(config-if)#sw tr en dot1q #该接口封装协议dot1q
SW2(config-if)#ex
SW2(config)#channel
SW2(config)#int rang f1/2 - 3
SW2(config-if-range)#channel-group 1 mode on #建立以太网通道
Creating a port-channel interface Port-channel1
*Mar 1 00:10:03.419: %EC-5-BUNDLE: Interface Fa1/2 joined port-channel Po1
*Mar 1 00:10:03.475: %EC-5-BUNDLE: Interface Fa1/3 joined port-channel Po1
SW2(config-if-range)#end
SW2#
*Mar 1 00:10:06.391: %LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to up
*Mar 1 00:10:06.775: %SYS-5-CONFIG_I: Configured from console by console
SW2#show etherchannel 1 summary #查看以太网通道
Flags: D - down P - in port-channel
I - stand-alone s - suspended
R - Layer3 S - Layer2
U - in use
Group Port-channel Ports
-----+------------+-----------------------------------------------------------
1 Po1(SU) Fa1/2(P) Fa1/3(P)
原文地址:http://blog.51cto.com/10316297/2112022