- Configure the IP address and gateway as shown in the figure
- Create Vlan10 and Vlan20 on SW1, SW2, and SW3. The corresponding IP network segments are shown in the figure. The links between switches allow all VLANs to pass through
- Configure VRRP on SW1 and SW2, requiring SW1 to become the main gateway of Vlan10, and SW2 to become the main gateway of Vlan20; SW1 and SW2 are mutually backup
- SW1 and SW2 monitor the uplink interface, if the uplink interface fails, it will trigger VRRP role switching
Problem solving:
1. Omission
2. Create Vlan10 and Vlan20 on SW1, SW2, and SW3. The corresponding IP network segments are shown in the figure. The links between switches allow all VLANs to pass through
SW1
vlan range 10,20 #create vlan10 and vlan20
interface GigabitEthernet 0/1
switchport mode trunk
switchport trunk allowed vlan only 10,20 #Set the link to only allow vlan10 and vlan20 to pass throughSW2
vlan range 10,20
interface GigabitEthernet 0/0
switchport mode trunk
switchport trunk allowed vlan only 10,20SW3
vlan range 10,20
interface GigabitEthernet 0/0
switchport mode trunk #Set to trunk link
switchport trunk allowed vlan only 10,20 #Set the link to only allow vlan10 and vlan20 through
interface GigabitEthernet 0/1
switchport mode trunk
switchport trunk allowed vlan only 10,20
interface GigabitEthernet 0/2
switchport access vlan 10
interface GigabitEthernet 0/3
switchport access vlan 20
3. Configure VRRP on SW1 and SW2, requiring SW1 to become the main gateway of Vlan10, and SW2 to become the main gateway of Vlan20; SW1 and SW2 are mutually backup
SW1
interface VLAN 10
ip address 192.168.1.252 255.255.255.0
vrrp 10 ip 192.168.1.254 #Set the vrrp number to 10, and the virtual IP address to 192.168.1.254
vrrp 10 priority 120 #Set the priority to 120 (default is 100)
inter face vlan 20
ip address 192.168.2.252 255.255.255.0
vrrp 20 ip 192.168.2.254SW2
interface VLAN 10
ip address 192.168.1.253 255.255.255.0
vrrp 10 ip 192.168.1.254
interface VLAN 20
ip address 192.168.2.253 255.255.255.0
vrrp 20 ip 192.168.2.254
vrrp 20 priority 120
Test: Execute the show vrrp brief command on SW1 and SW2 to view the vrrp status
4. SW1 and SW2 monitor the uplink interface, if the uplink interface fails, it will trigger VRRP role switching
SW1
interface VLAN 10
vrrp 10 track GigabitEthernet 0/0 30 #Use track to monitor the uplink, and reduce the priority by 30 when the uplink failsSW2
interface VLAN 20
vrrp 20 track GigabitEthernet 0/1 30
Test: manually shut down the uplink on SW1, you can find that the vrrp master state of vlan10 migrates to backup, and vlan10 on SW2 will become the master state
Execute the show vrrp brief command on SW2
When the uplink interface of SW1 returns to UP, the master state will migrate back