1、内网IP地址使用172.16.0.0/16分配2、sW1和sw2之间互为备份3、VRRP/STP/VLAN/Eth-trunk均使用4、所有pc均通过oHcP获取IP地址5、ISP只能配置IP地址6、所有电脑可以正常访问IsP路由器环回注以下并非ensp内容原实验配置较为混乱补全错误由AI做整理。SW1system-view sysname sw1 vlan batch 2 3 10 20 interface Eth-Trunk 0 trunkport GigabitEthernet 0/0/1 to 0/0/2 port link-type trunk port trunk allow-pass vlan 2 3 10 20 quit port-group group-member GigabitEthernet 0/0/3 to GigabitEthernet 0/0/4 port link-type trunk port trunk allow-pass vlan 2 3 quit interface GigabitEthernet 0/0/5 port link-type access port default vlan 10 quit stp enable stp mode mstp stp region-configuration region-name aa instance 1 vlan 2 instance 2 vlan 3 active region-configuration quit stp instance 1 root primary interface Vlanif 2 ip address 172.16.0.1 255.255.255.192 vrrp vrid 1 virtual-ip 172.16.0.62 vrrp vrid 1 priority 120 vrrp vrid 1 track interface GigabitEthernet 0/0/5 reduced 30 quit interface Vlanif 3 ip address 172.16.0.65 255.255.255.192 vrrp vrid 2 virtual-ip 172.16.0.126 quit dhcp enable ip pool aa network 172.16.0.0 mask 255.255.255.192 gateway-list 172.16.0.62 dns-list 8.8.8.8 quit ip pool bb network 172.16.0.64 mask 255.255.255.192 gateway-list 172.16.0.126 dns-list 8.8.8.8 quit interface Vlanif 2 dhcp select global quit interface Vlanif 3 dhcp select global quit interface Vlanif 10 ip address 172.16.0.129 255.255.255.192 quit ip route-static 0.0.0.0 0.0.0.0 172.16.0.130 returnSW2system-view sysname sw2 vlan batch 2 3 10 20 interface Eth-Trunk 0 trunkport GigabitEthernet 0/0/1 to 0/0/2 port link-type trunk port trunk allow-pass vlan 2 3 10 20 quit port-group group-member GigabitEthernet 0/0/3 to GigabitEthernet 0/0/4 port link-type trunk port trunk allow-pass vlan 2 3 quit interface GigabitEthernet 0/0/5 port link-type access port default vlan 20 quit stp enable stp mode mstp stp region-configuration region-name aa instance 1 vlan 2 instance 2 vlan 3 active region-configuration quit stp instance 1 root secondary stp instance 2 root primary interface Vlanif 2 ip address 172.16.0.2 255.255.255.192 vrrp vrid 1 virtual-ip 172.16.0.62 quit interface Vlanif 3 ip address 172.16.0.66 255.255.255.192 vrrp vrid 2 virtual-ip 172.16.0.126 vrrp vrid 2 priority 120 vrrp vrid 2 track interface GigabitEthernet 0/0/5 reduced 30 quit dhcp enable ip pool aa network 172.16.0.0 mask 255.255.255.192 gateway-list 172.16.0.62 dns-list 8.8.8.8 quit ip pool bb network 172.16.0.64 mask 255.255.255.192 gateway-list 172.16.0.126 dns-list 8.8.8.8 quit interface Vlanif 2 dhcp select global quit interface Vlanif 3 dhcp select global quit interface Vlanif 20 ip address 172.16.0.193 255.255.255.192 quit ip route-static 0.0.0.0 0.0.0.0 172.16.0.194 returnSW3system-view sysname sw3 vlan batch 2 3 interface GigabitEthernet 0/0/3 port link-type access port default vlan 2 quit interface GigabitEthernet 0/0/4 port link-type access port default vlan 3 quit port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/2 port link-type trunk port trunk allow-pass vlan 2 3 quit stp enable stp mode mstp stp region-configuration region-name aa instance 1 vlan 2 instance 2 vlan 3 active region-configuration quit port-group group-member GigabitEthernet 0/0/3 to GigabitEthernet 0/0/4 stp edged-port enable quit stp bpdu-protection returnSW4system-view sysname sw4 vlan batch 2 3 interface GigabitEthernet 0/0/3 port link-type access port default vlan 2 quit interface GigabitEthernet 0/0/4 port link-type access port default vlan 3 quit port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/2 port link-type trunk port trunk allow-pass vlan 2 3 quit stp enable stp mode mstp stp region-configuration region-name aa instance 1 vlan 2 instance 2 vlan 3 active region-configuration quit port-group group-member GigabitEthernet 0/0/3 to GigabitEthernet 0/0/4 stp edged-port enable quit stp bpdu-protection returnR1system-view sysname r1 interface GigabitEthernet 0/0/1 ip address 172.16.0.130 255.255.255.192 quit interface GigabitEthernet 0/0/0 ip address 172.16.0.194 255.255.255.192 quit interface GigabitEthernet 0/0/2 ip address 12.0.0.1 255.255.255.0 quit ip route-static 172.16.0.0 255.255.255.192 172.16.0.129 ip route-static 172.16.0.0 255.255.255.192 172.16.0.193 ip route-static 172.16.0.64 255.255.255.192 172.16.0.193 ip route-static 172.16.0.64 255.255.255.192 172.16.0.129 ip route-static 0.0.0.0 0.0.0.0 12.0.0.2 acl 2000 rule permit source 172.16.0.0 0.0.255.255 quit interface GigabitEthernet 0/0/2 nat outbound 2000 quit returnISP测试