结合以太通道的VLAN配置

实验要求:建立一条以太通道,并划分vlan,让同一vlan的主机能够通信,不同vlan的主机则不能通信

拓扑如下:

涉及内容有:

1.以太通道的建立和配置

2.vlan的创建和划分

 

配置如下:

A

enable  进入特权模式

configure terminal   进入全局模式

interface port-channel 5  创建以太通道

switchport trunk encapsulation  将通道进行封装

switchport mode trunk  将通道修改为trunk模式  

exit   返回上一级

interface range f0/20-21  进入端口

channel-group 5 mode on  将端口划分到通道中

exit  返回上一级

vlan 10  创建vlan10

vlan 20  创建vlan20

interface f0/1  进入端口

switchport mode access  将端口模式修改为access

switchport access vlan 10  将端口划分到vlan10

interface f0/2  进入端口

switchport mode access  将端口模式修改为access

switchport access vlan 20  将端口划分到vlan20

end  返回特权模式

copy running-config startup-config   保存

 

B

enable  进入特权模式

configure terminal   进入全局模式

interface port-channel 5  创建以太通道

switchport trunk encapsulation  将通道进行封装

switchport mode trunk  将通道修改为trunk模式  

exit   返回上一级

interface range f0/20-21  进入端口

channel-group 5 mode on  将端口划分到通道中

exit  返回上一级

vlan 10  创建vlan10

vlan 20  创建vlan20

interface f0/1  进入端口

switchport mode access  将端口模式修改为access

switchport access vlan 10  将端口划分到vlan10

interface f0/2  进入端口

switchport mode access  将端口模式修改为access

switchport access vlan 20  将端口划分到vlan20

end  返回特权模式

copy running-config startup-config   保存

posted on 2018-06-13 15:27  学不动了呀~~~~  阅读(163)  评论(0编辑  收藏  举报