documentation:examples:ecmp
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
documentation:examples:ecmp [2020/09/21 13:05] – [Testing Load balancing] olivier | documentation:examples:ecmp [2020/09/23 14:56] – [FRR Multipath setup] 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: | + | A simple host with multiples aliases: |
< | < | ||
- | sysrc hostname=VM1 \ | + | sysrc hostname=client |
gateway_enable=NO \ | gateway_enable=NO \ | ||
ipv6_gateway_enable=NO \ | ipv6_gateway_enable=NO \ | ||
Line 50: | Line 50: | ||
</ | </ | ||
- | ==== 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. |
< | < | ||
- | sysrc hostname=VM2 \ | + | sysrc hostname=R1 \ |
gateway_enable=YES \ | gateway_enable=YES \ | ||
ipv6_gateway_enable=YES \ | ipv6_gateway_enable=YES \ | ||
Line 79: | Line 79: | ||
< | < | ||
- | [root@VM2]~# # netstat -rn4 | grep 10.0.0.0/16 | + | [root@R1]~# # netstat -rn4 | grep 10.0.0.0/16 |
10.0.0.0/ | 10.0.0.0/ | ||
10.0.0.0/ | 10.0.0.0/ | ||
- | [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: | destination: | ||
Line 94: | Line 94: | ||
| | ||
- | [root@VM2]~# netstat -4onW | + | [root@R1]~# netstat -4onW |
Nexthop data | Nexthop data | ||
Line 109: | Line 109: | ||
9 v4/gw 10.0.212.1 | 9 v4/gw 10.0.212.1 | ||
| | ||
- | [root@VM2]~# netstat -rn6 | grep 2001: | + | [root@R1]~# netstat -rn6 | grep 2001: |
2001: | 2001: | ||
2001: | 2001: | ||
| | ||
- | [root@VM2]~# route -n6 get 2001: | + | [root@R1]~# route -n6 get 2001: |
route to: 2001:db8:: | route to: 2001:db8:: | ||
destination: | destination: | ||
Line 124: | Line 124: | ||
| | ||
- | [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.. |
< | < | ||
- | 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: | + | A simple host with multiple aliases: |
< | < | ||
- | sysrc hostname=VM6 \ | + | sysrc hostname=server |
gateway_enable=NO \ | gateway_enable=NO \ | ||
ipv6_gateway_enable=NO \ | ipv6_gateway_enable=NO \ | ||
Line 234: | Line 234: | ||
</ | </ | ||
- | ==== 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: | ||
+ | |||
+ | < | ||
+ | sysrc frr_vtysh_boot=" | ||
+ | frr_enable=" | ||
+ | frr_daemons=" | ||
+ | watchfrr_flags=" | ||
+ | watchfrr_enable=" | ||
+ | |||
+ | cat > / | ||
+ | frr version 7.4 | ||
+ | frr defaults traditional | ||
+ | hostname router1 | ||
+ | ! | ||
+ | router ospf | ||
+ | ospf router-id 1.1.1.1 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | ! | ||
+ | line vty | ||
+ | ! | ||
+ | EOF | ||
+ | service frr start | ||
+ | service watchfrr start | ||
+ | </ | ||
+ | |||
+ | ==== R2 (ECMP router) ==== | ||
+ | |||
+ | In place of static routes, FRR is enabled: | ||
+ | < | ||
+ | sysrc frr_vtysh_boot=" | ||
+ | frr_enable=" | ||
+ | frr_daemons=" | ||
+ | watchfrr_flags=" | ||
+ | watchfrr_enable=" | ||
+ | |||
+ | cat > / | ||
+ | frr version 7.4 | ||
+ | frr defaults traditional | ||
+ | hostname router2 | ||
+ | ! | ||
+ | router ospf | ||
+ | ospf router-id 2.2.2.2 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | ! | ||
+ | line vty | ||
+ | ! | ||
+ | EOF | ||
+ | service frr start | ||
+ | service watchfrr start | ||
+ | </ | ||
+ | |||
+ | ==== Checking routes installed ==== | ||
+ | |||
+ | On R1: | ||
+ | < | ||
+ | [root@router1]~# | ||
+ | |||
+ | Hello, this is FRRouting (version 7.4). | ||
+ | Copyright 1996-2005 Kunihiro Ishiguro, et al. | ||
+ | |||
+ | homelab1# sh ip route 10.0.24.0/ | ||
+ | Routing entry for 10.0.24.0/ | ||
+ | Known via " | ||
+ | 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]~# | ||
+ | 10.0.24.0/ | ||
+ | 10.0.24.0/ | ||
+ | </ | ||
+ | |||
+ | === Testing Load balancing === | ||
Flows from the client to the server should be " | Flows from the client to the server should be " | ||
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.3 | 10.0.24.14 |
+ | | 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: | | 2001: | ||
| 2001: | | 2001: |
documentation/examples/ecmp.txt · Last modified: 2024/03/28 23:19 by olivier