eNSP---单臂路由

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                          //进入配置

int eth0/0/0.1                    //进入子接口

dot1q termination vid 2            //封装dot1q协议,并将接口加入VLAN 2

ip address 192.168.1.1 255.255.255.0 //设置子接口IP地址和子网掩码

arp broadcast enable              //开启子接口的ARP广播

quit                            //退出接口

int eth0/0/0.2                    //进入子接口

dot1q termination vid 3           //封装dot1q协议,并将接口加入VLAN 2

ip address 192.168.2.1 255.255.255.0  //设置子接口IP地址和子网掩码

arp broadcast enable              //开启子接口的ARP广播

quit                            //退出接口

5.测试PC1(VLAN2 192.168.1.2)ping PC4(VLAN3 192.168.2.3)

https://www.lanzous.com/i3l85vi

猜你喜欢

转载自blog.csdn.net/qq_40163937/article/details/88885231