Lines Matching +full:route +full:- +full:up
1 #!/usr/bin/env atf-sh
2 #-
3 # SPDX-License-Identifier: BSD-2-Clause
35 atf_set descr 'Test valid IPv4 on-stick fastforwarding to iface'
52 ifconfig ${epair}a up
55 jname="v4t-fwd_ip_icmp_iface_fast_success"
57 jexec ${jname} ifconfig ${epair}b up
67 # As we're doing router-on-the-stick, turn sending IP redirects off:
73 atf_check -s exit:0 $(atf_get_srcdir)/${script_name} \
74 --test_name fwd_ip_icmp_fast \
75 --smac ${our_mac} --dmac ${jail_mac} \
76 --sip ${src_ip} --dip ${ip4a} \
77 --iface ${epair}a
80 atf_check -o match:'1 packet forwarded \(1 packet fast forwarded\)' jexec ${jname} netstat -sp ip
91 atf_set descr 'Test valid IPv4 on-stick fastforwarding to gw'
109 ifconfig ${epair}a up
112 jname="v4t-fwd_ip_icmp_gw_fast_success"
114 jexec ${jname} ifconfig ${epair}b up
124 # As we're doing router-on-the-stick, turn sending IP redirects off:
127 # Add host route
128 jexec ${jname} route -4 add -host ${dst_ip} ${ip4a}
133 atf_check -s exit:0 $(atf_get_srcdir)/${script_name} \
134 --test_name fwd_ip_icmp_fast \
135 --smac ${our_mac} --dmac ${jail_mac} \
136 --sip ${src_ip} --dip ${dst_ip} \
137 --iface ${epair}a
140 atf_check -o match:'1 packet forwarded \(1 packet fast forwarded\)' jexec ${jname} netstat -sp ip
151 atf_set descr 'Test valid IPv4 on-stick "slow" forwarding to iface'
168 ifconfig ${epair}a up
171 jname="v4t-fwd_ip_icmp_iface_slow_success"
173 jexec ${jname} ifconfig ${epair}b up
183 # As we're doing router-on-the-stick, turn sending IP redirects off:
186 # Generate packet with options to force slow-path
187 atf_check -s exit:0 $(atf_get_srcdir)/${script_name} \
188 --test_name fwd_ip_icmp_slow \
189 --smac ${our_mac} --dmac ${jail_mac} \
190 --sip ${src_ip} --dip ${ip4a} \
191 --iface ${epair}a
194 atf_check -o match:'1 packet forwarded \(0 packets fast forwarded\)' jexec ${jname} netstat -sp ip
205 atf_set descr 'Test valid IPv4 on-stick "slow" forwarding to gw'
223 ifconfig ${epair}a up
226 jname="v4t-fwd_ip_icmp_gw_slow_success"
228 jexec ${jname} ifconfig ${epair}b up
238 # As we're doing router-on-the-stick, turn sending IP redirects off:
241 # Add host route
242 jexec ${jname} route -4 add -host ${dst_ip} ${ip4a}
247 atf_check -s exit:0 $(atf_get_srcdir)/${script_name} \
248 --test_name fwd_ip_icmp_fast \
249 --smac ${our_mac} --dmac ${jail_mac} \
250 --sip ${src_ip} --dip ${dst_ip} \
251 --iface ${epair}a
254 atf_check -o match:'1 packet forwarded \(1 packet fast forwarded\)' jexec ${jname} netstat -sp ip
270 jname="v4t-fwd_ip_blackhole"
277 ifconfig ${epair}a 192.0.2.2/24 up
280 jexec ${jname} ifconfig lo0 127.0.0.1/8 up
281 jexec ${jname} ifconfig ${epair}b 192.0.2.1/24 up
282 jexec ${jname} ifconfig ${epair_out}b 198.51.100.1/24 up
285 route add default 192.0.2.1
287 atf_check -s exit:2 -o ignore \
288 ping -c 1 -t 1 198.51.100.2
289 atf_check -s exit:0 -o match:"0 packets not forwardable" \
290 jexec ${jname} netstat -s -p ip
292 # Create blackhole route
293 jexec ${jname} /sbin/route add 198.51.100.2 -blackhole -fib 0
294 jexec ${jname} netstat -rn
297 atf_check -s exit:2 -o ignore \
298 ping -c 1 -t 1 -R 198.51.100.2
299 atf_check -s exit:0 -o match:"1 packet not forwardable" \
300 jexec ${jname} netstat -s -p ip
303 atf_check -s exit:2 -o ignore \
304 ping -c 1 -t 1 198.51.100.2
305 atf_check -s exit:0 -o match:"2 packets not forwardable" \
306 jexec ${jname} netstat -s -p ip