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

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

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/net/forwarding/mirror_gre_bound.sh
Extension
.sh
Size
5640 bytes
Lines
207
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

#   +---------------------+                             +---------------------+
#   | H1                  |                             |                  H2 |
#   |     + $h1           |                             |           $h2 +     |
#   |     | 192.0.2.1/28  |                             |  192.0.2.2/28 |     |
#   +-----|---------------+                             +---------------|-----+
#         |                                                             |
#   +-----|-------------------------------------------------------------|-----+
#   | SW  o--> mirror                                                   |     |
#   | +---|-------------------------------------------------------------|---+ |
#   | |   + $swp1                    BR                           $swp2 +   | |
#   | +---------------------------------------------------------------------+ |
#   |                                                                         |
#   | +---------------------------------------------------------------------+ |
#   | | OL                      + gt6 (ip6gretap)      + gt4 (gretap)       | |
#   | |                         : loc=2001:db8:2::1    : loc=192.0.2.129    | |
#   | |                         : rem=2001:db8:2::2    : rem=192.0.2.130    | |
#   | |                         : ttl=100              : ttl=100            | |
#   | |                         : tos=inherit          : tos=inherit        | |
#   | +-------------------------:--|-------------------:--|-----------------+ |
#   |                           :  |                   :  |                   |
#   | +-------------------------:--|-------------------:--|-----------------+ |
#   | | UL                      :  |,---------------------'                 | |
#   | |   + $swp3               :  ||                  :                    | |
#   | |   | 192.0.2.129/28      :  vv                  :                    | |
#   | |   | 2001:db8:2::1/64    :  + ul (dummy)        :                    | |
#   | +---|---------------------:----------------------:--------------------+ |
#   +-----|---------------------:----------------------:----------------------+
#         |                     :                      :
#   +-----|---------------------:----------------------:----------------------+
#   | H3  + $h3                 + h3-gt6 (ip6gretap)   + h3-gt4 (gretap)      |
#   |       192.0.2.130/28        loc=2001:db8:2::2      loc=192.0.2.130      |
#   |       2001:db8:2::2/64      rem=2001:db8:2::1      rem=192.0.2.129      |
#   |                             ttl=100                ttl=100              |
#   |                             tos=inherit            tos=inherit          |
#   |                                                                         |
#   +-------------------------------------------------------------------------+
#
# This tests mirroring to gretap and ip6gretap configured in an overlay /
# underlay manner, i.e. with a bound dummy device that marks underlay VRF where
# the encapsulated packed should be routed.

ALL_TESTS="
	test_gretap
	test_ip6gretap
"

NUM_NETIFS=6
source lib.sh
source mirror_lib.sh
source mirror_gre_lib.sh

h1_create()
{
	simple_if_init $h1 192.0.2.1/28
}

h1_destroy()
{
	simple_if_fini $h1 192.0.2.1/28
}

h2_create()
{
	simple_if_init $h2 192.0.2.2/28
}

h2_destroy()

Annotation

Implementation Notes