2 # SPDX-License-Identifier: GPL-2.0
4 # +-------------------------+ +-------------------------+
7 # | 192.0.2.2/24 | | | 198.51.100.2/24 | |
8 # | 2001:db8:1::2/64 | | | 2001:db8:2::2/64 | |
9 # +-------------------|-----+ +-------------------|-----+
11 # +-------------------|----------------------------|-----+
14 # | 192.0.2.1/24 198.51.100.1/24 |
15 # | 2001:db8:1::1/64 2001:db8:2::1/64 |
16 # +------------------------------------------------------+
30 ip link
set dev
$h1 master vrf-h1
32 ip link
set dev vrf-h1 up
33 ip link
set dev
$h1 up
35 ip address add
192.0.2.2/24 dev
$h1
36 ip address add
2001:db8
:1::2/64 dev
$h1
38 ip route add
198.51.100.0/24 vrf vrf-h1 nexthop via
192.0.2.1
39 ip route add
2001:db8
:2::/64 vrf vrf-h1 nexthop via
2001:db8
:1::1
44 ip route del
2001:db8
:2::/64 vrf vrf-h1
45 ip route del
198.51.100.0/24 vrf vrf-h1
47 ip address del
2001:db8
:1::2/64 dev
$h1
48 ip address del
192.0.2.2/24 dev
$h1
50 ip link
set dev
$h1 down
57 ip link
set dev
$h2 master vrf-h2
59 ip link
set dev vrf-h2 up
60 ip link
set dev
$h2 up
62 ip address add
198.51.100.2/24 dev
$h2
63 ip address add
2001:db8
:2::2/64 dev
$h2
65 ip route add
192.0.2.0/24 vrf vrf-h2 nexthop via
198.51.100.1
66 ip route add
2001:db8
:1::/64 vrf vrf-h2 nexthop via
2001:db8
:2::1
71 ip route del
2001:db8
:1::/64 vrf vrf-h2
72 ip route del
192.0.2.0/24 vrf vrf-h2
74 ip address del
2001:db8
:2::2/64 dev
$h2
75 ip address del
198.51.100.2/24 dev
$h2
77 ip link
set dev
$h2 down
83 ip link
set dev
$rp1 up
84 ip link
set dev
$rp2 up
86 tc qdisc add dev
$rp2 clsact
88 ip address add
192.0.2.1/24 dev
$rp1
89 ip address add
2001:db8
:1::1/64 dev
$rp1
91 ip address add
198.51.100.1/24 dev
$rp2
92 ip address add
2001:db8
:2::1/64 dev
$rp2
97 ip address del
2001:db8
:2::1/64 dev
$rp2
98 ip address del
198.51.100.1/24 dev
$rp2
100 ip address del
2001:db8
:1::1/64 dev
$rp1
101 ip address del
192.0.2.1/24 dev
$rp1
103 tc qdisc del dev
$rp2 clsact
105 ip link
set dev
$rp2 down
106 ip link
set dev
$rp1 down
111 # Create the nexthops as AF_INET6, so that IPv4 and IPv6 routes could
113 ip
-6 nexthop add id
101 dev
$rp1
114 ip
-6 nexthop add id
102 dev
$rp2
116 ip route replace
192.0.2.0/24 nhid
101
117 ip route replace
2001:db8
:1::/64 nhid
101
118 ip route replace
198.51.100.0/24 nhid
102
119 ip route replace
2001:db8
:2::/64 nhid
102
130 rp1mac
=$
(mac_get
$rp1)
158 ping_test
$h1 198.51.100.2
163 ping6_test
$h1 2001:db8
:2::2