Configuring VRRP on Juniper routers
Oct 19

I recently worked on a project where I needed two redundant Juniper routers.  Of course, networks *should* only have one gateway, so I needed to configure VRRP to have one of the routers be active, and the other standby incase the first one died.

Below are two router configs. ge-0/0/0 is the uplink to our internet provider.  Each uplink has a /30.  On our side of the network we’re assigned a public subnet to ge-0/0/1, although you could also configure the router with firewall rules and setup NAT and private IP space and accomplish the same thing.  On the ge-0/0/1, you need to assign a unique IP to each router (2.2.2.2 and 2.2.2.3), then you need a “Virtual” IP (or VIP) that will be used by all devices as the gateway (2.2.2.1).

I also add a section called “track”.  What this does is tells VRRP on the ge-0/0/1 interfaces to watch ge-0/0/0 and if anything happens to that interface, then it should tell the other router it needs to give up controlling the VIP.

Router1

interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                address 1.1.1.2/30;
            }
        }
    }
    ge-0/0/1 {
        unit 0 {
            family inet {
                address 2.2.2.2/24 {
                    vrrp-group 1 {
                        virtual-address 2.2.2.1;
                        priority 101;
                        accept-data;
                        track {
                            interface ge-0/0/0 {
                                priority-cost 10;
                            }
                        }
                    }
                }
            }
        }
    }
}

Router 2

interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                address 1.1.1.6/30;
            }
        }
    }
    ge-0/0/1 {
        unit 0 {
            family inet {
                address 2.2.2.3/24 {
                    vrrp-group 1 {
                        virtual-address 2.2.2.1;
                        priority 101;
                        accept-data;
                        track {
                            interface ge-0/0/0 {
                                priority-cost 10;
                            }
                        }
                    }
                }
            }
        }
    }
}


Switch to our mobile site