Lines Matching +full:ns +full:- +full:config

2 # SPDX-License-Identifier: GPL-2.0
9 # h0 - r1 - h2
30 if [ ${rc} -eq ${expected} ]; then
31 printf "TEST: %-60s [ OK ]\n" "${msg}"
36 printf "TEST: %-60s [FAIL]\n" "${msg}"
60 if [ "$VERBOSE" = "1" -a -n "$out" ]; then
70 # config
74 local ns=${1}
76 ip netns exec ${ns} sysctl -q -w net.ipv6.conf.all.keep_addr_on_down=1
77 case ${ns} in
79 ip netns exec $ns sysctl -q -w net.ipv6.conf.all.forwarding=0
82 ip netns exec $ns sysctl -q -w net.ipv4.ip_forward=1
83 ip netns exec $ns sysctl -q -w net.ipv6.conf.all.forwarding=1
90 local ns
93 #set -e
101 for ns in ${h[0]} ${r[1]} ${h[1]} ${h[2]} ${h[3]}
103 create_ns ${ns}
112 ip -netns ${h[$i]} li add eth0 type veth peer name r1h${i}
113 ip -netns ${h[$i]} li set eth0 up
114 ip -netns ${h[$i]} li set r1h${i} netns ${r[1]} name eth${i} up
116 ip -netns ${h[$i]} addr add dev eth0 172.16.10${i}.1/24
117 ip -netns ${h[$i]} -6 addr add dev eth0 2001:db8:10${i}::1/64
118 ip -netns ${r[1]} addr add dev eth${i} 172.16.10${i}.254/24
119 ip -netns ${r[1]} -6 addr add dev eth${i} 2001:db8:10${i}::64/64
122 ip -netns ${h[0]} nexthop add id 4 via 172.16.100.254 dev eth0
123 ip -netns ${h[0]} nexthop add id 6 via 2001:db8:100::64 dev eth0
125 # routing from ${h[0]} to h1-h3 and back
128 ip -netns ${h[0]} ro add 172.16.10${i}.0/24 nhid 4
129 ip -netns ${h[$i]} ro add 172.16.100.0/24 via 172.16.10${i}.254
131 ip -netns ${h[0]} -6 ro add 2001:db8:10${i}::/64 nhid 6
132 ip -netns ${h[$i]} -6 ro add 2001:db8:100::/64 via 2001:db8:10${i}::64
137 echo "host 1 config"
138 ip -netns ${h[0]} li sh
139 ip -netns ${h[0]} ro sh
140 ip -netns ${h[0]} -6 ro sh
156 run_cmd ip -netns h${hostid} li set eth0 mtu ${mtu}
157 run_cmd ip -netns ${r1} li set eth${hostid} mtu ${mtu}
174 run_cmd ip netns exec ${h0} ping -s ${ping_sz} -c5 -w5 ${dst}
179 ip -netns ${h0} ro get ${dst}
185 ip -netns ${h0} ro get ${dst} | \
186 grep -q "cache .* mtu ${mtu}"
203 run_cmd ip netns exec ${h0} ${ping6} -s ${ping_sz} -c5 -w5 ${dst}
208 ip -netns ${h0} -6 ro get ${dst}
214 ip -netns ${h0} -6 ro get ${dst} | \
215 grep -q "${dst}.* via ${r1_ip} dev eth0 src ${h0_ip} .* mtu ${mtu}"
237 cpus="$(seq ${cpus/-/ })"
241 # generate a cached route per-cpu
243 run_cmd taskset -c ${c} ip netns exec ${h0} ping -c1 -w1 172.16.10${i}.1
244 [ $? -ne 0 ] && printf "\nERROR: ping to ${h[$i]} failed\n" && ret=1
246 run_cmd taskset -c ${c} ip netns exec ${h0} ${ping6} -c1 -w1 2001:db8:10${i}::1
247 [ $? -ne 0 ] && printf "\nERROR: ping6 to ${h[$i]} failed\n" && ret=1
249 [ $ret -ne 0 ] && break
251 [ $ret -ne 0 ] && break
254 if [ $ret -eq 0 ]; then
283 ip -netns ${h0} ro del 172.16.102.0/24 nhid 4
284 ip -netns ${h0} -6 ro del 2001:db8:102::/64 nhid 6
286 ip -netns ${h0} nexthop del id 4
287 ip -netns ${h0} nexthop del id 6