Init script adds spurious IPv4 default route if dynamic-pool or prefix isn't configured
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tayga (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The init script contains the following code:
if [ "x$CONFIGURE_IFACE" = "xyes" ] ; then
ip link set $TUN_DEVICE up
ip route add $DYNAMIC_POOL dev nat64
ip route add $IPV6_PREFIX dev nat64
fi
If the "dynamic-pool" setting isn't configured in /etc/tayga.conf, $DYNAMIC_POOL is empty. Similarly, if the "prefix" setting isn't, $IPV6_PREFIX is empty. (Both of these settings are optional.) This in turn means that one or both of the "ip route add" commands will evalue to "ip route add dev nat64", which will add a link-local IPv4 default route pointing to the nat64 interface:
root@tayga1-osl1:~# ip -4 r
default dev nat64 scope link
default via 87.238.62.26 dev eth0 metric 100
87.238.62.26/31 dev eth0 proto kernel scope link src 87.238.62.27
Since this new default route has a lower metric than the proper one added by ifupdown, IPv4 connectivity to the server is broken.
The fix is obviously to check whether or not the variables are defined prior to adding the routes. Patch attached.
Tore
Also, you might want to replace the static "nat64" for $TUN_DEVICE.