利用三层交换机vlan间通信
分类:网络技术日期:2010-11-20 - 16:02:24评论:1条作者:老谢
首先在交换机上配置vlan
配置过程如下
Switch>en
Switch#conf termi
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 2
Switch(config-vlan)#exit
Switch(config)#vlan 3
Switch(config-vlan)#exit
Switch(config)#int fa 0/2
Switch(config-if)#sw access vlan 2
Switch(config-if)#int fa 0/3
Switch(config-if)#sw access vlan 2
Switch(config-if)#int fa 0/4
Switch(config-if)#sw access vlan 3
Switch(config-if)#int fa 0/5
Switch(config-if)#sw access vlan 3
Switch(config-if)#int fa 0/1
Switch(config-if)#sw 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
Switch(config-if)#no shutdown
我们现在分别ping一下看看
vlan2内的192.168.1.3可以ping通
vlan3的192.168.2.2掉包
我们开始配置路由器
Switch>enable
Switch#conf terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 2
Switch(config-vlan)#exit
Switch(config)#vlan 3
Switch(config-vlan)#exit
Switch(config)#int fa 0/1
Switch(config-if)#sw mode trunk
Switch(config-if)#no shutdown
Switch(config-if)#int vlan 2
%LINK-5-CHANGED: Interface Vlan2, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to upSwitch(config-if)#ip address 192.168.1.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#int vlan3
%LINK-5-CHANGED: Interface Vlan3, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan3, changed state to upSwitch(config-if)#ip add 192.168.2.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#end
配置完毕,我们可以show下路由表
下面我们ping试试看
vlan2和vlan3已经可以正常通信
最新评论
zwwooooo:买特斯拉和买iPhone的人群其实相似...
平安家属子痕:一直坚持油车,看你写的心里有...
秦大叔:室内每年能开2万公里电车确实划算 ...
灰常记忆:尊贵的特斯拉车主啊,对了一直对单...
拳废神域界:我的车现在平常跑不了啥,就放假...
大峰:电车起步超级快,我油车反正是跟不上,...
Mr.Chou:电车高速上真120和油车120真的有区...
Mr.Chou:18 19年入手的房子现在死的心都有了...
老何:不至于跌得这么狠吧
Andy烧麦:这些大厂都能提供必要的售后