ip -n $ns link add name dummy1 type dummy
ip -n $ns link set dev dummy1 up
ip -n $ns route add table local 192.0.2.1/32 dev dummy1
fib4_trap_check $ns "table local 192.0.2.1/32 dev dummy1" false
check_err $? "Local table route not in hardware when should"
ip -n $ns route add table main 192.0.2.1/32 dev dummy1
fib4_trap_check $ns "table main 192.0.2.1/32 dev dummy1" true
check_err $? "Main table route in hardware when should not"
fib4_trap_check $ns "table local 192.0.2.1/32 dev dummy1" false
check_err $? "Local table route was replaced when should not"
# Test that local routes can replace routes in main table.
ip -n $ns route add table main 192.0.2.2/32 dev dummy1
fib4_trap_check $ns "table main 192.0.2.2/32 dev dummy1" false
check_err $? "Main table route not in hardware when should"
ip -n $ns route add table local 192.0.2.2/32 dev dummy1
fib4_trap_check $ns "table local 192.0.2.2/32 dev dummy1" false
check_err $? "Local table route did not replace route in main table when should"
fib4_trap_check $ns "table main 192.0.2.2/32 dev dummy1" true
check_err $? "Main table route was not replaced when should"
ip -n $ns link add name dummy1 type dummy
ip -n $ns link set dev dummy1 up
ip -n $ns route add table local 2001:db8:1::1/128 dev dummy1
fib6_trap_check $ns "table local 2001:db8:1::1/128 dev dummy1" false
check_err $? "Local table route not in hardware when should"
ip -n $ns route add table main 2001:db8:1::1/128 dev dummy1
fib6_trap_check $ns "table main 2001:db8:1::1/128 dev dummy1" true
check_err $? "Main table route in hardware when should not"
fib6_trap_check $ns "table local 2001:db8:1::1/128 dev dummy1" false
check_err $? "Local table route was replaced when should not"
# Test that local routes can replace routes in main table.
ip -n $ns route add table main 2001:db8:1::2/128 dev dummy1
fib6_trap_check $ns "table main 2001:db8:1::2/128 dev dummy1" false
check_err $? "Main table route not in hardware when should"
ip -n $ns route add table local 2001:db8:1::2/128 dev dummy1
fib6_trap_check $ns "table local 2001:db8:1::2/128 dev dummy1" false
check_err $? "Local route route did not replace route in main table when should"
fib6_trap_check $ns "table main 2001:db8:1::2/128 dev dummy1" true
check_err $? "Main table route was not replaced when should"
log_test "IPv6 local table route replacement"
ip -n $ns link del dev dummy1
}
fib_notify_on_flag_change_set()
{
local notify=$1; shift
ip netns exec testns1 sysctl -qw net.ipv4.fib_notify_on_flag_change=$notify
ip netns exec testns1 sysctl -qw net.ipv6.fib_notify_on_flag_change=$notify
log_info "Set fib_notify_on_flag_change to $notify"
}
setup_prepare()
{
ip netns add testns1 if [ $? -ne 0 ]; then echo"Failed to add netns \"testns1\""
exit 1 fi
devlink dev reload $DEVLINK_DEV netns testns1 if [ $? -ne 0 ]; then echo"Failed to reload into netns \"testns1\""
exit 1 fi
}
cleanup()
{
pre_cleanup
devlink -N testns1 dev reload $DEVLINK_DEV netns $$
ip netns del testns1
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.