温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

利用三层交换机实现VLAN间路由

发布时间:2020-06-29 15:51:21 阅读:386 作者:r木头人 栏目:网络安全
开发者测试专用服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

步骤1:配置三层交换机的主机名

Ruijie#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Ruijie(config)#hostname switch

步骤2:在三层交换机上划分VLAN添加端口,并设置Trunk

switch(config)#vlan 10

switch(config-vlan)#name xiaoshou

switch(config-vlan)#vlan 20

switch(config-vlan)#name jishu

switch(config-vlan)#exit

switch(config)#int range fa0/6-10

switch(config-if-range)#sw mode acc

switch(config-if-range)#sw acc vlan 10

switch(config-if-range)#exit

switch(config)#int range fa0/11-15

switch(config-if-range)#sw acc vlan 20

switch(config-if-range)#exit添加

switch(config)#int fa 0/1

switch(config-if-FastEthernet 0/1)#sw mode trunk

switch(config-if-FastEthernet 0/1)#exit

switch(config)#exit

步骤3:查看VLAN

switch#show vlan

利用三层交换机实现VLAN间路由

步骤4:在三层交换机上配置SVI端口

switch#conf t

Enter configuration commands, one perline.  End with CNTL/Z.

switch(config)#interface vlan 10

switch(config-if-VLAN 10)#Dec

% Unknown command.

 

switch(config-if-VLAN 10)#ip add192.168.10.1 255.255.255.0

switch(config-if-VLAN 10)#no shutdown

switch(config-if-VLAN 10)#exit

switch(config)#int vlan 20

switch(config-if-VLAN 20)#ip add192.168.20.1 255.255.255.0

switch(config-if-VLAN 20)#no shutdown

switch(config-if-VLAN 20)#exit

switch(config)#exit

switch#*Sep 27 17:27:07: %SYS-5-CONFIG_I:Configured from console by conso

步骤5:验证配置

PC1PC2分别配置192.168.10.0/24192.168.20.0/24网段内的IP地址,并分别以192.168.10.1192.168.20.1作为网关,例如PC1IP地址配置为,如图所示

利用三层交换机实现VLAN间路由

此时再从PC1ping不同VLAN的主机PC2是可以ping通的,如图所示

利用三层交换机实现VLAN间路由


亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI

开发者交流群×