eNSP---三层交换机实现VLAN间路由

1.配置主机ip、子网掩码及网关

PC1:192.168.1.2   255.255.255.0    192.168.1.1

PC2:192.168.2.2   255.255.255.0    192.168.2.1

PC3:192.168.1.3   255.255.255.0    192.168.1.1

PC4:192.168.2.3   255.255.255.0    192.168.2.1

2.设置交换机接主机VLAN(左右交换机同样配置)

system                          //进入配置

vlan batch 2 3                    //创建VLAN 2 3

int eth0/0/1                      //进入连接PC1端口

port link-type access              //设置端口类型为access

port default vlan 2                //将接口添加到VLAN 2中

quit                            //退出接口

int eth0/0/2                      //进入连接PC1端口

port link-type access              //设置端口类型为access

port default vlan 3                //将接口添加到VLAN 2中

quit                            //退出接口

int eth0/0/3                     //进入交换机互联端口

port link-type trunk              //设置端口类型为trunk

port trunk allow-pass vlan all      //配置为VLAN全通模式

quit                            //退出接口

quit                            //退出配置模式

save                            //保存配置

y+回车                          //保存

3.设置交换机连接三层交换机eth0/0/4接口(左右接口同样配置)

system                          //进入配置

int eth0/0/4                      //进入交换机连接路由器端口

port link-type trunk              //设置端口类型为trunk

port trunk allow-pass vlan all      //配置为VLAN全通模式

quit                            //退出接口

quit                            //退出配置模式

save                            //保存配置

y+回车                          //保存

4.设置三层交换机

system                          //进入配置

vlan batch 2 3                    //创建VLAN 2 3

int eth0/0/1                    //进入接口

port link-type trunk              //设置端口类型为trunk

port trunk allow-pass vlan all      //配置为VLAN全通模式

quit                            //退出接口

int eth0/0/2                    //进入接口

port link-type trunk              //设置端口类型为trunk

port trunk allow-pass vlan all      //配置为VLAN全通模式

quit                            //退出接口

int vlan 2                        //进入vlan2进行配置

ip address 192.168.1.1 255.255.255.0 //设置vlan2IP地址和子网掩码

quit                            //退出接口

int vlan 3                        //进入vlan3进行配置

ip address 192.168.2.1 255.255.255.0 //设置vlan3IP地址和子网掩码

quit                            //退出接口

quit                            //退出配置

save                            //保存

5.测试PC2(VLAN3 192.168.2.2)ping PC3(VLAN2 192.168.1.3)

https://www.lanzous.com/i3l8pxa

 

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值