VRRP on sub-interfaces
It is no problem to run Virtual Router Redundancy Protocol (VRRP) on sub-interfaces. There will be no conflict between the VRRP instances.
Configuration
Here is a sample configuration of two routers with two sub-interfaces:
R1# interface GigabitEthernet0/0 no ip address duplex auto speed auto media-type rj45 ! interface GigabitEthernet0/0.10 encapsulation dot1Q 10 ip address 192.168.10.1 255.255.255.0 vrrp 10 ip 192.168.10.254 ! interface GigabitEthernet0/0.20 encapsulation dot1Q 20 ip address 192.168.20.1 255.255.255.0 vrrp 20 ip 192.168.20.254
R2# interface GigabitEthernet0/0 no ip address duplex auto speed auto media-type rj45 ! interface GigabitEthernet0/0.10 encapsulation dot1Q 10 ip address 192.168.10.2 255.255.255.0 vrrp 10 ip 192.168.10.254 ! interface GigabitEthernet0/0.20 encapsulation dot1Q 20 ip address 192.168.20.2 255.255.255.0 vrrp 20 ip 192.168.20.254
Verification
Here is R1:
R1#show vrrp GigabitEthernet0/0.10 - Group 10 State is Backup Virtual IP address is 192.168.10.254 Virtual MAC address is 0000.5e00.010a Advertisement interval is 1.000 sec Preemption enabled Priority is 100 Master Router is 192.168.10.2, priority is 100 Master Advertisement interval is 1.000 sec Master Down interval is 3.609 sec (expires in 3.060 sec) GigabitEthernet0/0.20 - Group 20 State is Backup Virtual IP address is 192.168.20.254 Virtual MAC address is 0000.5e00.0114 Advertisement interval is 1.000 sec Preemption enabled Priority is 100 Master Router is 192.168.20.2, priority is 100 Master Advertisement interval is 1.000 sec Master Down interval is 3.609 sec (expires in 3.145 sec)
And R2:
R2#show vrrp GigabitEthernet0/0.20 - Group 20 State is Master Virtual IP address is 192.168.20.254 Virtual MAC address is 0000.5e00.0114 Advertisement interval is 1.000 sec Preemption enabled Priority is 100 Master Router is 192.168.20.2 (local), priority is 100 Master Advertisement interval is 1.000 sec Master Down interval is 3.609 sec GigabitEthernet0/0.10 - Group 10 State is Master Virtual IP address is 192.168.10.254 Virtual MAC address is 0000.5e00.010a Advertisement interval is 1.000 sec Preemption enabled Priority is 100 Master Router is 192.168.10.2 (local), priority is 100 Master Advertisement interval is 1.000 sec Master Down interval is 3.609 sec