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

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

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/net/forwarding/tc_mpls_l2vpn.sh
Extension
.sh
Size
5146 bytes
Lines
193
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 (v$h1)             |
# | 192.0.2.1/24          |
# | 2001:db8::1/124       |
# |                 + $h1 |
# +-----------------|-----+
#                   |
#                   | (Plain Ethernet traffic)
#                   |
# +-----------------|-----------------------------------------+
# | LER1            + $edge1                                  |
# |                     -ingress:                             |
# |                       -encapsulate Ethernet into MPLS     |
# |                       -add outer Ethernet header          |
# |                       -redirect to $mpls1 (egress)        |
# |                                                           |
# |                 + $mpls1                                  |
# |                 |   -ingress:                             |
# |                 |     -remove outer Ethernet header       |
# |                 |     -remove MPLS header                 |
# |                 |     -redirect to $edge1 (egress)        |
# +-----------------|-----------------------------------------+
#                   |
#                   | (Ethernet over MPLS traffic)
#                   |
# +-----------------|-----------------------------------------+
# | LER2            + $mpls2                                  |
# |                     -ingress:                             |
# |                       -remove outer Ethernet header       |
# |                       -remove MPLS header                 |
# |                       -redirect to $edge2 (egress)        |
# |                                                           |
# |                 + $edge2                                  |
# |                 |   -ingress:                             |
# |                 |     -encapsulate Ethernet into MPLS     |
# |                 |     -add outer Ethernet header          |
# |                 |     -redirect to $mpls2 (egress)        |
# +-----------------|-----------------------------------------|
#                   |
#                   | (Plain Ethernet traffic)
#                   |
# +-----------------|-----+
# | H2 (v$h2)       |     |
# |                 + $h2 |
# | 192.0.2.2/24          |
# | 2001:db8::2/124       |
# +-----------------------+
#
# LER1 and LER2 logically represent two different routers. However, no VRF is
# created for them, as they don't do any IP routing.

ALL_TESTS="mpls_forward_eth"
NUM_NETIFS=6
source lib.sh

h1_create()
{
	simple_if_init $h1 192.0.2.1/24 2001:db8::1/124
}

h1_destroy()
{
	simple_if_fini $h1 192.0.2.1/24 2001:db8::1/124
}

h2_create()
{

Annotation

Implementation Notes