documentation:examples:ecmp
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| documentation:examples:ecmp [2020/09/23 14:56] – [Checking routes installed] olivier | documentation:examples:ecmp [2025/01/17 18:53] (current) – [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 from [[https:// | ||
| ===== Presentation ===== | ===== Presentation ===== | ||
| Line 22: | Line 21: | ||
| ==== Client ==== | ==== Client ==== | ||
| - | A simple host with multiples aliases: | + | A simple host with static routes: |
| < | < | ||
| Line 28: | Line 27: | ||
| gateway_enable=NO \ | gateway_enable=NO \ | ||
| ipv6_gateway_enable=NO \ | ipv6_gateway_enable=NO \ | ||
| - | ifconfig_igb1=" | + | ifconfig_igb1=" |
| - | ifconfig_igb1_alias1=" | + | ifconfig_igb1_ipv6=" |
| - | ifconfig_igb1_alias2=" | + | route_LAB=" |
| - | ifconfig_igb1_alias3=" | + | static_routes=" |
| - | ifconfig_igb1_alias4=" | + | ipv6_static_routes=" |
| - | ifconfig_igb1_alias5=" | + | ipv6_route_LAB=" |
| - | ifconfig_igb1_ipv6=" | + | |
| - | ifconfig_igb1_alias61=" | + | |
| - | ifconfig_igb1_alias62=" | + | |
| - | ifconfig_igb1_alias63=" | + | |
| - | ifconfig_igb1_alias64=" | + | |
| - | ifconfig_igb1_alias65=" | + | |
| - | static_routes=" | + | |
| - | route_LAB=" | + | |
| - | ipv6_static_routes=" | + | |
| - | ipv6_route_LAB=" | + | |
| service hostname restart | service hostname restart | ||
| service netif restart | service netif restart | ||
| Line 55: | Line 44: | ||
| < | < | ||
| + | |||
| sysrc hostname=R1 \ | sysrc hostname=R1 \ | ||
| gateway_enable=YES \ | gateway_enable=YES \ | ||
| ipv6_gateway_enable=YES \ | ipv6_gateway_enable=YES \ | ||
| - | ifconfig_igb0=" | + | ifconfig_igb0=" |
| - | ifconfig_igb0_ipv6=" | + | ifconfig_igb0_ipv6=" |
| - | ifconfig_igb1=" | + | ifconfig_igb1=" |
| - | ifconfig_igb1_ipv6=" | + | ifconfig_igb1_ipv6=" |
| - | ifconfig_igb2=" | + | ifconfig_igb2=" |
| - | ifconfig_igb2_ipv6=" | + | ifconfig_igb2_ipv6=" |
| static_routes=" | static_routes=" | ||
| - | route_MPATH1=" | + | route_MPATH1=" |
| - | route_MPATH2=" | + | route_MPATH2=" |
| ipv6_static_routes=" | ipv6_static_routes=" | ||
| - | ipv6_route_MPATH1=" | + | ipv6_route_MPATH1=" |
| - | ipv6_route_MPATH2=" | + | ipv6_route_MPATH2=" |
| service hostname restart | service hostname restart | ||
| service netif restart | service netif restart | ||
| Line 79: | Line 69: | ||
| < | < | ||
| - | [root@R1]~# # netstat -rn4 | grep 10.0.0.0/ | + | root@R1:~ # netstat -rn4 | grep 10.0.0.0/ |
| - | 10.0.0.0/ | + | 10.0.0.0/ |
| - | 10.0.0.0/ | + | 10.0.0.0/ |
| - | [root@R1]~# route -n get 10.0.0.0/ | + | root@R1:~ # netstat -4onW |
| - | route to: 10.0.0.0 | + | |
| - | destination: | + | |
| - | mask: 255.255.0.0 | + | |
| - | gateway: 10.0.112.2 | + | |
| - | fib: 0 | + | |
| - | interface: igb1 | + | |
| - | flags: < | + | |
| - | | + | |
| - | | + | |
| - | + | ||
| - | [root@R1]~# netstat -4onW | + | |
| Nexthop data | Nexthop data | ||
| Internet: | Internet: | ||
| Idx | Idx | ||
| - | 1 | + | 1 |
| - | 2 | + | 2 |
| - | 3 | + | 3 |
| - | 4 | + | 4 |
| - | 5 | + | 5 |
| - | 6 | + | 6 |
| - | 7 | + | 7 |
| - | 8 v4/gw 10.0.112.1 10.0.112.2 GS 0 | + | 8 v4/gw 10.0.231.2 10.0.231.3 GS 0 |
| - | 9 v4/gw 10.0.212.1 10.0.212.2 GS 0 | + | 9 v4/gw 10.0.232.2 10.0.232.3 GS 0 |
| - | + | ||
| - | [root@R1]~# netstat -rn6 | grep 2001: | + | |
| - | 2001: | + | |
| - | 2001: | + | |
| - | + | ||
| - | [root@R1]~# route -n6 get 2001: | + | |
| - | route to: 2001: | + | |
| - | destination: | + | |
| - | mask: ffff: | + | |
| - | gateway: 2001: | + | |
| - | fib: 0 | + | |
| - | interface: igb2 | + | |
| - | flags: < | + | |
| - | | + | |
| - | | + | |
| - | [root@R1]~# netstat -6onW | + | root@R1:~ # netstat -6onW |
| Nexthop data | Nexthop data | ||
| Internet6: | Internet6: | ||
| Idx | Idx | ||
| - | 1 | + | 1 |
| - | 2 | + | 2 |
| - | 3 | + | 3 |
| - | 4 | + | 4 |
| - | 5 | + | 5 |
| - | 6 | + | 6 |
| - | 7 | + | 7 |
| - | 8 | + | 8 |
| - | 9 v6/resolve 2001: | + | 9 |
| - | 10 | + | 10 v6/gw ::1 :: |
| - | 11 v6/resolve ::1 | + | 11 v6/gw 2001:db8:231::2 2001:db8:231::3 GS 0 |
| - | 12 v6/gw ::1 :: | + | 12 v6/gw 2001:db8:232::2 2001:db8:232::3 GS 0 |
| - | 13 v6/gw 2001:db8:112::1 2001:db8:112::2 GS 0 | + | |
| - | 14 v6/gw 2001:db8:212::1 2001:db8:212::2 GS | + | |
| - | 15 v6/resolve 2001: | + | |
| </ | </ | ||
| + | ==== R2 (ECMP router) ==== | ||
| - | + | R2 is like R1, a router with ECMP: 2 static routing toward the same destination but using 2 different next-hop.. | |
| - | Look like this router will prefer igb1 for inet4 and igb2 for inet6. | + | |
| - | + | ||
| - | ==== R5 (ECMP router) ==== | + | |
| - | + | ||
| - | R5 is like R2, a router with ECMP: 2 static routing toward the same destination but using 2 different next-hop.. | + | |
| < | < | ||
| Line 157: | Line 114: | ||
| gateway_enable=YES \ | gateway_enable=YES \ | ||
| ipv6_gateway_enable=YES \ | ipv6_gateway_enable=YES \ | ||
| - | ifconfig_igb0=" | + | ifconfig_igb0=" |
| - | ifconfig_igb0_ipv6=" | + | ifconfig_igb0_ipv6=" |
| - | ifconfig_igb1=" | + | ifconfig_igb1=" |
| - | ifconfig_igb1_ipv6=" | + | ifconfig_igb1_ipv6=" |
| - | ifconfig_igb2=" | + | ifconfig_igb2=" |
| - | ifconfig_igb2_ipv6=" | + | ifconfig_igb2_ipv6=" |
| static_routes=" | static_routes=" | ||
| - | route_MPATH1=" | + | route_MPATH1=" |
| - | route_MPATH2=" | + | route_MPATH2=" |
| ipv6_static_routes=" | ipv6_static_routes=" | ||
| - | ipv6_route_MPATH1=" | + | ipv6_route_MPATH1=" |
| - | ipv6_route_MPATH2=" | + | ipv6_route_MPATH2=" |
| service hostname restart | service hostname restart | ||
| service netif restart | service netif restart | ||
| Line 174: | Line 131: | ||
| config save | config save | ||
| </ | </ | ||
| - | |||
| - | And checking: | ||
| - | < | ||
| - | # route get 10.0.0.0/16 | ||
| - | route to: 10.0.0.0 | ||
| - | destination: | ||
| - | mask: 255.255.0.0 | ||
| - | gateway: 10.0.212.1 | ||
| - | fib: 0 | ||
| - | interface: igb2 | ||
| - | flags: < | ||
| - | | ||
| - | | ||
| - | |||
| - | |||
| - | # route -6 get 2001: | ||
| - | route to: 2001:db8:: | ||
| - | destination: | ||
| - | mask: ffff:ffff:: | ||
| - | gateway: 2001: | ||
| - | fib: 0 | ||
| - | interface: igb1 | ||
| - | flags: < | ||
| - | | ||
| - | | ||
| - | |||
| - | </ | ||
| - | |||
| - | Look like this router will prefer to use igb2 for inet4 and igb1 for inet6. | ||
| - | |||
| ==== Server ==== | ==== Server ==== | ||
| - | A simple host with multiple aliases: | + | A simple host with some static routes: |
| < | < | ||
| Line 212: | Line 139: | ||
| gateway_enable=NO \ | gateway_enable=NO \ | ||
| ipv6_gateway_enable=NO \ | ipv6_gateway_enable=NO \ | ||
| - | | + | |
| - | | + | |
| - | ifconfig_vr0_alias2=" | + | |
| - | ifconfig_vr0_alias3=" | + | |
| - | ifconfig_vr0_alias4=" | + | |
| - | ifconfig_vr0_alias5=" | + | |
| - | ifconfig_vr0_ipv6=" | + | |
| - | ifconfig_vr0_alias61=" | + | |
| - | ifconfig_vr0_alias62=" | + | |
| - | ifconfig_vr0_alias63=" | + | |
| - | ifconfig_vr0_alias64=" | + | |
| - | ifconfig_vr0_alias65=" | + | |
| static_routes=" | static_routes=" | ||
| - | route_LAB=" | + | route_LAB=" |
| ipv6_static_routes=" | ipv6_static_routes=" | ||
| - | ipv6_route_LAB=" | + | ipv6_route_LAB=" |
| service hostname restart | service hostname restart | ||
| service netif restart | service netif restart | ||
| Line 240: | Line 157: | ||
| ==== R1 (ECMP router) ==== | ==== R1 (ECMP router) ==== | ||
| - | In place of static routes, FRR is enabled: | + | In place of static routes, |
| < | < | ||
| Line 250: | Line 167: | ||
| cat > / | cat > / | ||
| - | frr version | + | frr version |
| frr defaults traditional | frr defaults traditional | ||
| - | hostname | + | hostname |
| + | ! | ||
| + | interface igb0 | ||
| + | ip ospf passive | ||
| + | ipv6 ospf6 area 0.0.0.0 | ||
| + | ipv6 ospf6 passive | ||
| + | exit | ||
| + | ! | ||
| + | interface igb1 | ||
| + | ipv6 ospf6 area 0.0.0.0 | ||
| + | exit | ||
| + | ! | ||
| + | interface igb2 | ||
| + | ipv6 ospf6 area 0.0.0.0 | ||
| + | exit | ||
| ! | ! | ||
| router ospf | router ospf | ||
| ospf router-id 1.1.1.1 | ospf router-id 1.1.1.1 | ||
| - | passive-interface igb0 | + | |
| - | network 10.0.31.0/24 area 0 | + | |
| - | | + | |
| - | | + | exit |
| ! | ! | ||
| - | line vty | + | router ospf6 |
| + | exit | ||
| ! | ! | ||
| EOF | EOF | ||
| Line 270: | Line 202: | ||
| ==== R2 (ECMP router) ==== | ==== R2 (ECMP router) ==== | ||
| - | In place of static routes, | + | Same as R1 with OSPF and FRR: |
| < | < | ||
| sysrc frr_vtysh_boot=" | sysrc frr_vtysh_boot=" | ||
| frr_enable=" | frr_enable=" | ||
| - | frr_daemons=" | + | frr_daemons=" |
| watchfrr_flags=" | watchfrr_flags=" | ||
| watchfrr_enable=" | watchfrr_enable=" | ||
| cat > / | cat > / | ||
| - | frr version | + | frr version |
| frr defaults traditional | frr defaults traditional | ||
| - | hostname | + | hostname |
| + | ! | ||
| + | ip route 10.0.0.0/16 10.0.34.4 | ||
| + | ipv6 route 2001: | ||
| + | ! | ||
| + | interface igb0 | ||
| + | ip ospf passive | ||
| + | ipv6 ospf6 area 0.0.0.0 | ||
| + | ipv6 ospf6 passive | ||
| + | exit | ||
| + | ! | ||
| + | interface igb1 | ||
| + | ipv6 ospf6 area 0.0.0.0 | ||
| + | exit | ||
| + | ! | ||
| + | interface igb2 | ||
| + | ipv6 ospf6 area 0.0.0.0 | ||
| + | exit | ||
| ! | ! | ||
| router ospf | router ospf | ||
| ospf router-id 2.2.2.2 | ospf router-id 2.2.2.2 | ||
| - | passive-interface igb0 | + | redistribute static |
| - | | + | |
| - | | + | |
| - | | + | |
| + | exit | ||
| ! | ! | ||
| - | line vty | + | router ospf6 |
| + | | ||
| + | exit | ||
| ! | ! | ||
| EOF | EOF | ||
| Line 301: | Line 253: | ||
| On R1: | On R1: | ||
| < | < | ||
| - | [root@router1]~# vtysh | + | root@R1:~ # vtysh |
| - | + | Hello, this is FRRouting (version | |
| - | Hello, this is FRRouting (version | + | |
| Copyright 1996-2005 Kunihiro Ishiguro, et al. | Copyright 1996-2005 Kunihiro Ishiguro, et al. | ||
| - | homelab1# sh ip route 10.0.24.0/24 | + | R1# sh ip route 10.0.0.0 |
| - | Routing entry for 10.0.24.0/24 | + | Routing entry for 10.0.0.0/16 |
| Known via " | Known via " | ||
| - | Last update 00:06:39 ago | + | Last update 00:02:26 ago |
| - | * 10.0.112.2, via igb1, weight 1 | + | * 10.0.231.3, via igb1, weight 1 |
| - | * 10.0.212.2, via igb2, weight 1 | + | * 10.0.232.3, via igb2, weight 1 |
| - | router1# exit | + | R1# sh ipv6 route 2001:db8:: |
| - | [root@router1]~# | + | Routing entry for 2001:db8::/32 |
| - | 10.0.24.0/ | + | Known via " |
| - | 10.0.24.0/ | + | Last update 00:02:39 ago |
| + | * fe80:: | ||
| + | * fe80:: | ||
| </ | </ | ||
| ===== Test Load balancing IP packets ===== | ===== Test Load balancing IP packets ===== | ||
| - | Flows from the client to the server should be " | + | Flows from the client to the server should be " |
| + | |||
| + | On server: | ||
| + | < | ||
| + | root@server: | ||
| + | </ | ||
| + | |||
| + | On client: | ||
| + | < | ||
| + | root@client: | ||
| + | </ | ||
| + | |||
| + | On R1: | ||
| + | < | ||
| + | systat -ifstat -match igb0, | ||
| + | |||
| + | /0 / | ||
| + | Load Average | ||
| + | |||
| + | Interface | ||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | | ||
| + | |||
| + | </ | ||
| + | |||
| + | => We confirm that 20 Kps entering igb0 and are equally split by exiting by igb1 and igb2 | ||
| + | |||
| + | On R2: | ||
| + | < | ||
| + | systat -ifstat -match igb0, | ||
| + | |||
| + | /0 / | ||
| + | Load Average | ||
| + | |||
| + | Interface | ||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | => R2 has no choice than receiving packets from igb1 and igb2, and forwarding them through igb0. | ||
| - | ^ 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: | ||
| - | | 2001: | ||
| - | | 2001: | ||
| - | | 2001: | ||
| - | | 2001: | ||
documentation/examples/ecmp.1600865813.txt.gz · Last modified: by olivier
