tools/testing/selftests/net/forwarding/gre_multipath.sh

Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/forwarding/gre_multipath.sh

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/net/forwarding/gre_multipath.sh
Extension
.sh
Size
6426 bytes
Lines
258
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: tools
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

#!/bin/bash
# SPDX-License-Identifier: GPL-2.0

# Test traffic distribution when a wECMP route forwards traffic to two GRE
# tunnels.
#
# +-------------------------+
# | H1                      |
# |               $h1 +     |
# |      192.0.2.1/28 |     |
# +-------------------|-----+
#                     |
# +-------------------|------------------------+
# | SW1               |                        |
# |              $ol1 +                        |
# |      192.0.2.2/28                          |
# |                                            |
# |  + g1a (gre)          + g1b (gre)          |
# |    loc=192.0.2.65       loc=192.0.2.81     |
# |    rem=192.0.2.66 --.   rem=192.0.2.82 --. |
# |    tos=inherit      |   tos=inherit      | |
# |  .------------------'                    | |
# |  |                    .------------------' |
# |  v                    v                    |
# |  + $ul1.111 (vlan)    + $ul1.222 (vlan)    |
# |  | 192.0.2.129/28     | 192.0.2.145/28     |
# |   \                  /                     |
# |    \________________/                      |
# |            |                               |
# |            + $ul1                          |
# +------------|-------------------------------+
#              |
# +------------|-------------------------------+
# | SW2        + $ul2                          |
# |     _______|________                       |
# |    /                \                      |
# |   /                  \                     |
# |  + $ul2.111 (vlan)    + $ul2.222 (vlan)    |
# |  ^ 192.0.2.130/28     ^ 192.0.2.146/28     |
# |  |                    |                    |
# |  |                    '------------------. |
# |  '------------------.                    | |
# |  + g2a (gre)        | + g2b (gre)        | |
# |    loc=192.0.2.66   |   loc=192.0.2.82   | |
# |    rem=192.0.2.65 --'   rem=192.0.2.81 --' |
# |    tos=inherit          tos=inherit        |
# |                                            |
# |              $ol2 +                        |
# |     192.0.2.17/28 |                        |
# +-------------------|------------------------+
#                     |
# +-------------------|-----+
# | H2                |     |
# |               $h2 +     |
# |     192.0.2.18/28       |
# +-------------------------+

ALL_TESTS="
	ping_ipv4
	multipath_ipv4
"

NUM_NETIFS=6
source lib.sh

h1_create()
{
	simple_if_init $h1 192.0.2.1/28
	ip route add vrf v$h1 192.0.2.16/28 via 192.0.2.2
}

Annotation

Implementation Notes