17120731091702_upload.png

R1:路由器不要选“Router”。

[R1]display current-configuration 
#
acl number 2001
 rule 5 permit source 192.168.0.0 0.0.255.255
#
interface GigabitEthernet0/0/0
 ip address 203.0.113.2 255.255.255.0
 nat outbound 2001
#
interface GigabitEthernet0/0/1
 ip address 192.168.100.1 255.255.255.0
#
ip route-static 0.0.0.0 0.0.0.0 203.0.113.1
ip route-static 192.168.0.0 255.255.0.0 192.168.100.2

R2:

[Huawei]display current-configuration 
#
interface GigabitEthernet0/0/0
 ip address 203.0.113.1 255.255.255.0
#

S1:

[S1]display current-configuration 
#
vlan batch 2 100 199
#
interface Vlanif2
 ip address 192.168.2.1 255.255.255.0
#
interface Vlanif100
 ip address 192.168.100.2 255.255.255.0
#
interface Vlanif199
 ip address 192.168.199.1 255.255.255.0
#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 100
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 2 100 199
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 2 100 199
#
ip route-static 0.0.0.0 0.0.0.0 192.168.100.1

S2:

[S2]display current-configuration 
#
vlan batch 2 100 199
#
interface Ethernet0/0/1
 port link-type access
 port default vlan 199
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 199
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 100 199

S3:

[S3]display current-configuration 
#
vlan batch 2 100 199
#
interface Ethernet0/0/1
 port link-type access
 port default vlan 2
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 2
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 100 199