S1配置
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 10
S2配置
interface Vlanif10
ip address 192.168.10.252 255.255.255.0
vrrp vrid 10 virtual-ip 192.168.10.254
vrrp vrid 10 priority 120
vrrp vrid 10 preempt-mode timer delay 20
#
interface Vlanif100
ip address 192.168.100.1 255.255.255.252
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 100
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
ip route-static 0.0.0.0 0.0.0.0 192.168.100.2
S3配置
interface Vlanif10
ip address 192.168.10.253 255.255.255.0
vrrp vrid 10 virtual-ip 192.168.10.254
#
interface Vlanif200
ip address 192.168.200.1 255.255.255.252
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 200
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
ip route-static 0.0.0.0 0.0.0.0 192.168.200.2
R1配置
interface GigabitEthernet0/0/0
ip address 100.1.1.2 255.255.255.252
#
interface GigabitEthernet0/0/1
ip address 192.168.100.2 255.255.255.252
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
ip route-static 192.168.10.0 255.255.255.0 192.168.100.1
ip route-static 192.168.10.0 255.255.255.0 192.168.200.1
![img](https://img-mid.csdnimg.cn/release/static/image/mid/ask/4da3ad93ad3a4931a0e0443cca9a99ba.jpeg "#left")
![img](https://img-mid.csdnimg.cn/release/static/image/mid/ask/8571f3139c874300b20cfdae16562d33.png "#left")