1 # SPDX-License-Identifier: GPL-2.0
3 # This is the standard topology for testing mirroring to gretap and ip6gretap
4 # netdevices. The tests that use it tweak it in one way or another--importantly,
5 # $swp3 and $h3 need to have addresses set up.
7 # +---------------------+ +---------------------+
10 # | | 192.0.2.1/28 | | 192.0.2.2/28 | |
11 # +-----|---------------+ +---------------|-----+
13 # +-----|-------------------------------------------------------------|-----+
14 # | SW o--> mirror | |
15 # | +---|-------------------------------------------------------------|---+ |
16 # | | + $swp1 BR $swp2 + | |
17 # | +---------------------------------------------------------------------+ |
19 # | + $swp3 + gt6 (ip6gretap) + gt4 (gretap) |
20 # | | : loc=2001:db8:2::1 : loc=192.0.2.129 |
21 # | | : rem=2001:db8:2::2 : rem=192.0.2.130 |
22 # | | : ttl=100 : ttl=100 |
23 # | | : tos=inherit : tos=inherit |
25 # +-----|---------------------:----------------------:----------------------+
27 # +-----|---------------------:----------------------:----------------------+
28 # | H3 + $h3 + h3-gt6 (ip6gretap) + h3-gt4 (gretap) |
29 # | loc=2001:db8:2::2 loc=192.0.2.130 |
30 # | rem=2001:db8:2::1 rem=192.0.2.129 |
32 # | tos=inherit tos=inherit |
34 # +-------------------------------------------------------------------------+
36 source "$relative_path/mirror_topo_lib.sh"
38 mirror_gre_topo_h3_create()
42 tunnel_create h3-gt4 gretap 192.0.2.130 192.0.2.129
43 ip link set h3-gt4 vrf v$h3
44 matchall_sink_create h3-gt4
46 tunnel_create h3-gt6 ip6gretap 2001:db8:2::2 2001:db8:2::1
47 ip link set h3-gt6 vrf v$h3
48 matchall_sink_create h3-gt6
51 mirror_gre_topo_h3_destroy()
56 mirror_topo_h3_destroy
59 mirror_gre_topo_switch_create()
61 mirror_topo_switch_create
63 tunnel_create gt4 gretap 192.0.2.129 192.0.2.130 \
66 tunnel_create gt6 ip6gretap 2001:db8:2::1 2001:db8:2::2 \
67 ttl 100 tos inherit allow-localremote
70 mirror_gre_topo_switch_destroy()
75 mirror_topo_switch_destroy
78 mirror_gre_topo_create()
82 mirror_gre_topo_h3_create
84 mirror_gre_topo_switch_create
87 mirror_gre_topo_destroy()
89 mirror_gre_topo_switch_destroy
91 mirror_gre_topo_h3_destroy
92 mirror_topo_h2_destroy
93 mirror_topo_h1_destroy