利用三层交换机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:类似以前做网站开发时,一开始有自...
老陳网志:有点高端,像我们整点nas玩玩就够...
springwood:自从 CentOS 不维护之后,我换 U...
大D:难都搞下来了,那就更得YM了
大D:只能是YM了,谢总牛啊
灰常记忆:经济不好 今年我也换了机器 一...
大峰:这是海外服务器嘛?速度挺快的。
大D:只能单走一个6了哈哈哈
zwwooooo:买特斯拉和买iPhone的人群其实相似...
平安家属子痕:一直坚持油车,看你写的心里有...