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 …etty "${1//*-}" "wait for iperf:5201 pid $2"; while [[ $(ss -N "$1" -tlpH 'sport = 5201') != *\"ip…
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
150 n1 wg set wg0 peer "$pub2" endpoint 127.0.0.1:2
153 n2 ping -c 10 -f -W 1 192.168.241.1
174 n1 wg set wg0 peer "$pub2" endpoint [::1]:2
184 n1 wg set wg0 peer "$pub2" endpoint 127.0.0.1:2
189 n2 ping -c 1 -W 1 -s 1269 192.168.241.1
201 n1 wg set wg0 peer "$pub2" endpoint 127.0.0.1:2
202 n1 ping6 -W 1 -c 1 fd00::2
207 n1 wg set wg0 peer "$pub2" endpoint [::1]:2
208 n1 ping -W 1 -c 1 192.168.241.2
232 …$key1") peer "$pub2" preshared-key <(echo "$psk") allowed-ips 192.168.241.2/32 endpoint 127.0.0.1:2
233 n2 wg set wg0 private-key <(echo "$key2") listen-port 2 peer "$pub1" preshared-key <(echo "$psk") a…
234 n1 ping -W 1 -c 1 192.168.241.2
237 n1 ping -W 1 -c 1 192.168.241.2
244 ip2 addr add fd00::5:2/112 dev wg0
245 …o "$key1") peer "$pub2" preshared-key <(echo "$psk") allowed-ips fd00::5:2/128 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…
252 ip2 addr add fd00::2/112 dev wg1
255 …te-key <(echo "$key3") peer "$pub4" allowed-ips 192.168.241.2/32,fd00::2/128 endpoint [fd00::5:2]:5
262 n0 ping -W 1 -c 1 192.168.241.2
266 ! n0 ping -W 1 -c 10 -f 192.168.241.2 || false # Should not crash kernel
279 … │ │ │ │SNAT:192.168.1.0/24│ │ │ │ │ │fd00::2/24 │ │
305 n0 bash -c 'printf 1 > /proc/sys/net/ipv4/ip_forward'
306 n0 bash -c 'printf 2 > /proc/sys/net/netfilter/nf_conntrack_udp_timeout'
307 n0 bash -c 'printf 2 > /proc/sys/net/netfilter/nf_conntrack_udp_timeout_stream'
310 n1 wg set wg0 peer "$pub2" endpoint 10.0.0.100:2 persistent-keepalive 1
311 n1 ping -W 1 -c 1 192.168.241.2
312 n2 ping -W 1 -c 1 192.168.241.1
316 n2 ping -W 1 -c 1 192.168.241.1
320 n1 ping -I wg0 -c 1 -W 1 192.168.241.2
323 n1 ping -c 1 -W 1 192.168.241.2 # First the boring case
324 n1 ping -I wg0 -c 1 -W 1 192.168.241.2 # Then the sk_bound_dev_if case
334 n1 ping -W 1 -c 1 192.168.242.2
337 ! n1 ping -W 1 -c 1 192.168.242.2 || false # Should not crash kernel
354 n1 ping -W 1 -c 100 -f 192.168.99.7
355 n1 ping -W 1 -c 100 -f abab::1111
360 n2 bash -c 'printf 1 > /proc/sys/net/ipv4/ip_forward'
363 [[ $(! n0 ping -W 1 -c 1 192.168.241.1 || false) == *"From 10.0.0.100 icmp_seq=1 Destination Host U…
381 # │ │fd00::1/24 │ │fd00:aa::1/96 ││ │ │fd00:aa::2/96 │ │fd00::2/24 │ │
390 n1 bash -c 'printf 0 > /proc/sys/net/ipv6/conf/all/accept_dad'
391 n2 bash -c 'printf 0 > /proc/sys/net/ipv6/conf/all/accept_dad'
392 n1 bash -c 'printf 0 > /proc/sys/net/ipv6/conf/veth1/accept_dad'
393 n2 bash -c 'printf 0 > /proc/sys/net/ipv6/conf/veth2/accept_dad'
394 n1 bash -c 'printf 1 > /proc/sys/net/ipv4/conf/veth1/promote_secondaries'
400 ip2 addr add fd00:aa::2/96 dev veth2
405 n1 wg set wg0 peer "$pub2" endpoint 10.0.0.2:2
406 n1 ping -W 1 -c 1 192.168.241.2
409 n1 ping -W 1 -c 1 192.168.241.2
410 n1 wg set wg0 peer "$pub2" endpoint [fd00:aa::2]:2
411 n1 ping -W 1 -c 1 192.168.241.2
414 n1 ping -W 1 -c 1 192.168.241.2
424 ip1 addr add fd00:aa::2/96 dev veth1
432 n2 ping -W 1 -c 1 192.168.241.1
435 n2 ping -W 1 -c 1 192.168.241.1
438 n2 ping -W 1 -c 1 192.168.241.1
440 n2 wg set wg0 peer "$pub1" endpoint [fd00:aa::2]:1
441 n2 ping -W 1 -c 1 192.168.241.1
442 [[ $(n2 wg show wg0 endpoints) == "$pub1 [fd00:aa::2]:1" ]]
450 n2 ping -W 1 -c 1 192.168.241.1
475 ip1 route add 10.0.0.0/24 dev veth1 src 10.0.0.1 metric 2
476 n1 wg set wg0 peer "$pub2" endpoint 10.0.0.2:2
477 n1 ping -W 1 -c 1 192.168.241.2
480 n1 bash -c 'printf 0 > /proc/sys/net/ipv4/conf/veth1/rp_filter'
481 n2 bash -c 'printf 0 > /proc/sys/net/ipv4/conf/veth4/rp_filter'
482 n1 bash -c 'printf 0 > /proc/sys/net/ipv4/conf/all/rp_filter'
483 n2 bash -c 'printf 0 > /proc/sys/net/ipv4/conf/all/rp_filter'
484 n1 ping -W 1 -c 1 192.168.241.2
505 ((i == 255*256*2+1))
594 ! read -r -n 1 -t 2 <&4 || false
608 sleep 2 # Wait for cleanup and grace periods
610 while read -t 0.1 -r line 2>/dev/null || [[ $? -ne 142 ]]; do
612 objects["${BASH_REMATCH[1]}"]+="${BASH_REMATCH[2]}"