1,内网IP地址使用172.16.0.0/16分配
2,sw1和sw2之间互为备份
3,VRRP/STP/VLAN/Eth-trunk均使用
4,所有PC均通过DHCP获取IP地址
5,ISP只能配置IP地址
6,所有电脑可以正常访问ISP路由器环回
R2 LoopBack0 1.1.1.1/24
G0/0/0 12.1.1.2/24
R1 G0/0/0 172.16.0.2/30
G0/0/1 12.1.1.1/24
G0/0/2 172.16.0.6/30
SW1 SVI 1 172.16.1.1/25
SVI 2 172.16.1.129/25
VRRP 172.16.126
SVI 100 172.16.0.1/30
SW2 VI 1 172.16.1.2/25
SVI 2 172.16.1.130/25
VRRP 172.16.1.254
SVI 100 172.16.0.5/30
vlan 2
q
1
2
SW2
vlan 2
q
1
2
SW3
vlan 2
q
int e0/0/2
port link-type access
port default vlan 2
1
2
3
4
5
SW4
vlan 2
q
int e0/0/2
port link-type access
port default vlan 2
sw1
sw2
sw3
sw4
配置DHCP
sw1
int Vlanif 1
ip add 172.16.1.1 25
int vlan 2
ip add 172.16.1.129 25
q
int Vlanif 1
vrrp vrid 1 virtual-ip 172.16.1.126 #创建虚拟IP 172.16.1.126
vrrp vrid 1 priority 120 #调整优先级为120
vrrp vrid 1 track interface GigabitEthernet 0/0/1 reduced 30
#上行链路追踪,上链路出现问题,优先级下调30
int Vlanif 2
vrrp vrid 1 virtual-ip 172.16.1.254 #作为vlan2 的备份
sw2
int Vlanif 1
ip add 172.16.1.2 25
int vlan 2
ip add 172.16.1.130 25
q
int Vlanif 1
vrrp vrid 1 virtual-ip 172.16.1.126
int Vlanif 2
vrrp vrid 1 virtual-ip 172.16.1.254
vrrp vrid 1 priority 120
vrrp vrid 1 track interface GigabitEthernet 0/0/1 reduced 30
dhcp enable
ip pool g1
network 172.16.1.0 mask 25
gateway-list 172.16.1.126
dns-list 8.8.8.8
q
ip pool g2
network 172.16.1.128 mask 25
gateway-list 172.16.1.254
dns-list 8.8.8.8
q
int Vlanif 1
dhcp select global
int vlan 2
dhcp select global
sw2
dhcp enable
ip pool g1
network 172.16.1.0 mask 25
gateway-list 172.16.1.126
dns-list 8.8.8.8
q
ip pool g2
network 172.16.1.128 mask 25
gateway-list 172.16.1.254
dns-list 8.8.8.8
q
int Vlanif 1
dhcp select global
int vlan 2
dhcp select global