华为ENSP路由+交换机实验配置
一、拓扑图
配置要求:
- PC1 和 PC3 能 Ping 通 PC5
- PC2 能 Ping 通 PC4
- PC6 能 Ping 通 PC4,但是不能Ping 通 PC2
小小构思:
二、主机配置
PC1
PC2
PC3
PC4
PC5
PC6
三、交换机与路由器运行代码
SW1
sysname SW1
undo info-center enable
vlan batch 10 20
interface Ethernet0/0/1
port link-type access
port default vlan 10
#
interface Ethernet0/0/2
port link-type access
port default vlan 20
#
interface Ethernet0/0/3
port link-type access
port default vlan 10
#
interface Ethernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/5
port link-type access
port default vlan 20
SW2
sysname SW2
undo info-center enable
vlan batch 10 20
#
interface Ethernet0/0/1
port link-type access
port default vlan 20
#
interface Ethernet0/0/2
port link-type access
port default vlan 10
#
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
R1
sysname R1
undo info-center enable
#
interface GigabitEthernet0/0/0
ip address 192.168.20.1 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 10.0.0.1 255.255.255.0
#
ip route-static 192.168.60.0 255.255.255.0 10.0.0.2
R2
<R2>sys
[R2]dis cu
sysname R2
undo info-center enable
#
interface GigabitEthernet0/0/0
ip address 10.0.0.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.60.1 255.255.255.0
#
ip route-static 192.168.0.0 255.255.0.0 10.0.0.1