1 # SPDX-License-Identifier: GPL-2.0
3 # This is the standard topology for testing mirroring. The tests that use it
4 # tweak it in one way or another--typically add more devices to the topology.
6 # +---------------------+ +---------------------+
9 # | | 192.0.2.1/28 | | 192.0.2.2/28 | |
10 # +-----|---------------+ +---------------|-----+
12 # +-----|-------------------------------------------------------------|-----+
13 # | SW o--> mirror | |
14 # | +---|-------------------------------------------------------------|---+ |
15 # | | + $swp1 BR $swp2 + | |
16 # | +---------------------------------------------------------------------+ |
19 # +-----|-------------------------------------------------------------------+
21 # +-----|-------------------------------------------------------------------+
24 # +-------------------------------------------------------------------------+
26 mirror_topo_h1_create()
28 simple_if_init $h1 192.0.2.1/28
31 mirror_topo_h1_destroy()
33 simple_if_fini $h1 192.0.2.1/28
36 mirror_topo_h2_create()
38 simple_if_init $h2 192.0.2.2/28
41 mirror_topo_h2_destroy()
43 simple_if_fini $h2 192.0.2.2/28
46 mirror_topo_h3_create()
49 tc qdisc add dev $h3 clsact
52 mirror_topo_h3_destroy()
54 tc qdisc del dev $h3 clsact
58 mirror_topo_switch_create()
60 ip link set dev $swp3 up
62 ip link add name br1 type bridge vlan_filtering 1
63 ip link set dev br1 up
65 ip link set dev $swp1 master br1
66 ip link set dev $swp1 up
68 ip link set dev $swp2 master br1
69 ip link set dev $swp2 up
71 tc qdisc add dev $swp1 clsact
74 mirror_topo_switch_destroy()
76 tc qdisc del dev $swp1 clsact
78 ip link set dev $swp1 down
79 ip link set dev $swp2 down
82 ip link set dev $swp3 down
91 mirror_topo_switch_create
96 mirror_topo_switch_destroy
98 mirror_topo_h3_destroy
99 mirror_topo_h2_destroy
100 mirror_topo_h1_destroy