Lines Matching +full:5 +full:ns
31 local ns=$1
35 local rnet=$5
38 …ip -net $ns xfrm policy add src $lnet dst $rnet dir out tmpl src $me dst $remote proto esp mode tu…
40 …ip -net $ns xfrm policy add src $rnet dst $lnet dir fwd tmpl src $remote dst $me proto esp mode tu…
44 local ns=$1
48 local rnet=$5
52 …ip -net $ns xfrm state add src $remote dst $me proto esp spi $spi_in enc aes $KEY_AES auth sha1 …
53 …ip -net $ns xfrm state add src $me dst $remote proto esp spi $spi_out enc aes $KEY_AES auth sha1 …
55 do_esp_policy $ns $me $remote $lnet $rnet
72 local ns=$1
75 ip -net $ns xfrm policy add src 10.1.0.0/24 dst 10.0.0.0/24 dir fwd priority 200 action block
78 ip -net $ns xfrm policy add src 10.2.0.0/24 dst 10.0.0.0/24 dir fwd priority 200 action block
81 ip -net $ns xfrm policy add src 10.2.0.0/23 dst 10.0.1.0/24 dir fwd priority 200 action block
107 ip -net $ns xfrm policy add src 10.1.0.0/24 dst 10.0.0.0/23 dir fwd priority 200 action block
112 …ip -net $ns xfrm policy add src 10.253.1.$((RANDOM%255))/$p dst 10.254.1.$((RANDOM%255))/$p dir fw…
118 local ns=$1
122 ip -net $ns xfrm policy get src $lnet dst $rnet dir out > /dev/null
125 echo "FAIL: ip -net $ns xfrm policy get src $lnet dst $rnet dir out"
129 ip -net $ns xfrm policy get src $rnet dst $lnet dir fwd > /dev/null
132 echo "FAIL: ip -net $ns xfrm policy get src $rnet dst $lnet dir fwd"
138 local ns=$1
142 local plain=$5
145 ip -net $ns xfrm policy add dst $plain dir out priority 10 action allow
148 …ip -net $ns xfrm policy add dst $encryptip dir out tmpl src $me dst $remote proto esp mode tunnel …
153 local ns=$1
157 echo netns exec $ns ip xfrm policy add src 0.0.0.0/0 dst 10.$i.99.0/30 dir out action block
158 echo netns exec $ns ip xfrm policy add src 10.$i.99.0/30 dst 0.0.0.0/0 dir out action block
160 … echo netns exec $ns ip xfrm policy add src 10.$i.1.0/30 dst 10.$i.$j.0/30 dir out action block
162 … echo netns exec $ns ip xfrm policy add src 10.$i.1.0/29 dst 10.$i.$j.0/29 dir out action block
164 … echo netns exec $ns ip xfrm policy add src 10.$i.1.0/24 dst 10.$i.$j.0/24 dir out action block
165 … echo netns exec $ns ip xfrm policy add src 10.$i.$j.0/24 dst 10.$i.1.0/24 dir fwd action block
171 local ns=$1
175 … echo netns exec $ns ip xfrm policy add src dead:$i::/64 dst dead:$i:$j::/64 dir out action block
176 … echo netns exec $ns ip xfrm policy add src dead:$i:$j::/64 dst dead:$i::/24 dir fwd action block
183 ns=$1
185 ip netns exec $ns iptables-save -c |grep policy | ( read c rest
186 ip netns exec $ns iptables -Z
206 ip netns exec ${ns[1]} ping -q -c 1 10.0.2.$ip > /dev/null
208 check_ipt_policy_count ${ns[3]}
212 check_ipt_policy_count ${ns[4]}
217 ip netns exec ${ns[2]} ping -q -c 1 10.0.1.$ip > /dev/null
219 check_ipt_policy_count ${ns[3]}
223 check_ipt_policy_count ${ns[4]}
272 …ip -net ${ns[1]} xfrm policy update src e000:0001::0000 dst ff01::0014:0000:0001 dir in tmpl src :…
273 ip -net ${ns[1]} xfrm policy set hthresh6 0 28 || break
275 …ip -net ${ns[1]} xfrm policy update src e000:0001::0000 dst ff01::01 dir in tmpl src :: dst :: pro…
276 ip -net ${ns[1]} xfrm policy set hthresh6 0 28 || break
293 local ns=$1
297 ip -net $ns xfrm policy flush
299 ip -net $ns xfrm policy add dst $j.0.0.0/24 dir out priority 10 action allow
302 if ! ip -net $ns xfrm policy get dst $j.0.0.0/24 dir out > /dev/null; then
310 ip -net $ns xfrm policy flush
313 ip -net $ns xfrm policy add dst $addr dir out priority 10 action allow
317 if ! ip -net $ns xfrm policy get dst $addr dir out > /dev/null; then
324 ip -net $ns xfrm policy flush
350 ns[1]=$ns1
351 ns[2]=$ns2
352 ns[3]=$ns3
353 ns[4]=$ns4
356 ip link add $DEV netns ${ns[1]} type veth peer name eth1 netns ${ns[3]}
357 ip link add $DEV netns ${ns[2]} type veth peer name eth1 netns ${ns[4]}
359 ip link add $DEV netns ${ns[3]} type veth peer name veth0 netns ${ns[4]}
363 ip -net ${ns[$i]} link set $DEV up
364 ip -net ${ns[$i]} addr add 10.0.$i.2/24 dev $DEV
365 ip -net ${ns[$i]} addr add dead:$i::2/64 dev $DEV
367 ip -net ${ns[$i]} addr add 10.0.$i.253 dev $DEV
368 ip -net ${ns[$i]} addr add 10.0.$i.254 dev $DEV
369 ip -net ${ns[$i]} addr add dead:$i::fd dev $DEV
370 ip -net ${ns[$i]} addr add dead:$i::fe dev $DEV
374 ip -net ${ns[$i]} link set eth1 up
375 ip -net ${ns[$i]} link set veth0 up
378 ip -net ${ns[1]} route add default via 10.0.1.1
379 ip -net ${ns[2]} route add default via 10.0.2.1
381 ip -net ${ns[3]} addr add 10.0.1.1/24 dev eth1
382 ip -net ${ns[3]} addr add 10.0.3.1/24 dev veth0
383 ip -net ${ns[3]} addr add 2001:1::1/64 dev eth1
384 ip -net ${ns[3]} addr add 2001:3::1/64 dev veth0
386 ip -net ${ns[3]} route add default via 10.0.3.10
388 ip -net ${ns[4]} addr add 10.0.2.1/24 dev eth1
389 ip -net ${ns[4]} addr add 10.0.3.10/24 dev veth0
390 ip -net ${ns[4]} addr add 2001:2::1/64 dev eth1
391 ip -net ${ns[4]} addr add 2001:3::10/64 dev veth0
392 ip -net ${ns[4]} route add default via 10.0.3.1
396 ip netns exec ${ns[$i]} sysctl net.ipv$j.conf.eth1.forwarding=1 > /dev/null
397 ip netns exec ${ns[$i]} sysctl net.ipv$j.conf.veth0.forwarding=1 > /dev/null
402 ip netns exec ${ns[3]} iptables -p icmp -A FORWARD -m policy --dir out --pol ipsec
403 ip netns exec ${ns[4]} iptables -p icmp -A FORWARD -m policy --dir out --pol ipsec
411 do_esp ${ns[3]} 10.0.3.1 10.0.3.10 10.0.1.0/24 10.0.2.0/24 $SPI1 $SPI2
412 do_esp ${ns[3]} dead:3::1 dead:3::10 dead:1::/64 dead:2::/64 $SPI1 $SPI2
413 do_esp ${ns[4]} 10.0.3.10 10.0.3.1 10.0.2.0/24 10.0.1.0/24 $SPI2 $SPI1
414 do_esp ${ns[4]} dead:3::10 dead:3::1 dead:2::/64 dead:1::/64 $SPI2 $SPI1
416 do_dummies4 ${ns[3]}
417 do_dummies6 ${ns[4]}
419 do_esp_policy_get_check ${ns[3]} 10.0.1.0/24 10.0.2.0/24
420 do_esp_policy_get_check ${ns[4]} 10.0.2.0/24 10.0.1.0/24
421 do_esp_policy_get_check ${ns[3]} dead:1::/64 dead:2::/64
422 do_esp_policy_get_check ${ns[4]} dead:2::/64 dead:1::/64
435 do_exception ${ns[3]} 10.0.3.1 10.0.3.10 10.0.2.253 10.0.2.240/28
436 do_exception ${ns[4]} 10.0.3.10 10.0.3.1 10.0.1.253 10.0.1.240/28
438 do_exception ${ns[3]} dead:3::1 dead:3::10 dead:2::fd dead:2:f0::/96
439 do_exception ${ns[4]} dead:3::10 dead:3::1 dead:1::fd dead:1:f0::/96
447 do_overlap ${ns[3]}
454 for n in ${ns[3]} ${ns[4]};do
456 sleep $((RANDOM%5))
462 ip -net ${ns[3]} xfrm policy flush
464 do_esp_policy ${ns[3]} 10.0.3.1 10.0.3.10 10.0.1.0/24 10.0.2.0/24
465 do_exception ${ns[3]} 10.0.3.1 10.0.3.10 10.0.2.253 10.0.2.240/28
468 ip -net ${ns[3]} xfrm policy set hthresh4 16 16
470 sleep $((RANDOM%5))
474 for n in ${ns[3]} ${ns[4]};do
476 sleep $((RANDOM%5))
482 check_random_order ${ns[3]} "policies inserted in random order"