Skip Navigation Links
Exit Print View
| Sun Ethernet Fabric Operating System ### VRRP Administration Guide

Search Scope:

- This Document
- Entire Library

## Configure VRRP (Linux Example)

See the second figure in VRRP Topology for the topology in this example. Hosts are used to verify that the data is forwarded correctly. In this example, you use a Linux machine as a host. Port 1 of switch 1, port 1 of switch 2, and the host 1 are connected through a hub. Similarly, port 2 of switch 1, port 2 of switch 2, and host 2 are connected through another hub. In this topology, switch 1 and switch 2 act as a virtual router in vlan 2 and vlan 3. The virtual IP is `12.0.0.3` for vlan 2 and the IP is `20.0.0.3` for vlan 3. The priority of switch 1 is 150 and the priority of switch 2 is 125. Initially, switch 1 will forward the data traffic between host 1 and host 2. If switch 1 fails to operate for some reason, switch 2 will start forwarding the packets.

Note - Note that in the output of the show commands, the sections concerning the default VLAN (vlan 1) and the ports that are members of that VLAN are omitted.

1. In switch 1, configure vlan 2 and vlan 3 and assign the member ports and IP addresses. Be sure to disable spanning tree and GVRP, if they are running in the switch.

       SEFOS# configure terminal
       SEFOS(config)# no spanning-tree
       SEFOS(config)# set gvrp disable
       SEFOS(config)# vlan 2
       SEFOS(config-vlan)# ports extreme-ethernet 0/1 untagged extreme-ethernet 0/1
       SEFOS(config-vlan)# exit
       SEFOS(config)# interface vlan2
       SEFOS(config-if)# shutdown
       SEFOS(config-if)# ip address 12.0.0.1 255.0.0.0
       SEFOS(config)# no shutdown
       SEFOS(config-if)# exit
       SEFOS(config-if)# vlan 3
       SEFOS(config-if)# ports extreme-ethernet 0/33 untagged extreme-ethernet 0/33
       SEFOS(config-if)# interface extreme-ethernet 0/33
       SEFOS(config)# switchport access vlan 3
       SEFOS(config-vlan)# no shutdown
       SEFOS(config-vlan)# exit
       SEFOS(config)# interface vlan 3
       SEFOS(config-if)# shutdown
       SEFOS(config-if)# ip address 20.0.0.1 255.0.0.0
       SEFOS(config-if)# no shutdown
       SEFOS(config)# end

2. Verify the VLAN configurations.

       SEFOS# show ip interface
       vlan2 is up, line protocol is up
       Internet Address is 12.0.0.1/8
       SEFOS# show vlan briefBroadcast Address  12.255.255.255Vlan database-------------Vlan ID             : 2Member Ports        : Ex0/1Untagged Ports      : Ex0/1Forbidden Ports     : NoneName                :Status              : Permanent----------------------------------Vlan ID             : 3Member Ports        : Ex0/33Untagged Ports      : Ex0/33Forbidden Ports     : NoneName                :Status              : Permanent----------------------------------

       vlan3 is up, line protocol is up
       Internet Address is 20.0.0.1/8
       Broadcast Address  20.255.255.255

3. In switch 2, configure vlan 2 and vlan 3 and assign the ports and IP address. Be sure to disable spanning tree and GVRP if they are running in the switch.

       SEFOS# configure terminal
       SEFOS(config)# no spanning-tree
       SEFOS(config)# set gvrp disable
       SEFOS(config)# vlan 2
       SEFOS(config-vlan)# ports extreme-ethernet 0/33 untagged extreme-ethernet 0/33
       SEFOS(config-vlan)# exit
       SEFOS(config)# interface extreme-ethernet 0/33
       SEFOS(config-if)# switchport access vlan 2
       SEFOS(config-if)# no shutdown
       SEFOS(config-if)# exit
       SEFOS(config)# interface vlan 2
       SEFOS(config-if)# shutdown
       SEFOS(config-if)# ip address 12.0.0.2 255.0.0.0
       SEFOS(config-if)# no shutdown
       SEFOS(config-if)# exit
       SEFOS(config)# vlan 3
       SEFOS(config-vlan)# ports extreme-ethernet 0/1 untagged extreme-ethernet 0/1
       SEFOS(config-vlan)# exit
       SEFOS(config)# interface extreme-ethernet 0/1
       SEFOS(config-if)# switchport access vlan 3
       SEFOS(config-if)# no shutdown
       SEFOS(config-if)# exit
       SEFOS(config)# interface vlan 3
       SEFOS(config-if)# shutdown
       SEFOS(config-if)# ip address 20.0.0.2 255.0.0.0
       SEFOS(config-if)# no shutdown
       SEFOS(config-if)# end

4. Verify the configuration.

       SEFOS# show ip interface
       vlan2 is up, line protocol is up
       Internet Address is 12.0.0.2/8
       SEFOS# show vlan briefBroadcast Address  12.255.255.255Vlan database-------------Vlan ID             : 2Member Ports        : Ex0/33Untagged Ports      : Ex0/33Forbidden Ports     : NoneName                :Status              : Permanent----------------------------------Vlan ID             : 3Member Ports        : Ex0/1Untagged Ports      : Ex0/1Forbidden Ports     : NoneName                :Status              : Permanent----------------------------------

       vlan3 is up, line protocol is up
       Internet Address is 20.0.0.2/8
       Broadcast Address  20.255.255.255

5. In switch 1, verify the connectivity between switch 1 and switch 2.

       SEFOS# ping 12.0.0.2
       Reply Received From :12.0.0.2, TimeTaken : 50 msecs
       Reply Received From :12.0.0.2, TimeTaken : 40 msecs
       SEFOS# ping 20.0.0.2Reply Received From :12.0.0.2, TimeTaken : 40 msecsReply Received From :20.0.0.2, TimeTaken : 50 msecsReply Received From :20.0.0.2, TimeTaken : 30 msecsReply Received From :20.0.0.2, TimeTaken : 30 msecs

6. Enable VRRP instances over vlan2 and vlan3 in switch 1 and configure the IP addresses and priority.

       SEFOS# configure terminal
       SEFOS(config)# router vrrp
       SEFOS(config-vrrp)# interface vlan 2
       SEFOS(config-vrrp-if)# vrrp 1 ipv4 12.0.0.3
       SEFOS(config-vrrp-if)# vrrp 1 priority 150
       SEFOS(config-vrrp-if)# exit
       SEFOS(config-vrrp)# interface vlan 3
       SEFOS(config-vrrp-if)# vrrp 1 ip 20.0.0.3
       SEFOS(config-vrrp-if)# vrrp 1 priority 150
       SEFOS(config-vrrp-if)# end

7. Verify the VRRP configurations in switch 1.

       SEFOS# show  vrrp
       P indicates configured to preempt
       Interface   vrID Priority  P  State    Master Addr     VRouter Addr
       ---------   ---- --------  -  -----    -----------     ------------
       vlan2       1    150       P  Master   local           12.0.0.3
       vlan3       1    150       P  Master   local           20.0.0.3

8. Enable VRRP instances over vlan 2 and vlan 3 in switch 2, and configure the IP addresses and priority.

       SEFOS# configure terminal
       SEFOS(config)# router vrrp
       SEFOS(config-vrrp)# interface vlan 2
       SEFOS(config-vrrp-if)# vrrp 1 ipv4 12.0.0.3
       SEFOS(config-vrrp-if)# vrrp 1 priority 125
       SEFOS(config-vrrp-if)# exit
       SEFOS(config-vrrp)# interface vlan 3
       SEFOS(config-vrrp-if)# vrrp 1 ipv4 20.0.0.3
       SEFOS(config-vrrp-if)# vrrp 1 priority 125
       SEFOS(config-vrrp-if)# end

9. Verify the VRRP configurations in switch 2.

       SEFOS# show  vrrp
       P indicates configured to preempt
       Interface   vrID Priority  P  State    Master Addr     VRouter Addr
       ---------   ---- --------  -  -----    -----------     ------------
       vlan2       1    125       P  Backup   12.0.0.3        12.0.0.3
       vlan3       1    125       P  Backup   20.0.0.3        20.0.0.3

10. In host 1, configure an interface with `12.0.0.100` and add a route to the host 2 network through `12.0.0.3`.
    1. Execute these Linux commands in host 1 (a Linux machine is used as a host).

           [root@host1 root]# /sbin/ifconfig eth0 12.0.0.100
           [root@host1 root]# /sbin/route add -net 20.0.0.0 netmask 255.0.0.0 gw 12.0.0.3

    2. Verify the configurations using these Linux commands.

           [root@host1 root]# /sbin/ifconfig
           eth0      Link encap:Ethernet  HWaddr 00:10:B5:66:A7:28
            inet addr:12.0.0.100  Bcast:12.255.255.255  Mask:255.0.0.0
           [root@host1 root]# /sbin/route -nUP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1Kernel IP routing tableDestination  Gateway    Genmask        Flags Metric Ref    Use Iface12.0.0.0     0.0.0.0    255.0.0.0      U     0      0      0   eth020.0.0.0     12.0.0.3   255.0.0.0      UG    0      0      0   eth0
           RX packets:35 errors:0 dropped:0 overruns:0 frame:0
           TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:100
           RX bytes:2974 (2.9 Kb)  TX bytes:6092 (5.9 Kb)
           Interrupt:15 Base address:0xbd00

11. In host 2, configure an interface with `20.0.0.100` and add a route to the host 1 network through `20.0.0.3`.
    1. Execute these Linux commands in host 2 (another Linux machine).

           [root@host2 root]# /sbin/ifconfig eth0 20.0.0.100
           [root@host2 root]# /sbin/route add -net 12.0.0.0 netmask 255.0.0.0 gw 20.0.0.3

    2. Verify the configurations using these Linux commands.

           [root@host2 root]# /sbin/ifconfig
           eth0      Link encap:Ethernet  HWaddr 00:10:B5:66:A7:28
            inet addr:20.0.0.100  Bcast:20.255.255.255  Mask:255.0.0.0
           [root@host2 root]# /sbin/route -nUP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1Kernel IP routing tableDestination  Gateway     Genmask     Flags Metric Ref    Use Iface20.0.0.0    0.0.0.0    255.0.0.0      U     0     0        0     eth012.0.0.0   20.0.0.3    255.0.0.0     UG     0     0        0     eth0
           RX packets:35 errors:0 dropped:0 overruns:0 frame:0
           TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:100
           RX bytes:2974 (2.9 Kb)  TX bytes:6092 (5.9 Kb)
           Interrupt:15 Base address:0xbd00

12. Initiate 25 ping packets from host 1 to host 2.

        [root@host2 root]# ping 20.0.0.100 -c 25
        PING 20.0.0.100 (20.0.0.100) from 12.0.0.100 : 56(84) bytes of data.
        64 bytes from 20.0.0.100: icmp_seq=1 ttl=63 time=79.0 ms
        64 bytes from 20.0.0.100: icmp_seq=2 ttl=63 time=25.4 ms
        64 bytes from 20.0.0.100: icmp_seq=3 ttl=63 time=25.7 ms

13. During the ping session, shutdown vlan 2 and vlan 3 in switch 1.

        SEFOS# configure terminal
        SEFOS(config)# interface vlan 2
        SEFOS(config-if)# shutdown
        SEFOS(config-if )# exit
        SEFOS(config)# interface vlan 3
        SEFOS(config-if)# shutdown
        SEFOS(config-if)# end

14. Observe whether the ping is still successful after a small black hole period (connectivity loss between the hosts).

        64 bytes from 20.0.0.100: icmp_seq=4 ttl=63 time=27.6 ms
        64 bytes from 20.0.0.100: icmp_seq=5 ttl=63 time=24.8 ms
        64 bytes from 20.0.0.100: icmp_seq=13 ttl=63 time=49.7 ms
        64 bytes from 20.0.0.100: icmp_seq=14 ttl=63 time=30.3 ms
        64 bytes from 20.0.0.100: icmp_seq=15 ttl=63 time=24.3 ms
        64 bytes from 20.0.0.100: icmp_seq=16 ttl=63 time=31.3 ms
        64 bytes from 20.0.0.100: icmp_seq=17 ttl=63 time=25.9 ms
        64 bytes from 20.0.0.100: icmp_seq=18 ttl=63 time=30.3 ms
        64 bytes from 20.0.0.100: icmp_seq=19 ttl=63 time=33.7 ms
        64 bytes from 20.0.0.100: icmp_seq=20 ttl=63 time=28.8 ms
        64 bytes from 20.0.0.100: icmp_seq=21 ttl=63 time=22.9 ms
        64 bytes from 20.0.0.100: icmp_seq=22 ttl=63 time=25.3 ms
        64 bytes from 20.0.0.100: icmp_seq=23 ttl=63 time=30.0 ms
        64 bytes from 20.0.0.100: icmp_seq=24 ttl=63 time=22.3 ms
        64 bytes from 20.0.0.100: icmp_seq=25 ttl=63 time=26.5 ms

        --- 20.0.0.100 ping statistics ---
        25 packets transmitted, 18 received, 28% loss, time 24045ms
        rtt min/avg/max/mdev = 22.342/31.370/79.070/13.006 ms

15. Verify that the ARP table in host 1 for `12.0.0.3` is resolved with the VRRP MAC address.

        [root@host1 root]# /sbin/arp -an
        ? (12.0.0.3) at 00:00:5E:00:01:01 [ether] on eth0

16. Verify that the ARP table in host 2 for `20.0.0.3` is resolved with the VRRP MAC address.

        [root@host2 root]# /sbin/arp -an
        ? (20.0.0.3) at 00:00:5E:00:01:01 [ether] on eth0

    Alternatively, use the following steps to set up host 1 with a system running Solaris 10 and using an `nxge` 10GbE interface.

    1. Configure the interface with `12.0.0.100` as its IP address and add a route to the host 2 network through `12.0.0.3`.

           root@unknown:~# ifconfig nxge0 plumb 12.0.0.100 up
           root@unknown:~# route add net 20.0.0.0/8 12.0.0.3

    2. Verify the configuration.

           root@unknown:~# ifconfig nxge0
           nxge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 6
            inet 12.0.0.100 netmask ff000000 broadcast 12.255.255.255
           root@unknown:~# netstat -rnether 0:14:4f:9b:de:b2 Routing Table: IPv4Destination           Gateway        Flags  Ref  Use    Interface -----------           --------       -----  ---  ---    --------- 12.0.0.0              12.0.0.100     U      5    16     nxge0     20.0.0.0              12.0.0.3       UG     2    1343           127.0.0.1             127.0.0.1      UH     2    3100   lo0

    3. Verify that the ARP entry for the gateway is the VRRP MAC address.

           root@unknown:~# arp -an
           Net to Media Table: IPv4
           Device   IP Address  Mask               Flags    Phys Addr
           ------   ----------  ----               -----    ---------
           nxge0    12.0.0.1    255.255.255.255             00:21:28:77:c3:bd
           nxge0    12.0.0.2    255.255.255.255             00:14:4f:6c:d0:4d
           nxge0    12.0.0.3    255.255.255.255             00:00:5e:00:01:01
           nxge0    12.0.0.100  255.255.255.255    SPLA     00:14:4f:9b:de:b2

Copyright © 2010, 2011, Oracle and/or its affiliates. All rights reserved. Legal Notices |