eNSP模拟器-静态路由

eNSP模拟器-静态路由

【引言】

配置VLANIF 接口,实现三层转发。 

【代码】

[core]
system-view
sysname core
vlan batch 20 30
interface vlanif 20
ip address 192.168.3.1 255.255.255.0
interface vlanif 30
ip address 192.168.2.2 255.255.255.0
interface gigabitethernet 0/0/1
port link-type trunk
port trunk allow-pass vlan 30
interface gigabitethernet 0/0/2
port link-type trunk
port trunk allow-pass vlan 20
quit
ip route-static 192.168.1.0 255.255.255.0 192.168.2.1

[acc1]
system-view
sysname acc1
vlan 10
interface ethernet 0/0/1
port link-type trunk
port trunk allow-pass vlan 10
interface ethernet 0/0/2
port link-type access
port default vlan 10

[agg]
system-view
sysname agg
vlan batch 10 30
interface vlanif 10
ip address 192.168.1.1 255.255.255.0
interface vlanif 30
ip address 192.168.2.1 255.255.255.0
interface gigabitethernet 0/0/1
port link-type trunk
port trunk allow-pass vlan 30
interface gigabitethernet 0/0/2
port link-type trunk
port trunk allow-pass vlan 10
quit
ip route-static 192.168.3.0  255.255.255.0 192.168.2.2 
//所有要去192.168.3.0网段的,全部从192.168.2.2出,而不能从192.168.2.1出。

[acc2]
system-view
sysname acc2
vlan 20
interface ethernet 0/0/1
port link-type trunk
port trunk allow-pass vlan 20
interface ethernet 0/0/2
port link-type access
port default vlan 20

【结果】

1.png

2.png


回复列表



回复操作

正在加载验证码......

请先拖动验证码到相应位置

发布时间:2020-11-03 21:31:10

修改时间:2020-11-03 21:34:12

查看次数:45

评论次数:0