VRRP (Virtual Router Redundancy Protocol)

Hi Ivaylo,
The short answer to your question is that you will need a separate VRRP instance for each vlan that you want to have a highly available gateway.

I have attached a new topology to discuss this. In it, you will see that Computers A and B are in different VLANs (A and B). Switch A and Switch B are both connected to the access-layer Switch C. Note: These connections must be configured as trunks, let’s say the modern 802.1Q standard with both VLAN A and VLAN B allowed. Additionally, it would be a good idea to have Switch A and Switch B directly connected to each other (in the real world this is done with Etherchannel), and that connection must also be a trunk that allows all VLANs between them.

At this point, you are ready to configure Switch A and Switch B. Each will need an SVI (switched virtual interface) for both VLAN A and VLAN B. You would treat these SVIs just like regular interfaces–just think of them as the Switch’s presence in the VLAN in question. Here’s a sample of getting the config going for Switch A:

SwitchA(config)#interface vlan A
SwitchA(config-if)#ip address 192.168.1.252 255.255.255.0
SwitchA(config-if)#vrrp 1 ip 192.168.1.254
SwitchA(config-if)#vrrp 1 priority 105
SwitchA(config-if)#interface vlan B
SwitchA(config-if)#ip address 192.168.2.252 255.255.255.0
SwitchA(config-if)#vrrp 2 ip 192.168.2.254

Now Switch B:

SwitchB(config)#interface vlan A
SwitchB(config-if)#ip address 192.168.1.253 255.255.255.0
SwitchB(config-if)#vrrp 1 ip 192.168.1.254
SwitchB(config-if)#interface vlan B
SwitchB(config-if)#ip address 192.168.2.253 255.255.255.0
SwitchB(config-if)#vrrp 2 ip 192.168.2.254
SwitchB(config-if)#vrrp 2 priority 105

Notice above, that Switch B will have priority for being the virtual gateway of VLAN B, and likewise, Switch A has priority for VLAN A. This way, you can load balance which Switch will handle the traffic on a per-VLAN basis.