Lines Matching +full:2 +full:c
4 # Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
15 # ││fd00::1/24 ││ │ │127.0.0.1:1 127.0.0.1:2│ │ ││fd00::2/24 ││
16 # │└───────────────────┘│ │ │[::]:1 [::]:2 │ │ │└───────────────────┘│
27 export LANG=C
31 netns2="wg-test-$$-2"
32 pretty() { echo -e "\x1b[32m\x1b[1m[+] ${1:+NS$1: }${2}\x1b[0m" >&3; }
37 n2() { pretty 2 "$*"; maybe_exec ip netns exec $netns2 "$@"; }
40 ip2() { pretty 2 "ip $*"; ip -n $netns2 "$@"; }
42 …//*-}" "wait for iperf:${3:-5201} pid $2"; while [[ $(ss -N "$1" -tlpH "sport = ${3:-5201}") != *\…
43 … pretty "${1//*-}" "wait for udp:1111 pid $2"; while [[ $(ss -N "$1" -ulpH 'sport = 1111') != *\"n…
44 …face() { pretty "${1//*-}" "wait for $2 to come up"; ip netns exec "$1" bash -c "while [[ \$(< \"/…
48 exec 2>/dev/null
68 ip netns del $netns0 2>/dev/null || true
69 ip netns del $netns1 2>/dev/null || true
70 ip netns del $netns2 2>/dev/null || true
96 ip2 addr add fd00::2/112 dev wg0
103 allowed-ips 192.168.241.2/32,fd00::2/128
106 listen-port 2 \
118 n2 ping -c 10 -f -W 1 192.168.241.1
119 n1 ping -c 10 -f -W 1 192.168.241.2
122 n2 ping6 -c 10 -f -W 1 fd00::1
123 n1 ping6 -c 10 -f -W 1 fd00::2
128 n1 iperf3 -Z -t 3 -c 192.168.241.2
133 n2 iperf3 -Z -t 3 -c fd00::1
138 n2 iperf3 -Z -t 3 -b 0 -u -c 192.168.241.1
141 n2 iperf3 -s -1 -B fd00::2 &
143 n1 iperf3 -Z -t 3 -b 0 -u -c fd00::2
153 n1 iperf3 -Z -t 3 -p $(( 5200 + i )) -c 192.168.241.2 &
163 n1 wg set wg0 peer "$pub2" endpoint 127.0.0.1:2
166 n2 ping -c 10 -f -W 1 192.168.241.1
187 n1 wg set wg0 peer "$pub2" endpoint [::1]:2
197 n1 wg set wg0 peer "$pub2" endpoint 127.0.0.1:2
202 n2 ping -c 1 -W 1 -s 1269 192.168.241.1
214 n1 wg set wg0 peer "$pub2" endpoint 127.0.0.1:2
215 n1 ping6 -W 1 -c 1 fd00::2
220 n1 wg set wg0 peer "$pub2" endpoint [::1]:2
221 n1 ping -W 1 -c 1 192.168.241.2
245 …$key1") peer "$pub2" preshared-key <(echo "$psk") allowed-ips 192.168.241.2/32 endpoint 127.0.0.1:2
246 n2 wg set wg0 private-key <(echo "$key2") listen-port 2 peer "$pub1" preshared-key <(echo "$psk") a…
247 n1 ping -W 1 -c 1 192.168.241.2
250 n1 ping -W 1 -c 1 192.168.241.2
257 ip2 addr add fd00::5:2/112 dev wg0
258 …o "$key1") peer "$pub2" preshared-key <(echo "$psk") allowed-ips fd00::5:2/128 endpoint 127.0.0.1:2
259 n2 wg set wg0 private-key <(echo "$key2") listen-port 2 peer "$pub1" preshared-key <(echo "$psk") a…
265 ip2 addr add fd00::2/112 dev wg1
268 …te-key <(echo "$key3") peer "$pub4" allowed-ips 192.168.241.2/32,fd00::2/128 endpoint [fd00::5:2]:5
275 n0 ping -W 1 -c 1 192.168.241.2
280 ! n0 ping -W 1 -c 10 -f 192.168.241.2 || false
296 … │ │ │ │SNAT:192.168.1.0/24│ │ │ │ │ │fd00::2/24 │ │
322 n0 bash -c 'printf 1 > /proc/sys/net/ipv4/ip_forward'
323 n0 bash -c 'printf 2 > /proc/sys/net/netfilter/nf_conntrack_udp_timeout'
324 n0 bash -c 'printf 2 > /proc/sys/net/netfilter/nf_conntrack_udp_timeout_stream'
327 n1 wg set wg0 peer "$pub2" endpoint 10.0.0.100:2 persistent-keepalive 1
328 n1 ping -W 1 -c 1 192.168.241.2
329 n2 ping -W 1 -c 1 192.168.241.1
333 n2 ping -W 1 -c 1 192.168.241.1
337 n1 ping -I wg0 -c 1 -W 1 192.168.241.2
340 n1 ping -c 1 -W 1 192.168.241.2 # First the boring case
341 n1 ping -I wg0 -c 1 -W 1 192.168.241.2 # Then the sk_bound_dev_if case
351 n1 ping -W 1 -c 1 192.168.242.2
354 ! n1 ping -W 1 -c 1 192.168.242.2 || false # Should not crash kernel
370 n1 bash -c 'printf 0 > /proc/sys/net/ipv4/conf/vethc/rp_filter'
372 n1 ping -W 1 -c 100 -f 192.168.99.7
373 n1 ping -W 1 -c 100 -f abab::1111
378 n2 bash -c 'printf 1 > /proc/sys/net/ipv4/ip_forward'
381 [[ $(! n0 ping -W 1 -c 1 192.168.241.1 || false) == *"From 10.0.0.100 icmp_seq=1 Destination Host U…
399 # │ │fd00::1/24 │ │fd00:aa::1/96 ││ │ │fd00:aa::2/96 │ │fd00::2/24 │ │
408 n1 bash -c 'printf 0 > /proc/sys/net/ipv6/conf/all/accept_dad'
409 n2 bash -c 'printf 0 > /proc/sys/net/ipv6/conf/all/accept_dad'
410 n1 bash -c 'printf 0 > /proc/sys/net/ipv6/conf/veth1/accept_dad'
411 n2 bash -c 'printf 0 > /proc/sys/net/ipv6/conf/veth2/accept_dad'
412 n1 bash -c 'printf 1 > /proc/sys/net/ipv4/conf/veth1/promote_secondaries'
418 ip2 addr add fd00:aa::2/96 dev veth2
423 n1 wg set wg0 peer "$pub2" endpoint 10.0.0.2:2
424 n1 ping -W 1 -c 1 192.168.241.2
427 n1 ping -W 1 -c 1 192.168.241.2
428 n1 wg set wg0 peer "$pub2" endpoint [fd00:aa::2]:2
429 n1 ping -W 1 -c 1 192.168.241.2
432 n1 ping -W 1 -c 1 192.168.241.2
442 ip1 addr add fd00:aa::2/96 dev veth1
450 n2 ping -W 1 -c 1 192.168.241.1
453 n2 ping -W 1 -c 1 192.168.241.1
456 n2 ping -W 1 -c 1 192.168.241.1
458 n2 wg set wg0 peer "$pub1" endpoint [fd00:aa::2]:1
459 n2 ping -W 1 -c 1 192.168.241.1
460 [[ $(n2 wg show wg0 endpoints) == "$pub1 [fd00:aa::2]:1" ]]
468 n2 ping -W 1 -c 1 192.168.241.1
493 ip1 route add 10.0.0.0/24 dev veth1 src 10.0.0.1 metric 2
494 n1 wg set wg0 peer "$pub2" endpoint 10.0.0.2:2
495 n1 ping -W 1 -c 1 192.168.241.2
498 n1 bash -c 'printf 0 > /proc/sys/net/ipv4/conf/veth1/rp_filter'
499 n2 bash -c 'printf 0 > /proc/sys/net/ipv4/conf/veth4/rp_filter'
500 n1 bash -c 'printf 0 > /proc/sys/net/ipv4/conf/all/rp_filter'
501 n2 bash -c 'printf 0 > /proc/sys/net/ipv4/conf/all/rp_filter'
502 n1 ping -W 1 -c 1 192.168.241.2
523 ((i == 255*256*2+1))
612 ! read -r -n 1 -t 2 <&4 || false
623 ip2 addr add fd00:aa::2/64 dev veth2
628 ip1 -6 route add default dev veth1 via fd00:aa::2
630 n1 wg set wg0 peer "$pub2" endpoint [fd00:aa::2]:2
632 n1 ping6 -c 1 fd00::2
648 sleep 2 # Wait for cleanup and grace periods
650 while read -t 0.1 -r line 2>/dev/null || [[ $? -ne 142 ]]; do
652 objects["${BASH_REMATCH[1]}"]+="${BASH_REMATCH[2]}"