User Tools

Site Tools


documentation:examples:ecmp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
documentation:examples:ecmp [2020/01/26 19:46] – [Testing Load balancing] olivierdocumentation:examples:ecmp [2020/09/23 15:01] – [R2 (ECMP router)] olivier
Line 1: Line 1:
 ====== Equal-cost multi-path routing (ECMP) ====== ====== Equal-cost multi-path routing (ECMP) ======
  
-This lab is testing new ECMP routing code. +This lab is testing new ECMP routing code from [[https://reviews.freebsd.org/D26449|FreeBSD's review D26449]]
 ===== Presentation ===== ===== Presentation =====
  
 +<note warning>Bhyve doesn't support emulating multiqueue NIC, so RSS flow-id could not be tested using a bhyve based lab: Had to use physical lab</note>
 ==== Network diagram ==== ==== Network diagram ====
  
 Here is the logical and physical view: Here is the logical and physical view:
  
-{{:documentation:examples:labs.examples.ecmp.png|}}+{{:documentation:examples:bsdrp-lab-mpath.png|}}
  
 ===== Setting-up the lab ===== ===== Setting-up the lab =====
Line 15: Line 15:
 ==== Downloading BSD Router Project images ==== ==== Downloading BSD Router Project images ====
  
-Download BSDRP serial image (prevent to have to use an X display) on Sourceforge.+Download BSDRP serial image on Sourceforge and upload them to the 2 ECMP routers.
  
-==== Download Lab scripts ===== 
- 
-More information on these BSDRP lab scripts available on [[documentation:examples:How to build a BSDRP router lab]]. 
- 
-Start the lab with 6 routers. 
-With bhyve under FreeBSD: 
-<code> 
-user:~ # BSDRP-lab-bhyve.sh -i BSDRP.amd64/BSDRP-1.71-full-amd64-serial.img.xz -n 6 
-BSD Router Project (http://bsdrp.net) - bhyve full-meshed lab script 
-Setting-up a virtual lab with 6 VM(s): 
-- Working directory: /tmp/BSDRP 
-- Each VM have 1 core(s) and 256M RAM 
-- Switch mode: bridge + tap 
-- 0 LAN(s) between all VM 
-- Full mesh Ethernet links between each VM 
-VM 1 have the following NIC: 
-- vtnet0 connected to VM 2. 
-- vtnet1 connected to VM 3. 
-- vtnet2 connected to VM 4. 
-- vtnet3 connected to VM 5. 
-- vtnet4 connected to VM 6. 
-VM 2 have the following NIC: 
-- vtnet0 connected to VM 1. 
-- vtnet1 connected to VM 3. 
-- vtnet2 connected to VM 4. 
-- vtnet3 connected to VM 5. 
-- vtnet4 connected to VM 6. 
-VM 3 have the following NIC: 
-- vtnet0 connected to VM 1. 
-- vtnet1 connected to VM 2. 
-- vtnet2 connected to VM 4. 
-- vtnet3 connected to VM 5. 
-- vtnet4 connected to VM 6. 
-VM 4 have the following NIC: 
-- vtnet0 connected to VM 1. 
-- vtnet1 connected to VM 2. 
-- vtnet2 connected to VM 3. 
-- vtnet3 connected to VM 5. 
-- vtnet4 connected to VM 6. 
-VM 5 have the following NIC: 
-- vtnet0 connected to VM 1. 
-- vtnet1 connected to VM 2. 
-- vtnet2 connected to VM 3. 
-- vtnet3 connected to VM 4. 
-- vtnet4 connected to VM 6. 
-VM 6 have the following NIC: 
-- vtnet0 connected to VM 1. 
-- vtnet1 connected to VM 2. 
-- vtnet2 connected to VM 3. 
-- vtnet3 connected to VM 4. 
-- vtnet4 connected to VM 5. 
-For connecting to VM'serial console, you can use: 
-- VM 1 : cu -l /dev/nmdm1B 
-- VM 2 : cu -l /dev/nmdm2B 
-- VM 3 : cu -l /dev/nmdm3B 
-- VM 4 : cu -l /dev/nmdm4B 
-- VM 5 : cu -l /dev/nmdm5B 
-- VM 6 : cu -l /dev/nmdm6B 
-</code> 
  
 ===== Static routing setup ===== ===== Static routing setup =====
  
-==== VM 1 (client) ====+==== Client ====
  
-VM1 is configured as a simple host with multiples aliases:+simple host with multiples aliases:
  
 <code> <code>
-sysrc hostname=VM1 +sysrc hostname=client 
- gateway_enable=NO \ +  gateway_enable=NO \ 
- ipv6_gateway_enable=NO \ +  ipv6_gateway_enable=NO \ 
- ifconfig_vtnet0="inet 10.0.12.1/24" \ +  ifconfig_igb1="inet 10.0.31.3/24" \ 
- ifconfig_vtnet0_alias1="inet 10.0.12.11/32" \ +  ifconfig_igb1_alias1="inet 10.0.31.13/32" \ 
- ifconfig_vtnet0_alias2="inet 10.0.12.21/32" \ +  ifconfig_igb1_alias2="inet 10.0.31.23/32" \ 
- ifconfig_vtnet0_alias3="inet 10.0.12.31/32"+  ifconfig_igb1_alias3="inet 10.0.31.33/32" \ 
- ifconfig_vtnet0_alias4="inet 10.0.12.41/32" \ +  ifconfig_igb1_alias4="inet 10.0.31.43/32" \ 
- ifconfig_vtnet0_alias5="inet 10.0.12.51/32" \ +  ifconfig_igb1_alias5="inet 10.0.31.53/32" \ 
- ifconfig_vtnet0_ipv6="inet6 2001:db8:12::prefixlen 64" \ +  ifconfig_igb1_ipv6="inet6 2001:db8:31::prefixlen 64" \ 
- ifconfig_vtnet0_alias61="inet6 2001:db8:12::11 prefixlen 64" \ +  ifconfig_igb1_alias61="inet6 2001:db8:31::13 prefixlen 64" \ 
- ifconfig_vtnet0_alias62="inet6 2001:db8:12::21 prefixlen 64" \ +  ifconfig_igb1_alias62="inet6 2001:db8:31::23 prefixlen 64" \ 
- ifconfig_vtnet0_alias63="inet6 2001:db8:12::31 prefixlen 64" \ +  ifconfig_igb1_alias63="inet6 2001:db8:31::33 prefixlen 64" \ 
- ifconfig_vtnet0_alias64="inet6 2001:db8:12::41 prefixlen 64" \ +  ifconfig_igb1_alias64="inet6 2001:db8:31::43 prefixlen 64" \ 
- ifconfig_vtnet0_alias65="inet6 2001:db8:12::51 prefixlen 64" \ +  ifconfig_igb1_alias65="inet6 2001:db8:31::53 prefixlen 64" \ 
- defaultrouter="10.0.12.2" \ +  static_routes="LAB" \  
- ipv6_defaultrouter="2001:db8:12::2"+  route_LAB="-net 10.0.0.0/16 10.0.31.1" \  
 +  ipv6_static_routes="LAB" \  
 +  ipv6_route_LAB="2001:db8:: -prefixlen 32 2001:db8:31::1"
 service hostname restart service hostname restart
 service netif restart service netif restart
Line 107: Line 50:
 </code> </code>
  
-==== VM 2 (ECMP router) ====+==== R1 (ECMP router) ====
  
-VM 2 is a router with ECMP: 2 static routes toward the same destination but using 2 different next-hop.+R1 is a router with ECMP: 2 static routes toward the same destination but using 2 different next-hop.
  
 <code> <code>
-sysrc hostname=VM2 +sysrc hostname=R1 
- ifconfig_vtnet0="inet 10.0.12.2/24" \ +  gateway_enable=YES \ 
- ifconfig_vtnet1="inet 10.0.23.2/24" \ +  ipv6_gateway_enable=YES \ 
- ifconfig_vtnet2="inet 10.0.24.2/24" \ +  ifconfig_igb0="inet 10.0.31.1/24" \  
- ifconfig_vtnet0_ipv6="inet6 2001:db8:12::prefixlen 64" \ +  ifconfig_igb0_ipv6="inet6 2001:db8:31::1 prefixlen 64" \ 
- ifconfig_vtnet1_ipv6="inet6 2001:db8:23::2 prefixlen 64" \ +  ifconfig_igb1="inet 10.0.112.1/24" \ 
- ifconfig_vtnet2_ipv6="inet6 2001:db8:24::prefixlen 64" \ +  ifconfig_igb1_ipv6="inet6 2001:db8:112::prefixlen 64" \ 
- static_routes="VM3VM6 VM3VM5 VM4VM6 VM4VM5" \ +  ifconfig_igb2="inet 10.0.212.1/24" \ 
- route_VM3VM6="-net 10.0.56.0/24 10.0.23.3"+  ifconfig_igb2_ipv6="inet6 2001:db8:212::prefixlen 64" \ 
- route_VM3VM5="-net 10.0.35.0/24 10.0.23.3" \ +  static_routes="MPATH1 MPATH2" \ 
- route_VM4VM6="-net 10.0.56.0/24 10.0.24.4"+  route_MPATH1="-net 10.0.0.0/16 10.0.112.2" \ 
- route_VM4VM5="-net 10.0.45.0/24 10.0.24.4" \ +  route_MPATH2="-net 10.0.0.0/16 10.0.212.2" \ 
- ipv6_static_routes="VM3VM6 VM3VM5 VM4VM6 VM4VM5" \ +  ipv6_static_routes="MPATH1 MPATH2" \ 
- ipv6_route_VM3VM6="2001:db8:56:: -prefixlen 64 2001:db8:23::3" \ +  ipv6_route_MPATH1="2001:db8:: -prefixlen 32 2001:db8:112::2" \ 
- ipv6_route_VM3VM5="2001:db8:35:: -prefixlen 64 2001:db8:23::3" \ +  ipv6_route_MPATH2="2001:db8:: -prefixlen 32 2001:db8:212::2"
- ipv6_route_VM4VM6="2001:db8:56:: -prefixlen 64 2001:db8:24::4"+
- ipv6_route_VM4VM5="2001:db8:45:: -prefixlen 64 2001:db8:24::4"+
 service hostname restart service hostname restart
 service netif restart service netif restart
Line 138: Line 79:
  
 <code> <code>
-[root@VM2]~# netstat -rn4 | grep 10.0.56.0 +[root@R1]~# netstat -rn4 | grep 10.0.0.0/16 
-10.0.56.0/24       10.0.24.4          UGS      vtnet2 +10.0.0.0/16        10.0.112.2         UGS        igb1 
-10.0.56.0/24       10.0.23.3          UGS      vtnet1 +10.0.0.0/16        10.0.212.2         UGS        igb2 
-[root@VM2]~# route -n get 10.0.56.0/24 + 
-   route to: 10.0.56.0 +[root@R1]~# route -n get 10.0.0.0/16 
-destination: 10.0.56.0 +   route to: 10.0.0.0 
-       mask: 255.255.255.0 +destination: 10.0.0.0 
-    gateway: 10.0.24.4+       mask: 255.255.0.0 
 +    gateway: 10.0.112.2
         fib: 0         fib: 0
-  interface: vtnet2+  interface: igb1
       flags: <UP,GATEWAY,DONE,STATIC>       flags: <UP,GATEWAY,DONE,STATIC>
  recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight    expire  recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight    expire
-                                    1500       100         0 +                                    1500                 0 
-[root@VM2]~# netstat -4onW+ 
 +[root@R1]~# netstat -4onW
 Nexthop data Nexthop data
  
 Internet: Internet:
 Idx   Type         IFA                Gateway             Flags      Use Mtu         Netif     Addrif Refcnt Prepend Idx   Type         IFA                Gateway             Flags      Use Mtu         Netif     Addrif Refcnt Prepend
-      v4/resolve 10.0.23.         vtnet1/resolve                     1500     vtnet1               1 +      v4/resolve 127.0.0.         lo0/resolve        HS             16384        lo0               1 
-      v4/resolve 10.0.24.         vtnet2/resolve                   0   1500     vtnet2               1 +      v4/resolve 10.0.31.         igb0/resolve                     0   1500       igb0               1 
-      v4/resolve 10.0.12.         vtnet0/resolve                   3   1500     vtnet0               +      v4/resolve 127.0.0.         lo0/resolve        HS            0  16384        lo0      igb0     1 
-      v4/resolve 127.0.0.1          lo0/resolve        HS            6  16384        lo0               1 +      v4/resolve 10.0.112.1         igb1/resolve                     0   1500       igb1               1 
-      v4/resolve 127.0.0.1          lo0/resolve        HS            0  16384        lo0    vtnet2     1 +      v4/resolve 127.0.0.1          lo0/resolve        HS            0  16384        lo0      igb1     1 
-      v4/resolve 127.0.0.1          lo0/resolve        HS             16384        lo0    vtnet1     +      v4/resolve 10.0.212.1         igb2/resolve                       1500       igb2               
-      v4/resolve 127.0.0.1          lo0/resolve        HS            0  16384        lo0    vtnet0     1 +      v4/resolve 127.0.0.1          lo0/resolve        HS            0  16384        lo0      igb2     1 
-           v4/gw 10.0.24.2          10.0.24.4          GS              1500     vtnet2               2 +           v4/gw 10.0.112.1         10.0.112.2         GS              1500       igb1               1 
-           v4/gw 10.0.23.2          10.0.23.3          GS            0   1500     vtnet1               2 +           v4/gw 10.0.212.1         10.0.212.2         GS            0   1500       igb2               
-Nexthop groups data +     
-BUF192+[root@R1]~# netstat -rn6 | grep 2001:db8::/32 
 +2001:db8::/32                     2001:db8:212::              UGS        igb2 
 +2001:db8::/32                     2001:db8:112::              UGS        igb1 
 +       
 +[root@R1]~# route -n6 get 2001:db8::/32 
 +   route to: 2001:db8:: 
 +destination: 2001:db8:: 
 +       mask: ffff:ffff:: 
 +    gateway: 2001:db8:212::
 +        fib: 0 
 +  interface: igb2 
 +      flags: <UP,GATEWAY,DONE,STATIC> 
 + recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight    expire 
 +                                    1500                 0
  
-Internet+[root@R1]~# netstat -6onW 
-MpIdx NHIdx Weigh Slots            Gateway Netif      Refcnt +Nexthop data 
-1      ---- ---- ----              ----      ----    1 + 
-            100     1          10.0.24.4    vtnet2 +Internet6
-          8   100     1          10.0.23.3    vtnet1+Idx   Type         IFA                           Gateway                        Flags      Use Mtu       Netif   Addrif Refcnt Prepend 
 +      v6/resolve ::1                           lo0/resolve                                16384      lo0             1 
 +2       v6/resolve fe80::1%lo0                   lo0/resolve                   HS            0  16384      lo0             1 
 +3       v6/resolve fe80::1%lo0                   lo0/resolve                                  16384      lo0             1 
 +4       v6/resolve ::1                           lo0/resolve                   HS            0  16384      lo0    igb0     2 
 +5       v6/resolve fe80::20d:b9ff:fe45:79e4%igb0 igb0/resolve                                0   1500     igb0             
 +6       v6/resolve 2001:db8:31::               igb0/resolve                                0   1500     igb0             1 
 +7       v6/resolve fe80::20d:b9ff:fe45:79e5%igb1 igb1/resolve                                  1500     igb1             1 
 +      v6/resolve ::1                           lo0/resolve                   HS            0  16384      lo0    igb1     2 
 +9       v6/resolve 2001:db8:112::              igb1/resolve                                0   1500     igb1             1 
 +10      v6/resolve fe80::20d:b9ff:fe45:79e6%igb2 igb2/resolve                                  1500     igb2             1 
 +11      v6/resolve ::1                           lo0/resolve                   HS            0  16384      lo0    igb2     2 
 +12           v6/gw ::1                           ::                          GRS            16384      lo0             4 
 +13           v6/gw 2001:db8:112::              2001:db8:112::              GS            0   1500     igb1             1 
 +14           v6/gw 2001:db8:212::              2001:db8:212::              GS            0   1500     igb2             1 
 +15      v6/resolve 2001:db8:212::              igb2/resolve                                0   1500     igb2             1
 </code> </code>
-==== VM 3 (router) ==== 
  
-VM 3 is a simple router. 
  
-<code> +Look like this router will prefer igb1 for inet4 and igb2 for inet6.
-sysrc hostname=VM3 \ +
- ifconfig_vtnet1="inet 10.0.23.3/24"+
- ifconfig_vtnet3="inet 10.0.35.3/24"+
- ifconfig_vtnet1_ipv6="inet6 2001:db8:23::3 prefixlen 64" \ +
- ifconfig_vtnet3_ipv6="inet6 2001:db8:35::3 prefixlen 64" \ +
- static_routes="VM6 VM1" \ +
- route_VM1="-net 10.0.12.0/24 10.0.23.2"+
- route_VM6="-net 10.0.56.0/24 10.0.35.5" \ +
- ipv6_static_routes="VM6 VM1" \ +
- ipv6_route_VM1="2001:db8:12:: -prefixlen 64 2001:db8:23::2"+
- ipv6_route_VM6="2001:db8:56:: -prefixlen 64 2001:db8:35::5" +
-service hostname restart +
-service netif restart +
-service routing restart +
-config save +
-</code>+
  
-==== VM 4 (router) ====+==== R5 (ECMP router) ====
  
-VM 4 is like VM 3, a simple router.+R5 is like R2, a router with ECMP: 2 static routing toward the same destination but using 2 different next-hop..
  
 <code> <code>
-sysrc hostname=VM4 +sysrc hostname=R2 
- ifconfig_vtnet1="inet 10.0.24.4/24" \ +  gateway_enable=YES \ 
- ifconfig_vtnet3="inet 10.0.45.4/24" \ +  ipv6_gateway_enable=YES \ 
- ifconfig_vtnet1_ipv6="inet6 2001:db8:24::prefixlen 64" \ +  ifconfig_igb0="inet 10.0.24.2/24" \ 
- ifconfig_vtnet3_ipv6="inet6 2001:db8:45::prefixlen 64" \ +  ifconfig_igb0_ipv6="inet6 2001:db8:24::2 prefixlen 64" \ 
- static_routes="VM6 VM1" \ +  ifconfig_igb1="inet 10.0.112.2/24" \ 
- route_VM1="-net 10.0.12.0/24 10.0.24.2" \ +  ifconfig_igb1_ipv6="inet6 2001:db8:112::prefixlen 64" \ 
- route_VM6="-net 10.0.56.0/24 10.0.45.5" \ +  ifconfig_igb2="inet 10.0.212.2/24"
- ipv6_static_routes="VM6 VM1" \ +  ifconfig_igb2_ipv6="inet6 2001:db8:212::prefixlen 64" \ 
- ipv6_route_VM1="2001:db8:12:: -prefixlen 64 2001:db8:24::2" \ +  static_routes="MPATH1 MPATH2" \ 
- ipv6_route_VM6="2001:db8:56:: -prefixlen 64 2001:db8:45::5"+  route_MPATH1="-net 10.0.0.0/16 10.0.112.1" \ 
 +  route_MPATH2="-net 10.0.0.0/16 10.0.212.1" \ 
 +  ipv6_static_routes="MPATH1 MPATH2" \ 
 +  ipv6_route_MPATH1="2001:db8:: -prefixlen 32 2001:db8:112::1" \ 
 +  ipv6_route_MPATH2="2001:db8:: -prefixlen 32 2001:db8:212::1"
 service hostname restart service hostname restart
 service netif restart service netif restart
Line 218: Line 175:
 </code> </code>
  
-==== VM 5 (ECMP router) ====+And checking: 
 +<code> 
 +# route get 10.0.0.0/16 
 +   route to: 10.0.0.0 
 +destination: 10.0.0.0 
 +       mask: 255.255.0.0 
 +    gateway: 10.0.212.1 
 +        fib: 0 
 +  interface: igb2 
 +      flags: <UP,GATEWAY,DONE,STATIC> 
 + recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight    expire 
 +                                    1500                 0
  
-VM 5 is like VM 2, a router with ECMP: 2 static routing toward the same destination but using 2 different next-hop.. 
  
-<code> +# route -6 get 2001:db8::/32 
-sysrc hostname=VM5 \ +   route to: 2001:db8:: 
- ifconfig_vtnet2="inet 10.0.35.5/24"+destination: 2001:db8:: 
- ifconfig_vtnet3="inet 10.0.45.5/24"+       maskffff:ffff:: 
- ifconfig_vtnet4="inet 10.0.56.5/24"+    gateway: 2001:db8:112::1 
- ifconfig_vtnet2_ipv6="inet6 2001:db8:35::5 prefixlen 64" \ +        fib
- ifconfig_vtnet3_ipv6="inet6 2001:db8:45::5 prefixlen 64" \ +  interfaceigb1 
- ifconfig_vtnet4_ipv6="inet6 2001:db8:56::5 prefixlen 64" \ +      flags<UP,GATEWAY,DONE,STATIC> 
- static_routes="VM3VM1 VM3VM2 VM4VM1 VM4VM2"+ recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight    expire 
- route_VM3VM1="-net 10.0.12.0/24 10.0.35.3"+       0                              1500                 0 
- route_VM3VM2="-net 10.0.23.0/24 10.0.35.3"+       
- route_VM4VM1="-net 10.0.12.0/24 10.0.45.4"+
- route_VM4VM2="-net 10.0.24.0/24 10.0.45.4"+
- ipv6_static_routes="VM3VM1 VM3VM2 VM4VM1 VM4VM2"+
- ipv6_route_VM3VM1="2001:db8:12:: -prefixlen 64 2001:db8:35::3" \ +
- ipv6_route_VM3VM2="2001:db8:23:: -prefixlen 64 2001:db8:35::3" \ +
- ipv6_route_VM4VM1="2001:db8:12:: -prefixlen 64 2001:db8:45::4" \ +
- ipv6_route_VM4VM2="2001:db8:24:: -prefixlen 64 2001:db8:45::4" +
-service hostname restart +
-service netif restart +
-service routing restart +
-config save+
 </code> </code>
  
-==== VM 6 (server) ====+Look like this router will prefer to use igb2 for inet4 and igb1 for inet6. 
 + 
 +==== Server ====
  
-VM 6, like VM 1 is configured as a simple host with multiple aliases:+simple host with multiple aliases:
  
 <code> <code>
-sysrc hostname=VM6 +sysrc hostname=server 
- gateway_enable=NO \ +  gateway_enable=NO \ 
- ipv6_gateway_enable=NO \ +  ipv6_gateway_enable=NO \ 
- ifconfig_vtnet4="inet 10.0.56.6/24" \ +  ifconfig_vr0="inet 10.0.24.4/24" \ 
- ifconfig_vtnet4_alias1="inet 10.0.56.16/32" \ +  ifconfig_vr0_alias1="inet 10.0.24.14/32" \ 
- ifconfig_vtnet4_alias2="inet 10.0.56.26/32" \ +  ifconfig_vr0_alias2="inet 10.0.24.24/32" \ 
- ifconfig_vtnet4_alias3="inet 10.0.56.36/32" \ +  ifconfig_vr0_alias3="inet 10.0.24.34/32" \ 
- ifconfig_vtnet4_alias4="inet 10.0.56.46/32" \ +  ifconfig_vr0_alias4="inet 10.0.24.44/32" \ 
- ifconfig_vtnet4_alias5="inet 10.0.56.56/32" \ +  ifconfig_vr0_alias5="inet 10.0.24.54/32" \ 
- ifconfig_vtnet4_ipv6="inet6 2001:db8:56::prefixlen 64" \ +  ifconfig_vr0_ipv6="inet6 2001:db8:24::prefixlen 64" \ 
- ifconfig_vtnet4_alias61="inet6 2001:db8:56::16 prefixlen 64" \ +  ifconfig_vr0_alias61="inet6 2001:db8:24::14 prefixlen 64" \ 
- ifconfig_vtnet4_alias62="inet6 2001:db8:56::26 prefixlen 64" \ +  ifconfig_vr0_alias62="inet6 2001:db8:24::24 prefixlen 64" \ 
- ifconfig_vtnet4_alias63="inet6 2001:db8:56::36 prefixlen 64" \ +  ifconfig_vr0_alias63="inet6 2001:db8:24::34 prefixlen 64" \ 
- ifconfig_vtnet4_alias64="inet6 2001:db8:56::46 prefixlen 64" \ +  ifconfig_vr0_alias64="inet6 2001:db8:24::44 prefixlen 64" \ 
- ifconfig_vtnet4_alias65="inet6 2001:db8:56::56 prefixlen 64" \ +  ifconfig_vr0_alias65="inet6 2001:db8:24::54 prefixlen 64" \ 
- defaultrouter="10.0.56.5" \ +  static_routes="LAB" \ 
- ipv6_defaultrouter="2001:db8:56::5"+  route_LAB="-net 10.0.0.0/16 10.0.24.2" \ 
 +  ipv6_static_routes="LAB"
 +  ipv6_route_LAB="2001:db8:: -prefixlen 32 2001:db8:24::2"
 service hostname restart service hostname restart
 service netif restart service netif restart
Line 274: Line 234:
 </code> </code>
  
-==== Testing Load balancing ====+===== FRR Multipath setup =====
  
-Flows from VM1 to VM6 should be "flow-id shared" by VM2 toward VM3 and VM4. Let's check using multiple sources and destination IP addresses. +Replacing static routes by FRR (OSPFcompiled with MULTIPATH option.
-Using ping record feature like with this example: +
-<code> +
-[root@VM1]~# ping -c1 -R -S 10.0.12.21 10.0.56.26 +
-PING 10.0.56.26 (10.0.56.26from 10.0.12.21: 56 data bytes +
-64 bytes from 10.0.56.26: icmp_seq=0 ttl=61 time=0.455 ms +
-RR:     10.0.24.2 +
-        10.0.45.4 +
-        10.0.56.5 +
-        10.0.56.26 +
-        10.0.45.5 +
-        10.0.24.4 +
-        10.0.12.2 +
-        10.0.12.21+
  
---- 10.0.56.26 ping statistics --- +==== R1 (ECMP router) ====
-1 packets transmitted, 1 packets received, 0.0% packet loss +
-round-trip min/avg/max/stddev 0.455/0.455/0.455/0.000 ms +
-</code>+
  
-^ Source ^ Destination ^ Ongoing path selected by VM2 ^ Returning path selected by VM5^ +In place of static routes, FRR is enabled:
-| 10.0.12.1 | 10.0.35.5 | VM3 | VM4 | +
-| 10.0.12.1 | 10.0.45.5 | VM4 | VM4 | +
-| 10.0.12.1 | 10.0.56.6 | VM3 | VM4 | +
-| 10.0.12.11 | 10.0.56.16 | VM3 | VM4 | +
-| 10.0.12.21 | 10.0.56.26 | VM3 | VM4 | +
-| 10.0.12.31 | 10.0.56.36 | VM3 | VM4 | +
-| 10.0.12.41 | 10.0.56.46 | VM3 | VM4 | +
-| 10.0.12.51 | 10.0.56.56 | VM3 | VM4 | +
-| 2001:db8:12::1 | 2001:db8:56::6 | error | error | +
-| 2001:db8:12::11 | 2001:db8:56::16 | error | error | +
-| 2001:db8:12::21 | 2001:db8:56::26 | error | error | +
-| 2001:db8:12::31 | 2001:db8:56::36 | error | error | +
-| 2001:db8:12::41 | 2001:db8:56::46 | error | error | +
-| 2001:db8:12::51 | 2001:db8:56::56 | error | error |+
  
- 
-Notice inet6 bug: Cannot ping itself neither neighbor 
 <code> <code>
-[root@VM1]~# ifconfig vtnet0 inet6 +sysrc frr_vtysh_boot="YES" \ 
-vtnet0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500 +  frr_enable="YES" \ 
-        options=80028<VLAN_MTU,JUMBO_MTU,LINKSTATE> +  frr_daemons="zebra ospfd ospf6d" \ 
-        inet6 fe80::5a9c:fcff:fe01:201%vtnet0 prefixlen 64 scopeid 0x1 +  watchfrr_flags=--r /usr/sbin/servicebBfrrbBrestartbB%-s /usr/sbin/servicebBfrrbBstartbB%-k /usr/sbin/servicebBfrrbBstopbB%-b bB -t 30 zebra ospfd ospf6d" \ 
-        inet6 2001:db8:12::1 prefixlen 64 +  watchfrr_enable="YES"
-        inet6 2001:db8:12::11 prefixlen 64 +
-        inet6 2001:db8:12::21 prefixlen 64 +
-        inet6 2001:db8:12::31 prefixlen 64 +
-        inet6 2001:db8:12::41 prefixlen 64 +
-        inet6 2001:db8:12::51 prefixlen 64 +
-        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL> +
-[root@VM1]~# ping6 -c 1 fe80::5a9c:fcff:fe01:201%vtnet0 +
-PING6(56=40+8+8 bytes) fe80::5a9c:fcff:fe01:201%vtnet0 --> fe80::5a9c:fcff:fe01:201%vtnet0 +
- +
---fe80::5a9c:fcff:fe01:201%vtnet0 ping6 statistics --- +
-1 packets transmitted, 0 packets received, 100.0packet loss +
-[root@VM1]~# ping6 -c 12001:db8:12::+
-ping6: illegal number of packets -- 12001:db8:12::2 +
-[root@VM1]~# ping6 -c 1 2001:db8:12::+
-PING6(56=40+8+8 bytes) 2001:db8:12::1 --> 2001:db8:12::2+
  
---- 2001:db8:12::2 ping6 statistics --- +cat > /usr/local/etc/frr/frr.conf <EOF 
-1 packets transmitted, packets received, 100.0% packet loss+frr version 7.4 
 +frr defaults traditional 
 +hostname homelab1 
 +
 +interface igb0 
 + ipv6 ospf6 passive 
 +
 +router ospf 
 + ospf router-id 1.1.1.1 
 + passive-interface igb0 
 + network 10.0.31.0/24 area 0 
 + network 10.0.112.0/24 area 0 
 + network 10.0.212.0/24 area 0 
 +
 +router ospf6 
 + interface igb0 area 0.0.0.0 
 + interface igb1 area 0.0.0.0 
 + interface igb2 area 0.0.0.0 
 +
 +line vty 
 +
 +EOF 
 +service frr start 
 +service watchfrr start
 </code> </code>
  
-==== Testing Fail Over ====+==== R2 (ECMP router) ====
  
-VM4 is the preferred hopso shutdown this VM to check behavior:+In place of static routesFRR is enabled: 
 +<code> 
 +sysrc frr_vtysh_boot="YES"
 +  frr_enable="YES"
 +  frr_daemons="zebra ospfd ospf6d"
 +  watchfrr_flags=" -d -r /usr/sbin/servicebBfrrbBrestartbB%s -s /usr/sbin/servicebBfrrbBstartbB%s -k /usr/sbin/servicebBfrrbBstopbB%s -b bB -t 30 zebra ospfd ospf6d"
 +  watchfrr_enable="YES"
  
-<code+cat /usr/local/etc/frr/frr.conf <EOF 
-[root@VM4]~# shutdown -p now +frr version 7.4 
-Shutdown NOW!+frr defaults traditional 
 +hostname labhome2 
 +
 +interface igb0 
 + ipv6 ospf6 passive 
 +
 +router ospf 
 + ospf router-id 2.2.2.2 
 + passive-interface igb0 
 + network 10.0.24.0/24 area 0 
 + network 10.0.112.0/24 area 0 
 + network 10.0.212.0/24 area 0 
 +! 
 +router ospf6 
 + interface igb0 area 0.0.0.0 
 + interface igb1 area 0.0.0.0 
 + interface igb2 area 0.0.0.0 
 +
 +line vty 
 +
 +EOF 
 +service frr start 
 +service watchfrr start
 </code> </code>
  
 +==== Checking routes installed ====
 +
 +On R1:
 <code> <code>
-[root@VM2]~# netstat -4onW +[root@router1]~# vtysh
-Nexthop data+
  
-Internet: +Hello, this is FRRouting (version 7.4). 
-Idx   Type         IFA                Gateway             Flags      Use Mtu         Netif     Addrif Refcnt Prepend +Copyright 1996-2005 Kunihiro Ishiguro, et al
-      v4/resolve 10.0.23.2          vtnet1/resolve                     1500     vtnet1               1 + 
-6       v4/resolve 10.0.24.2          vtnet2/resolve                     1500     vtnet2               1 +homelab1# sh ip route 10.0.24.0/24 
-2       v4/resolve 10.0.12.2          vtnet0/resolve                  11   1500     vtnet0               1 +Routing entry for 10.0.24.0/24 
-1       v4/resolve 127.0.0.1          lo0/resolve        HS            6  16384        lo0               1 +  Known via "ospf", distance 110, metric 20, best 
-7       v4/resolve 127.0.0.1          lo0/resolve        HS            0  16384        lo0    vtnet2     1 +  Last update 00:06:39 ago 
-5       v4/resolve 127.0.0.1          lo0/resolve        HS            0  16384        lo0    vtnet1     1 +  10.0.112.2, via igb1, weight 1 
-3       v4/resolve 127.0.0.1          lo0/resolve        HS            0  16384        lo0    vtnet0     1 +  10.0.212.2, via igb2, weight 1
-9            v4/gw 10.0.24.2          10.0.24.4          GS           10   1500     vtnet2               2 +
-8            v4/gw 10.0.23.2          10.0.23.3          GS            2   1500     vtnet1               2 +
-Nexthop groups data +
-BUF: 192+
  
-Internet: +router1# exit 
-MpIdx NHIdx Weigh Slots            Gateway Netif      Refcnt +[root@router1]~# netstat -rn4 | grep 10.0.24.0/24 
-1      ---- ---- ----              ----      ----    1 +10.0.24.0/24       10.0.212.2         UG1        igb2 
-            100              10.0.24.4    vtnet2 +10.0.24.0/24       10.0.112.2         UG1        igb1
-            100              10.0.23.3    vtnet1+
 </code> </code>
  
-<code> +===== Test Load balancing IP packets =====
-[root@VM1]~# ping -c1 -R -S 10.0.12.21 10.0.56.26 +
-PING 10.0.56.26 (10.0.56.26) from 10.0.12.21: 56 data bytes+
  
---- 10.0.56.26 ping statistics --- +Flows from the client to the server should be "flow-id shared" between the 2 paths. Let's check using multiple sources and destination IP addresses. 
-1 packets transmitted, packets received, 100.0% packet loss + 
-</code>+^ Source ^ Destination ^ Ongoing path selected by R1 ^ Returning path selected by R2^ 
 +10.0.31.3 | 10.0.24.4 | igb1 | igb2 | 
 +| 10.0.31.3 | 10.0.24.14 | igb2 | igb1 | 
 +| 10.0.31.13 | 10.0.24.14 | igb2 | igb1 | 
 +| 10.0.31.23 | 10.0.24.24 | igb1 | igb2 | 
 +| 10.0.31.33 | 10.0.24.34 | igb2 | igb2 | 
 +| 10.0.31.43 | 10.0.24.44 | igb1 | igb2 | 
 +| 10.0.31.53 | 10.0.24.54 | igb1 | igb1 | 
 +| 2001:db8:31::3 | 2001:db8:24::4 | igb1 | igb1 | 
 +| 2001:db8:31::13 | 2001:db8:24::14 | igb1 | igb2 | 
 +| 2001:db8:31::23 | 2001:db8:24::24 | igb2 | igb2 | 
 +| 2001:db8:31::33 | 2001:db8:24::34 | igb2 | igb1 | 
 +| 2001:db8:31::43 | 2001:db8:24::44 | igb2 | igb1 |
documentation/examples/ecmp.txt · Last modified: 2022/12/11 18:40 by olivier

Except where otherwise noted, content on this wiki is licensed under the following license: BSD 2-Clause
Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki