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/09/21 13:05] – [Testing Load balancing] olivierdocumentation:examples:ecmp [2020/09/23 14:56] – [Checking routes installed] olivier
Line 20: Line 20:
 ===== 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 \
Line 50: 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 \
   gateway_enable=YES \   gateway_enable=YES \
   ipv6_gateway_enable=YES \   ipv6_gateway_enable=YES \
Line 79: Line 79:
  
 <code> <code>
-[root@VM2]~# # netstat -rn4 | grep 10.0.0.0/16+[root@R1]~# # netstat -rn4 | grep 10.0.0.0/16
 10.0.0.0/16        10.0.112.2         UGS        igb1 10.0.0.0/16        10.0.112.2         UGS        igb1
 10.0.0.0/16        10.0.212.2         UGS        igb2 10.0.0.0/16        10.0.212.2         UGS        igb2
  
-[root@VM2]~# route -n get 10.0.0.0/16+[root@R1]~# route -n get 10.0.0.0/16
    route to: 10.0.0.0    route to: 10.0.0.0
 destination: 10.0.0.0 destination: 10.0.0.0
Line 94: Line 94:
                                     1500                 0                                     1500                 0
  
-[root@VM2]~# netstat -4onW+[root@R1]~# netstat -4onW
 Nexthop data Nexthop data
  
Line 109: Line 109:
 9            v4/gw 10.0.212.1         10.0.212.2         GS            0   1500       igb2               1 9            v4/gw 10.0.212.1         10.0.212.2         GS            0   1500       igb2               1
          
-[root@VM2]~# netstat -rn6 | grep 2001:db8::/32+[root@R1]~# netstat -rn6 | grep 2001:db8::/32
 2001:db8::/32                     2001:db8:212::              UGS        igb2 2001:db8::/32                     2001:db8:212::              UGS        igb2
 2001:db8::/32                     2001:db8:112::              UGS        igb1 2001:db8::/32                     2001:db8:112::              UGS        igb1
              
-[root@VM2]~# route -n6 get 2001:db8::/32+[root@R1]~# route -n6 get 2001:db8::/32
    route to: 2001:db8::    route to: 2001:db8::
 destination: 2001:db8:: destination: 2001:db8::
Line 124: Line 124:
                                     1500                 0                                     1500                 0
  
-[root@VM2]~# netstat -6onW+[root@R1]~# netstat -6onW
 Nexthop data Nexthop data
  
Line 149: Line 149:
 Look like this router will prefer igb1 for inet4 and igb2 for inet6. Look like this router will prefer igb1 for inet4 and igb2 for inet6.
  
-==== VM 5 (ECMP router) ====+==== R5 (ECMP router) ====
  
-VM 5 is like VM 2, a router with ECMP: 2 static routing toward the same destination but using 2 different next-hop..+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=VM5 \+sysrc hostname=R2 \
   gateway_enable=YES \   gateway_enable=YES \
   ipv6_gateway_enable=YES \   ipv6_gateway_enable=YES \
Line 204: Line 204:
 Look like this router will prefer to use igb2 for inet4 and igb1 for inet6. Look like this router will prefer to use igb2 for inet4 and igb1 for inet6.
  
-==== VM 6 (server) ====+==== 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 \
Line 234: Line 234:
 </code> </code>
  
-==== Testing Load balancing ====+===== FRR Multipath setup ===== 
 + 
 +Replacing static routes by FRR (OSPF) compiled with MULTIPATH option. 
 + 
 +==== R1 (ECMP router) ==== 
 + 
 +In place of static routes, FRR 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" 
 + 
 +cat > /usr/local/etc/frr/frr.conf <EOF 
 +frr version 7.4 
 +frr defaults traditional 
 +hostname router1 
 +
 +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 
 +
 +line vty 
 +
 +EOF 
 +service frr start 
 +service watchfrr start 
 +</code> 
 + 
 +==== R2 (ECMP router) ==== 
 + 
 +In place of static routes, FRR 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" 
 + 
 +cat > /usr/local/etc/frr/frr.conf <EOF 
 +frr version 7.4 
 +frr defaults traditional 
 +hostname router2 
 +
 +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 
 +
 +line vty 
 +
 +EOF 
 +service frr start 
 +service watchfrr start 
 +</code> 
 + 
 +==== Checking routes installed ==== 
 + 
 +On R1: 
 +<code> 
 +[root@router1]~# vtysh 
 + 
 +Hello, this is FRRouting (version 7.4). 
 +Copyright 1996-2005 Kunihiro Ishiguro, et al. 
 + 
 +homelab1# sh ip route 10.0.24.0/24 
 +Routing entry for 10.0.24.0/24 
 +  Known via "ospf", distance 110, metric 20, best 
 +  Last update 00:06:39 ago 
 +  * 10.0.112.2, via igb1, weight 1 
 +  * 10.0.212.2, via igb2, weight 1 
 + 
 +router1# exit 
 +[root@router1]~# netstat -rn4 | grep 10.0.24.0/24 
 +10.0.24.0/24       10.0.212.2         UG1        igb2 
 +10.0.24.0/24       10.0.112.2         UG1        igb1 
 +</code> 
 + 
 +===== Test Load balancing IP packets =====
  
 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. 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.
Line 240: Line 325:
 ^ Source ^ Destination ^ Ongoing path selected by R1 ^ Returning path selected by R2^ ^ 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.4 | igb1 | igb2 |
-| 10.0.31.13 | 10.0.24.14 | igb1 | igb1 |+| 10.0.31.| 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.23 | 10.0.24.24 | igb1 | igb2 |
-| 10.0.31.33 | 10.0.24.34 | igb1 | igb2 +| 10.0.31.33 | 10.0.24.34 | igb2 | igb2 |
-| 10.0.31.43 | 10.0.24.44 | igb1 | igb1 |+
 | 10.0.31.43 | 10.0.24.44 | igb1 | 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::3 | 2001:db8:24::4 | igb1 | igb1 |
 | 2001:db8:31::13 | 2001:db8:24::14 | igb1 | igb2 | | 2001:db8:31::13 | 2001:db8:24::14 | igb1 | igb2 |
documentation/examples/ecmp.txt · Last modified: 2024/03/28 23:19 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