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

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

File Facts

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

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

# Handles creation and destruction of IP-in-IP or GRE tunnels over the given
# topology. Supports both flat and hierarchical models.
#
# Flat Model:
# Overlay and underlay share the same VRF.
# SW1 uses default VRF so tunnel has no bound dev.
# SW2 uses non-default VRF tunnel has a bound dev.
# +--------------------------------+
# | H1                             |
# |                     $h1 +      |
# |        198.51.100.1/24  |      |
# |        2001:db8:1::1/64 |      |
# +-------------------------|------+
#                           |
# +-------------------------|-------------------+
# | SW1                     |                   |
# |                    $ol1 +                   |
# |        198.51.100.2/24                      |
# |        2001:db8:1::2/64                     |
# |                                             |
# |      + g1a (ip6gre)                         |
# |        loc=2001:db8:3::1                    |
# |        rem=2001:db8:3::2 --.                |
# |        tos=inherit         |                |
# |                            .                |
# |      .---------------------                 |
# |      |                                      |
# |      v                                      |
# |      + $ul1.111 (vlan)                      |
# |      | 2001:db8:10::1/64                    |
# |       \                                     |
# |        \____________                        |
# |                     |                       |
# | VRF default         + $ul1                  |
# +---------------------|-----------------------+
#                       |
# +---------------------|-----------------------+
# | SW2                 |                       |
# |                $ul2 +                       |
# |          ___________|                       |
# |         /                                   |
# |        /                                    |
# |       + $ul2.111 (vlan)                     |
# |       ^ 2001:db8:10::2/64                   |
# |       |                                     |
# |       |                                     |
# |       '----------------------.              |
# |       + g2a (ip6gre)         |              |
# |         loc=2001:db8:3::2    |              |
# |         rem=2001:db8:3::1  --'              |
# |         tos=inherit                         |
# |                                             |
# |                     + $ol2                  |
# |                     | 203.0.113.2/24        |
# | VRF v$ol2           | 2001:db8:2::2/64      |
# +---------------------|-----------------------+
# +---------------------|----------+
# | H2                  |          |
# |                 $h2 +          |
# |    203.0.113.1/24              |
# |    2001:db8:2::1/64            |
# +--------------------------------+
#
# Hierarchical model:
# The tunnel is bound to a device in a different VRF
#
# +--------------------------------+

Annotation

Implementation Notes