Lines Matching +full:dp +full:- +full:bridge
2 # SPDX-License-Identifier: GPL-2.0
12 # +------------------------------------+ +------------------------------------+
19 # | +---------+---------+ | | +---------+---------+ |
33 # +-----------------|------------------+ +-----------------|------------------+
35 # +-----------------|------------------+ +-----------------|------------------+
49 # | +---------+---------+ | | +---------+---------+ |
56 # +------------------------------------+ +------------------------------------+
122 # All tests in this script. Can be overridden with -t option.
140 if [ ${rc} -eq ${expected} ]; then
141 printf "TEST: %-60s [ OK ]\n" "${msg}"
146 printf "TEST: %-60s [FAIL]\n" "${msg}"
182 if [ "$VERBOSE" = "1" -a -n "$out" ]; then
198 pkts=$(tc -n $ns -j -s filter show $id \
212 ip netns exec $ns sysctl -qw net.ipv4.ip_forward=1
213 ip netns exec $ns sysctl -qw net.ipv4.fib_multipath_use_neigh=1
214 ip netns exec $ns sysctl -qw net.ipv4.conf.default.ignore_routes_with_linkdown=1
215 ip netns exec $ns sysctl -qw net.ipv6.conf.all.keep_addr_on_down=1
216 ip netns exec $ns sysctl -qw net.ipv6.conf.all.forwarding=1
217 ip netns exec $ns sysctl -qw net.ipv6.conf.default.forwarding=1
218 ip netns exec $ns sysctl -qw net.ipv6.conf.default.ignore_routes_with_linkdown=1
219 ip netns exec $ns sysctl -qw net.ipv6.conf.all.accept_dad=0
220 ip netns exec $ns sysctl -qw net.ipv6.conf.default.accept_dad=0
222 ip -n $ns link set dev lo up
223 ip -n $ns address add $local_addr dev lo
225 ip -n $ns link set dev veth0 up
227 ip -n $ns link add name br0 up type bridge vlan_filtering 1 \
230 ip -n $ns link add link br0 name br0.10 up type vlan id 10
231 bridge -n $ns vlan add vid 10 dev br0 self
233 ip -n $ns link add link br0 name br0.20 up type vlan id 20
234 bridge -n $ns vlan add vid 20 dev br0 self
236 ip -n $ns link add link br0 name br0.4000 up type vlan id 4000
237 bridge -n $ns vlan add vid 4000 dev br0 self
239 ip -n $ns link add name vx0 up master br0 type vxlan \
241 bridge -n $ns link set dev vx0 vlan_tunnel on
243 bridge -n $ns vlan add vid 10 dev vx0
244 bridge -n $ns vlan add vid 10 dev vx0 tunnel_info id 10010
245 bridge -n $ns vni add vni 10010 dev vx0
247 bridge -n $ns vlan add vid 20 dev vx0
248 bridge -n $ns vlan add vid 20 dev vx0 tunnel_info id 10020
249 bridge -n $ns vni add vni 10020 dev vx0
251 bridge -n $ns vlan add vid 4000 dev vx0 pvid
252 bridge -n $ns vlan add vid 4000 dev vx0 tunnel_info id 14000
253 bridge -n $ns vni add vni 14000 dev vx0
276 ip -n $ns1_v4 address add 192.0.2.17/28 dev veth0
277 ip -n $ns2_v4 address add 192.0.2.18/28 dev veth0
279 ip -n $ns1_v4 route add default via 192.0.2.18
280 ip -n $ns2_v4 route add default via 192.0.2.17
293 ip -n $ns1_v6 address add 2001:db8:2::1/64 dev veth0 nodad
294 ip -n $ns2_v6 address add 2001:db8:2::2/64 dev veth0 nodad
296 ip -n $ns1_v6 route add default via 2001:db8:2::2
297 ip -n $ns2_v6 route add default via 2001:db8:2::1
307 set -e
324 # Tests - Control path
335 run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 $grp_key permanent dst $vtep_ip src_vni 10010"
337 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 $grp_key src_vni 10010"
340 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 $grp_key permanent dst $vtep_ip src_vni 10010"
342 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 $grp_key src_vni 10010"
345 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 $grp_key dst $vtep_ip src_vni 10010"
347 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 $grp_key src_vni 10010"
350 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 $grp_key dst $vtep_ip src_vni 10010"
351 log_test $? 255 "Non-existent MDB entry deletion"
354 run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 $grp_key permanent dst $vtep_ip src_vni 10010"
355 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 $grp_key src_vni 10010 | grep \"proto static\""
358 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 $grp_key permanent proto 123 dst $vtep_ip src…
359 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 $grp_key src_vni 10010 | grep \"proto 123\""
362 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 $grp_key dst $vtep_ip src_vni 10010"
365 run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 $grp_key permanent dst $vtep_ip src_vni 10010"
366 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 $grp_key src_vni 10010 | grep \" dst_port \""
369 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 $grp_key permanent dst $vtep_ip dst_port 1234…
370 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 $grp_key src_vni 10010 | grep \"dst_port 1234\""
373 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 $grp_key dst $vtep_ip src_vni 10010"
376 run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 $grp_key permanent dst $vtep_ip src_vni 10010"
377 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 $grp_key src_vni 10010 | grep \" vni \""
380 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 $grp_key permanent dst $vtep_ip vni 1234 src_…
381 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 $grp_key src_vni 10010 | grep \"vni 1234\""
384 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 $grp_key dst $vtep_ip src_vni 10010"
387 run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 $grp_key permanent dst $vtep_ip src_vni 10010"
388 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 $grp_key src_vni 10010 | grep \" via \""
391 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 $grp_key permanent dst $vtep_ip src_vni 10010…
392 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 $grp_key src_vni 10010 | grep \"via veth0\""
395 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 $grp_key dst $vtep_ip src_vni 10010"
398 run_cmd "bridge -n $ns1 mdb add dev vx0 port veth0 $grp_key permanent dst $vtep_ip src_vni 10010"
401 run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 $grp_key temp dst $vtep_ip src_vni 10010"
404 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 $grp_key permanent vid 10 dst $vtep_ip src_vni 10…
407 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 grp 01:02:03:04:05:06 permanent dst $vtep_ip src_…
410 run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 $grp_key permanent"
413 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 $grp_key permanent proto 3 dst $vtep_ip src_vni 1…
416 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 $grp_key permanent dst $vtep_ip vni $((2 ** 24)) …
419 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 $grp_key permanent dst $vtep_ip src_vni $((2 ** 2…
422 run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 $grp_key permanent src_vni 10010"
425 run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 $grp_key permanent dst $vtep_ip src_vni 10010"
426 run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 $grp_key permanent dst $vtep_ip src_vni 10010"
428 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 $grp_key dst $vtep_ip src_vni 10010"
438 echo "Control path: Basic (*, G) operations - IPv4 overlay / IPv4 underlay"
439 echo "--------------------------------------------------------------------"
451 echo "Control path: Basic (*, G) operations - IPv6 overlay / IPv4 underlay"
452 echo "--------------------------------------------------------------------"
464 echo "Control path: Basic (*, G) operations - IPv4 overlay / IPv6 underlay"
465 echo "--------------------------------------------------------------------"
477 echo "Control path: Basic (*, G) operations - IPv6 overlay / IPv6 underlay"
478 echo "--------------------------------------------------------------------"
490 echo "Control path: Basic (S, G) operations - IPv4 overlay / IPv4 underlay"
491 echo "--------------------------------------------------------------------"
503 echo "Control path: Basic (S, G) operations - IPv6 overlay / IPv4 underlay"
504 echo "---------------------------------------------------------------------"
516 echo "Control path: Basic (S, G) operations - IPv4 overlay / IPv6 underlay"
517 echo "--------------------------------------------------------------------"
529 echo "Control path: Basic (S, G) operations - IPv6 overlay / IPv6 underlay"
530 echo "--------------------------------------------------------------------"
548 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 grp $grp permanent filter_mode exclude source_lis…
550 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src_vni 10010"
552 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src1 src_vni 10010"
555 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode exclude source…
557 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src_vni 10010"
559 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src1 src_vni 10010"
562 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep_ip src_vni 10010"
564 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src_vni 10010"
566 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src1 src_vni 10010"
570 run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 grp $grp permanent dst $vtep_ip src_vni 10010"
571 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src_vni 10010 | grep exclude"
574 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode include source…
575 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src_vni 10010 | grep include"
577 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src1 src_vni 10010"
579 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src1 src_vni 10010 | grep blocked"
582 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode exclude source…
583 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src_vni 10010 | grep exclude"
585 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grep grp $grp src $src1 src_vni 10010"
587 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src1 src_vni 10010 | grep blocked"
590 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep_ip src_vni 10010"
593 run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 grp $grp permanent dst $vtep_ip src_vni 10010"
594 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src_vni 10010 | grep source_list"
597 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode exclude source…
598 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src1 src_vni 10010"
600 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src2 src_vni 10010"
602 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src3 src_vni 10010"
605 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode exclude source…
606 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src1 src_vni 10010"
608 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src2 src_vni 10010"
610 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src3 src_vni 10010"
613 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep_ip src_vni 10010"
616 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 grp $grp permanent filter_mode exclude source_lis…
617 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src_vni 10010 | grep \"proto static\""
619 …run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src1 src_vni 10010 | grep \"proto stat…
622 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode exclude source…
623 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src_vni 10010 | grep \"proto bgp\""
625 …run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src1 src_vni 10010 | grep \"proto bgp\…
628 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep_ip src_vni 10010"
631 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 grp $grp permanent filter_mode exclude source_lis…
632 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src_vni 10010 | grep \" dst_port \""
634 …run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src1 src_vni 10010 | grep \" dst_port …
637 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode exclude source…
638 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src_vni 10010 | grep \" dst_port 1234 \""
640 …run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src1 src_vni 10010 | grep \" dst_port …
643 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep_ip src_vni 10010"
646 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 grp $grp permanent filter_mode exclude source_lis…
647 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src_vni 10010 | grep \" vni \""
649 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src1 src_vni 10010 | grep \" vni \""
652 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode exclude source…
653 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src_vni 10010 | grep \" vni 1234 \""
655 …run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src1 src_vni 10010 | grep \" vni 1234 …
658 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep_ip src_vni 10010"
661 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 grp $grp permanent filter_mode exclude source_lis…
662 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src_vni 10010 | grep \" via \""
664 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src1 src_vni 10010 | grep \" via \""
667 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode exclude source…
668 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src_vni 10010 | grep \" via veth0 \""
670 …run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src1 src_vni 10010 | grep \" via veth0…
673 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep_ip src_vni 10010"
676 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 grp $all_zeros_grp permanent filter_mode exclude …
677 log_test $? 255 "All-zeros group with filter mode"
679 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 grp $all_zeros_grp permanent source_list $src1 ds…
680 log_test $? 255 "All-zeros group with source list"
682 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 grp $grp permanent filter_mode include dst $vtep_…
685 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 grp $grp permanent filter_mode exclude source_lis…
688 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 grp $grp permanent source_list $src1 dst $vtep_ip…
703 echo "Control path: (*, G) operations - IPv4 overlay / IPv4 underlay"
704 echo "--------------------------------------------------------------"
720 echo "Control path: (*, G) operations - IPv6 overlay / IPv4 underlay"
721 echo "--------------------------------------------------------------"
737 echo "Control path: (*, G) operations - IPv4 overlay / IPv6 underlay"
738 echo "--------------------------------------------------------------"
754 echo "Control path: (*, G) operations - IPv6 overlay / IPv6 underlay"
755 echo "--------------------------------------------------------------"
771 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 grp $grp src $src permanent dst $vtep_ip src_vni …
772 run_cmd "bridge -n $ns1 -d -s mdb get dev vx0 grp $grp src $src src_vni 10010 | grep include"
775 …run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp src $src permanent dst $vtep_ip src_vni …
778 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 grp $grp src $src permanent filter_mode include d…
781 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 grp $grp src $src permanent source_list $src dst …
784 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 grp $grp src $grp permanent dst $vtep_ip src_vni …
787 …run_cmd "bridge -n $ns1 mdb add dev vx0 port vx0 grp $all_zeros_grp src $src permanent dst $vtep_i…
788 log_test $? 255 "All-zeros group with source"
800 echo "Control path: (S, G) operations - IPv4 overlay / IPv4 underlay"
801 echo "--------------------------------------------------------------"
815 echo "Control path: (S, G) operations - IPv6 overlay / IPv4 underlay"
816 echo "--------------------------------------------------------------"
830 echo "Control path: (S, G) operations - IPv4 overlay / IPv6 underlay"
831 echo "--------------------------------------------------------------"
845 echo "Control path: (S, G) operations - IPv6 overlay / IPv6 underlay"
846 echo "--------------------------------------------------------------"
856 for i in $(seq 0 $((max_grps - 1))); do
866 for i in $(seq 0 $((max_grps - 1))); do
891 ip -n $ns1 link add name vx-test${i} up type vxlan \
900 …echo "mdb add dev vx-test${i} port vx-test${i} grp $grp permanent dst ${remote_prefix}${j}" >> $ba…
906 bridge -n $ns1 -b $batch_file
908 num_entries=$(bridge -n $ns1 mdb show dev vx-test${i} | grep "permanent" | wc -l)
909 [[ $num_entries -eq $((max_grps * max_remotes)) ]]
910 log_test $? 0 "Large scale dump - VXLAN device #$i"
913 rm -rf $batch_file
924 echo "Control path: Large scale MDB dump - IPv4 overlay / IPv4 underlay"
925 echo "-----------------------------------------------------------------"
938 echo "Control path: Large scale MDB dump - IPv6 overlay / IPv4 underlay"
939 echo "-----------------------------------------------------------------"
952 echo "Control path: Large scale MDB dump - IPv4 overlay / IPv6 underlay"
953 echo "-----------------------------------------------------------------"
966 echo "Control path: Large scale MDB dump - IPv6 overlay / IPv6 underlay"
967 echo "-----------------------------------------------------------------"
978 echo "-------------------"
984 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent dst 198.51.100.1 src_v…
985 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.2 permanent dst 198.51.100.1 src_v…
988 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.3 permanent proto bgp dst 198.51.1…
989 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.4 permanent proto zebra dst 198.51…
992 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.5 permanent dst 198.51.100.1 src_v…
993 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.6 permanent dst 198.51.100.2 src_v…
996 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.7 permanent dst 198.51.100.1 dst_p…
997 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.8 permanent dst 198.51.100.1 dst_p…
1000 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.9 permanent dst 198.51.100.1 vni 1…
1001 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.10 permanent dst 198.51.100.1 vni …
1003 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0"
1004 num_entries=$(bridge -n $ns1_v4 mdb show dev vx0 | wc -l)
1005 [[ $num_entries -eq 0 ]]
1012 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent dst 198.51.100.1 src_v…
1013 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent dst 198.51.100.2 src_v…
1015 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0 port vx0"
1016 run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010"
1017 log_test $? 254 "Flush by port - matching"
1019 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0 port veth0"
1020 log_test $? 255 "Flush by port - non-matching"
1025 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent dst 198.51.100.1 src_v…
1026 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent dst 198.51.100.2 src_v…
1027 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent dst 198.51.100.1 src_v…
1028 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent dst 198.51.100.2 src_v…
1030 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0 src_vni 10010"
1032 run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010"
1033 log_test $? 254 "Flush by source VNI - matching"
1034 run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10011"
1035 log_test $? 0 "Flush by source VNI - non-matching"
1037 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0"
1042 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent dst 198.51.100.1 src_v…
1043 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent dst 198.51.100.2 src_v…
1045 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0 permanent"
1046 run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010"
1049 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0 nopermanent"
1055 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent proto bgp dst 198.51.1…
1056 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent proto zebra dst 198.51…
1058 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0 proto bgp"
1060 run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010 | grep \"proto bgp\""
1061 log_test $? 1 "Flush by routing protocol - matching"
1062 …run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010 | grep \"proto zebra\…
1063 log_test $? 0 "Flush by routing protocol - non-matching"
1065 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0"
1072 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent dst 198.51.100.1 src_v…
1073 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent dst 198.51.100.2 src_v…
1075 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0 dst 198.51.100.2"
1077 run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010 | grep 198.51.100.2"
1078 log_test $? 1 "Flush by IPv4 destination IP - matching"
1079 run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010 | grep 198.51.100.1"
1080 log_test $? 0 "Flush by IPv4 destination IP - non-matching"
1082 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0"
1086 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent dst 2001:db8:1000::1 s…
1087 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent dst 2001:db8:1000::2 s…
1089 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0 dst 2001:db8:1000::2"
1091 …run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010 | grep 2001:db8:1000:…
1092 log_test $? 1 "Flush by IPv6 destination IP - matching"
1093 …run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010 | grep 2001:db8:1000:…
1094 log_test $? 0 "Flush by IPv6 destination IP - non-matching"
1096 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0"
1101 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent dst_port 11111 dst 198…
1102 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent dst_port 22222 dst 198…
1104 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0 dst_port 11111"
1106 …run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010 | grep \"dst_port 111…
1107 log_test $? 1 "Flush by UDP destination port - matching"
1108 …run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010 | grep \"dst_port 222…
1109 log_test $? 0 "Flush by UDP destination port - non-matching"
1111 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0"
1118 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent dst 198.51.100.1 src_v…
1119 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent dst_port 22222 dst 198…
1121 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0 dst_port 4789"
1123 run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010 | grep 198.51.100.1"
1124 log_test $? 1 "Flush by device's UDP destination port - matching"
1125 run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010 | grep 198.51.100.2"
1126 log_test $? 0 "Flush by device's UDP destination port - non-matching"
1128 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0"
1133 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent vni 20010 dst 198.51.1…
1134 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent vni 20011 dst 198.51.1…
1136 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0 vni 20010"
1138 run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010 | grep \" vni 20010\""
1139 log_test $? 1 "Flush by destination VNI - matching"
1140 run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010 | grep \" vni 20011\""
1141 log_test $? 0 "Flush by destination VNI - non-matching"
1143 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0"
1150 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent dst 198.51.100.1 src_v…
1151 …run_cmd "bridge -n $ns1_v4 mdb add dev vx0 port vx0 grp 239.1.1.1 permanent vni 20010 dst 198.51.1…
1153 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0 vni 10010"
1155 run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010 | grep 198.51.100.1"
1156 log_test $? 1 "Flush by destination VNI equal to source VNI - matching"
1157 run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010 | grep 198.51.100.2"
1158 log_test $? 0 "Flush by destination VNI equal to source VNI - non-matching"
1160 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0"
1164 run_cmd "bridge -n $ns1_v4 mdb flush dev vx0 vid 10"
1169 # Tests - Data path
1189 run_cmd "tc -n $ns2 qdisc replace dev veth0 clsact"
1190 run_cmd "tc -n $ns2 qdisc replace dev vx0 clsact"
1191 run_cmd "ip -n $ns2 address replace $vtep1_ip/$plen dev lo"
1192 run_cmd "ip -n $ns2 address replace $vtep2_ip/$plen dev lo"
1195 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent dst $vtep1_ip src_vni 1001…
1196 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent dst $vtep2_ip src_vni 1002…
1198 …run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 101 proto all flower enc_dst_ip $…
1199 …run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=5432…
1201 log_test $? 0 "Destination IP - match"
1203 …run_cmd "ip netns exec $ns1 $mz br0.20 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=5432…
1205 log_test $? 0 "Destination IP - no match"
1207 run_cmd "tc -n $ns2 filter del dev vx0 ingress pref 1 handle 101 flower"
1208 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep2_ip src_vni 10020"
1209 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep1_ip src_vni 10010"
1212 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent dst $vtep1_ip src_vni 1001…
1213 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent dst $vtep1_ip dst_port 111…
1215 …run_cmd "tc -n $ns2 filter replace dev veth0 ingress pref 1 handle 101 proto $enc_ethtype flower i…
1216 …run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=5432…
1218 log_test $? 0 "Default destination port - match"
1220 …run_cmd "ip netns exec $ns1 $mz br0.20 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=5432…
1222 log_test $? 0 "Default destination port - no match"
1224 …run_cmd "tc -n $ns2 filter replace dev veth0 ingress pref 1 handle 101 proto $enc_ethtype flower i…
1225 …run_cmd "ip netns exec $ns1 $mz br0.20 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=5432…
1227 log_test $? 0 "Non-default destination port - match"
1229 …run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=5432…
1231 log_test $? 0 "Non-default destination port - no match"
1233 run_cmd "tc -n $ns2 filter del dev veth0 ingress pref 1 handle 101 flower"
1234 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep1_ip src_vni 10020"
1235 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep1_ip src_vni 10010"
1238 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent dst $vtep1_ip src_vni 1001…
1239 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent dst $vtep1_ip src_vni 1002…
1241 …run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 101 proto all flower enc_key_id 1…
1242 …run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=5432…
1244 log_test $? 0 "Default destination VNI - match"
1246 …run_cmd "ip netns exec $ns1 $mz br0.20 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=5432…
1248 log_test $? 0 "Default destination VNI - no match"
1250 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent dst $vtep1_ip vni 10020 sr…
1251 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent dst $vtep1_ip vni 10010 sr…
1253 …run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 101 proto all flower enc_key_id 1…
1254 …run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=5432…
1256 log_test $? 0 "Non-default destination VNI - match"
1258 …run_cmd "ip netns exec $ns1 $mz br0.20 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=5432…
1260 log_test $? 0 "Non-default destination VNI - no match"
1262 run_cmd "tc -n $ns2 filter del dev vx0 ingress pref 1 handle 101 flower"
1263 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep1_ip src_vni 10020"
1264 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep1_ip src_vni 10010"
1280 echo "Data path: Encapsulation parameters - IPv4 overlay / IPv4 underlay"
1281 echo "------------------------------------------------------------------"
1300 echo "Data path: Encapsulation parameters - IPv6 overlay / IPv4 underlay"
1301 echo "------------------------------------------------------------------"
1304 $grp $grp_dmac $src "mausezahn -6"
1320 echo "Data path: Encapsulation parameters - IPv4 overlay / IPv6 underlay"
1321 echo "------------------------------------------------------------------"
1340 echo "Data path: Encapsulation parameters - IPv6 overlay / IPv6 underlay"
1341 echo "------------------------------------------------------------------"
1344 $grp $grp_dmac $src "mausezahn -6"
1366 run_cmd "tc -n $ns2 qdisc replace dev vx0 clsact"
1367 run_cmd "ip -n $ns2 address replace $vtep1_ip/$plen dev lo"
1368 run_cmd "ip -n $ns2 address replace $vtep2_ip/$plen dev lo"
1370 …run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 101 proto all flower enc_dst_ip $…
1371 …run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 102 proto all flower enc_dst_ip $…
1373 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode exclude source…
1374 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode exclude source…
1377 …cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $invalid_src -B $grp -t udp sp=12345,dp=…
1379 log_test $? 0 "Block excluded source - first VTEP"
1381 log_test $? 0 "Block excluded source - second VTEP"
1384 …_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=5…
1386 log_test $? 0 "Forward valid source - first VTEP"
1388 log_test $? 0 "Forward valid source - second VTEP"
1391 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep2_ip src_vni 10010"
1394 …cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $invalid_src -B $grp -t udp sp=12345,dp=…
1396 log_test $? 0 "Block excluded source after removal - first VTEP"
1398 log_test $? 0 "Block excluded source after removal - second VTEP"
1401 …_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=5…
1403 log_test $? 0 "Forward valid source after removal - first VTEP"
1405 log_test $? 0 "Forward valid source after removal - second VTEP"
1421 echo "Data path: (*, G) EXCLUDE - IR - IPv4 overlay / IPv4 underlay"
1422 echo "-------------------------------------------------------------"
1441 echo "Data path: (*, G) EXCLUDE - IR - IPv6 overlay / IPv4 underlay"
1442 echo "-------------------------------------------------------------"
1445 $grp_dmac $valid_src $invalid_src "mausezahn -6"
1461 echo "Data path: (*, G) EXCLUDE - IR - IPv4 overlay / IPv6 underlay"
1462 echo "-------------------------------------------------------------"
1481 echo "Data path: (*, G) EXCLUDE - IR - IPv6 overlay / IPv6 underlay"
1482 echo "-------------------------------------------------------------"
1485 $grp_dmac $valid_src $invalid_src "mausezahn -6"
1507 run_cmd "tc -n $ns2 qdisc replace dev vx0 clsact"
1508 run_cmd "ip -n $ns2 address replace $vtep1_ip/$plen dev lo"
1509 run_cmd "ip -n $ns2 address replace $vtep2_ip/$plen dev lo"
1511 …run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 101 proto all flower enc_dst_ip $…
1512 …run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 102 proto all flower enc_dst_ip $…
1514 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode include source…
1515 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode include source…
1518 …cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $invalid_src -B $grp -t udp sp=12345,dp=…
1520 log_test $? 0 "Block excluded source - first VTEP"
1522 log_test $? 0 "Block excluded source - second VTEP"
1525 …_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=5…
1527 log_test $? 0 "Forward valid source - first VTEP"
1529 log_test $? 0 "Forward valid source - second VTEP"
1532 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep2_ip src_vni 10010"
1535 …cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $invalid_src -B $grp -t udp sp=12345,dp=…
1537 log_test $? 0 "Block excluded source after removal - first VTEP"
1539 log_test $? 0 "Block excluded source after removal - second VTEP"
1542 …_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=5…
1544 log_test $? 0 "Forward valid source after removal - first VTEP"
1546 log_test $? 0 "Forward valid source after removal - second VTEP"
1562 echo "Data path: (*, G) INCLUDE - IR - IPv4 overlay / IPv4 underlay"
1563 echo "-------------------------------------------------------------"
1582 echo "Data path: (*, G) INCLUDE - IR - IPv6 overlay / IPv4 underlay"
1583 echo "-------------------------------------------------------------"
1586 $grp_dmac $valid_src $invalid_src "mausezahn -6"
1602 echo "Data path: (*, G) INCLUDE - IR - IPv4 overlay / IPv6 underlay"
1603 echo "-------------------------------------------------------------"
1622 echo "Data path: (*, G) INCLUDE - IR - IPv6 overlay / IPv6 underlay"
1623 echo "-------------------------------------------------------------"
1626 $grp_dmac $valid_src $invalid_src "mausezahn -6"
1646 run_cmd "tc -n $ns2 qdisc replace dev vx0 clsact"
1647 run_cmd "ip -n $ns2 address replace $mcast_grp/$plen dev veth0 autojoin"
1649 …run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 101 proto all flower enc_dst_ip $…
1651 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode exclude source…
1654 …cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $invalid_src -B $grp -t udp sp=12345,dp=…
1659 …_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=5…
1664 run_cmd "ip -n $ns2 address del $mcast_grp/$plen dev veth0"
1667 …_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=5…
1684 echo "Data path: (*, G) EXCLUDE - P2MP - IPv4 overlay / IPv4 underlay"
1685 echo "---------------------------------------------------------------"
1703 echo "Data path: (*, G) EXCLUDE - P2MP - IPv6 overlay / IPv4 underlay"
1704 echo "---------------------------------------------------------------"
1707 $valid_src $invalid_src "mausezahn -6"
1722 echo "Data path: (*, G) EXCLUDE - P2MP - IPv4 overlay / IPv6 underlay"
1723 echo "---------------------------------------------------------------"
1741 echo "Data path: (*, G) EXCLUDE - P2MP - IPv6 overlay / IPv6 underlay"
1742 echo "---------------------------------------------------------------"
1745 $valid_src $invalid_src "mausezahn -6"
1765 run_cmd "tc -n $ns2 qdisc replace dev vx0 clsact"
1766 run_cmd "ip -n $ns2 address replace $mcast_grp/$plen dev veth0 autojoin"
1768 …run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 101 proto all flower enc_dst_ip $…
1770 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode include source…
1773 …cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $invalid_src -B $grp -t udp sp=12345,dp=…
1778 …_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=5…
1783 run_cmd "ip -n $ns2 address del $mcast_grp/$plen dev veth0"
1786 …_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=5…
1803 echo "Data path: (*, G) INCLUDE - P2MP - IPv4 overlay / IPv4 underlay"
1804 echo "---------------------------------------------------------------"
1822 echo "Data path: (*, G) INCLUDE - P2MP - IPv6 overlay / IPv4 underlay"
1823 echo "---------------------------------------------------------------"
1826 $valid_src $invalid_src "mausezahn -6"
1841 echo "Data path: (*, G) INCLUDE - P2MP - IPv4 overlay / IPv6 underlay"
1842 echo "---------------------------------------------------------------"
1860 echo "Data path: (*, G) INCLUDE - P2MP - IPv6 overlay / IPv6 underlay"
1861 echo "---------------------------------------------------------------"
1864 $valid_src $invalid_src "mausezahn -6"
1879 # When P2MP tunnels are used with optimized inter-subnet multicast
1893 # when ingressing the bridge, the VNI to VLAN lookup will fail because
1897 # [1] https://datatracker.ietf.org/doc/html/draft-ietf-bess-evpn-irb-mcast
1899 run_cmd "tc -n $ns2 qdisc replace dev br0.4000 clsact"
1900 run_cmd "ip -n $ns2 address replace $mcast_grp/$plen dev veth0 autojoin"
1901 …run_cmd "tc -n $ns2 filter replace dev br0.4000 ingress pref 1 handle 101 proto $proto flower src_…
1903 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp src $src permanent dst $mcast_grp sr…
1906 run_cmd "bridge -n $ns2 vlan del vid 10 dev vx0"
1911 …run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=5432…
1913 log_test $? 0 "Egress VNI translation - PVID configured"
1917 run_cmd "bridge -n $ns2 vlan add vid 4000 dev vx0"
1918 …run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=5432…
1920 log_test $? 0 "Egress VNI translation - no PVID configured"
1923 run_cmd "bridge -n $ns2 vlan add vid 4000 dev vx0 pvid"
1924 …run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=5432…
1926 log_test $? 0 "Egress VNI translation - PVID reconfigured"
1941 echo "Data path: Egress VNI translation - IPv4 overlay / IPv4 underlay"
1942 echo "----------------------------------------------------------------"
1960 echo "Data path: Egress VNI translation - IPv6 overlay / IPv4 underlay"
1961 echo "----------------------------------------------------------------"
1964 $grp_dmac $src "mausezahn -6"
1979 echo "Data path: Egress VNI translation - IPv4 overlay / IPv6 underlay"
1980 echo "----------------------------------------------------------------"
1998 echo "Data path: Egress VNI translation - IPv6 overlay / IPv6 underlay"
1999 echo "----------------------------------------------------------------"
2002 $grp_dmac $src "mausezahn -6"
2029 # Install all-zeros (catchall) MDB entries for IPv4 and IPv6 traffic
2031 # which is not link-local. Also make sure that each entry only forwards
2034 # Associate two different VTEPs with one all-zeros MDB entry: Two with
2036 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp 0.0.0.0 permanent dst $vtep1_ip src_vni 1…
2037 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp 0.0.0.0 permanent dst $vtep2_ip src_vni 1…
2038 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp :: permanent dst $vtep3_ip src_vni 10010"
2039 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp :: permanent dst $vtep4_ip src_vni 10010"
2043 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $ipv4_grp permanent dst $vtep1_ip src_vni…
2044 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $ipv6_grp permanent dst $vtep3_ip src_vni…
2047 run_cmd "tc -n $ns2 qdisc replace dev vx0 clsact"
2048 …run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 101 proto all flower enc_dst_ip $…
2049 …run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 102 proto all flower enc_dst_ip $…
2050 …run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 103 proto all flower enc_dst_ip $…
2051 …run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 104 proto all flower enc_dst_ip $…
2055 run_cmd "ip -n $ns2 address replace $vtep1_ip/$plen dev lo"
2056 run_cmd "ip -n $ns2 address replace $vtep2_ip/$plen dev lo"
2057 run_cmd "ip -n $ns2 address replace $vtep3_ip/$plen dev lo"
2058 run_cmd "ip -n $ns2 address replace $vtep4_ip/$plen dev lo"
2062 …etns exec $ns1 mausezahn br0.10 -a own -b $ipv4_grp_dmac -A $ipv4_src -B $ipv4_grp -t udp sp=12345…
2064 log_test $? 0 "Registered IPv4 multicast - first VTEP"
2066 log_test $? 0 "Registered IPv4 multicast - second VTEP"
2068 # Send unregistered IPv4 multicast that is not link-local and make sure
2070 …xec $ns1 mausezahn br0.10 -a own -b $ipv4_unreg_grp_dmac -A $ipv4_src -B $ipv4_unreg_grp -t udp sp…
2072 log_test $? 0 "Unregistered IPv4 multicast - first VTEP"
2074 log_test $? 0 "Unregistered IPv4 multicast - second VTEP"
2076 # Send IPv4 link-local multicast traffic and make sure it does not
2078 …s exec $ns1 mausezahn br0.10 -a own -b $ipv4_ll_grp_dmac -A $ipv4_src -B $ipv4_ll_grp -t udp sp=12…
2080 log_test $? 0 "Link-local IPv4 multicast - first VTEP"
2082 log_test $? 0 "Link-local IPv4 multicast - second VTEP"
2086 …ns exec $ns1 mausezahn br0.10 -a own -b 00:11:22:33:44:55 -A $ipv4_src -B $ipv4_grp -t udp sp=1234…
2088 log_test $? 0 "Registered IPv4 multicast with a unicast MAC - first VTEP"
2090 log_test $? 0 "Registered IPv4 multicast with a unicast MAC - second VTEP"
2094 …ip netns exec $ns1 mausezahn br0.10 -a own -b bcast -A $ipv4_src -B $ipv4_grp -t udp sp=12345,dp=5…
2096 log_test $? 0 "Registered IPv4 multicast with a broadcast MAC - first VTEP"
2098 log_test $? 0 "Registered IPv4 multicast with a broadcast MAC - second VTEP"
2103 log_test $? 0 "IPv4 traffic - third VTEP"
2105 log_test $? 0 "IPv4 traffic - fourth VTEP"
2108 …run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 101 proto all flower enc_dst_ip $…
2109 …run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 102 proto all flower enc_dst_ip $…
2113 … netns exec $ns1 mausezahn -6 br0.10 -a own -b $ipv6_grp_dmac -A $ipv6_src -B $ipv6_grp -t udp sp=…
2115 log_test $? 0 "Registered IPv6 multicast - third VTEP"
2117 log_test $? 0 "Registered IPv6 multicast - fourth VTEP"
2119 # Send unregistered IPv6 multicast that is not link-local and make sure
2121 … exec $ns1 mausezahn -6 br0.10 -a own -b $ipv6_unreg_grp_dmac -A $ipv6_src -B $ipv6_unreg_grp -t u…
2123 log_test $? 0 "Unregistered IPv6 multicast - third VTEP"
2125 log_test $? 0 "Unregistered IPv6 multicast - fourth VTEP"
2127 # Send IPv6 link-local multicast traffic and make sure it does not
2129 …tns exec $ns1 mausezahn -6 br0.10 -a own -b $ipv6_ll_grp_dmac -A $ipv6_src -B $ipv6_ll_grp -t udp …
2131 log_test $? 0 "Link-local IPv6 multicast - third VTEP"
2133 log_test $? 0 "Link-local IPv6 multicast - fourth VTEP"
2137 …etns exec $ns1 mausezahn -6 br0.10 -a own -b 00:11:22:33:44:55 -A $ipv6_src -B $ipv6_grp -t udp sp…
2139 log_test $? 0 "Registered IPv6 multicast with a unicast MAC - third VTEP"
2141 log_test $? 0 "Registered IPv6 multicast with a unicast MAC - fourth VTEP"
2145 … "ip netns exec $ns1 mausezahn -6 br0.10 -a own -b bcast -A $ipv6_src -B $ipv6_grp -t udp sp=12345…
2147 log_test $? 0 "Registered IPv6 multicast with a broadcast MAC - third VTEP"
2149 log_test $? 0 "Registered IPv6 multicast with a broadcast MAC - fourth VTEP"
2154 log_test $? 0 "IPv6 traffic - first VTEP"
2156 log_test $? 0 "IPv6 traffic - second VTEP"
2170 echo "Data path: All-zeros MDB entry - IPv4 underlay"
2171 echo "----------------------------------------------"
2188 echo "Data path: All-zeros MDB entry - IPv6 underlay"
2189 echo "----------------------------------------------"
2213 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent dst $vtep1_ip src_vni 1001…
2214 run_cmd "bridge -n $ns1 fdb add 00:00:00:00:00:00 dev vx0 self static dst $vtep2_ip src_vni 10010"
2217 run_cmd "tc -n $ns2 qdisc replace dev vx0 clsact"
2218 …run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 101 proto $proto flower ip_proto …
2219 …run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 102 proto $proto flower ip_proto …
2223 run_cmd "ip -n $ns2 address replace $vtep1_ip/$plen dev lo"
2224 run_cmd "ip -n $ns2 address replace $vtep2_ip/$plen dev lo"
2228 …run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=5432…
2230 log_test $? 0 "IP multicast - first VTEP"
2232 log_test $? 0 "IP multicast - second VTEP"
2236 …run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b bcast -A $src -B $grp -t udp sp=12345,dp=54321 -p…
2238 log_test $? 0 "Broadcast - first VTEP"
2240 log_test $? 0 "Broadcast - second VTEP"
2244 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep1_ip src_vni 10010"
2245 …run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=5432…
2247 log_test $? 0 "IP multicast after removal - first VTEP"
2249 log_test $? 0 "IP multicast after removal - second VTEP"
2265 echo "Data path: MDB with FDB - IPv4 overlay / IPv4 underlay"
2266 echo "------------------------------------------------------"
2285 echo "Data path: MDB with FDB - IPv6 overlay / IPv4 underlay"
2286 echo "------------------------------------------------------"
2289 $grp_dmac $src "mausezahn -6"
2305 echo "Data path: MDB with FDB - IPv4 overlay / IPv6 underlay"
2306 echo "------------------------------------------------------"
2325 echo "Data path: MDB with FDB - IPv6 overlay / IPv6 underlay"
2326 echo "------------------------------------------------------"
2329 $grp_dmac $src "mausezahn -6"
2339 bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp1 dst $vtep1_ip src_vni 10010
2340 bridge -n $ns1 mdb add dev vx0 port vx0 grp $grp1 permanent dst $vtep1_ip src_vni 10010
2352 bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp2 dst $vtep1_ip src_vni 10010
2353 bridge -n $ns1 mdb add dev vx0 port vx0 grp $grp2 permanent dst $vtep1_ip src_vni 10010
2354 bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp2 permanent dst $vtep2_ip src_vni 10010
2383 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp1 permanent dst $vtep1_ip src_vni 100…
2384 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp2 permanent dst $vtep1_ip src_vni 100…
2385 …run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp2 permanent dst $vtep2_ip src_vni 100…
2391 …ip netns exec $ns1 $mz br0.10 -a own -b $grp1_dmac -A $src -B $grp1 -t udp sp=12345,dp=54321 -p 10…
2393 …ip netns exec $ns1 $mz br0.10 -a own -b $grp2_dmac -A $src -B $grp2 -t udp sp=12345,dp=54321 -p 10…
2397 kill -9 $pid1 $pid2 $pid3 $pid4
2415 echo "Data path: MDB torture test - IPv4 overlay / IPv4 underlay"
2416 echo "----------------------------------------------------------"
2434 echo "Data path: MDB torture test - IPv6 overlay / IPv4 underlay"
2435 echo "----------------------------------------------------------"
2438 $grp2_dmac $src "mausezahn -6"
2453 echo "Data path: MDB torture test - IPv4 overlay / IPv6 underlay"
2454 echo "----------------------------------------------------------"
2472 echo "Data path: MDB torture test - IPv6 overlay / IPv6 underlay"
2473 echo "----------------------------------------------------------"
2476 $grp2_dmac $src "mausezahn -6"
2487 -t <test> Test(s) to run (default: all)
2489 -c Control path tests only
2490 -d Data path tests only
2491 -p Pause on fail
2492 -P Pause after each test before cleanup
2493 -v Verbose mode (show commands and output)
2518 if [ "$(id -u)" -ne 0 ];then
2523 if [ ! -x "$(command -v ip)" ]; then
2528 if [ ! -x "$(command -v bridge)" ]; then
2529 echo "SKIP: Could not run test without bridge tool"
2533 if [ ! -x "$(command -v mausezahn)" ]; then
2538 if [ ! -x "$(command -v jq)" ]; then
2543 bridge mdb help 2>&1 | grep -q "flush"
2544 if [ $? -ne 0 ]; then
2545 echo "SKIP: iproute2 bridge too old, missing VXLAN MDB flush support"