Commit 8866ec86 authored by Guido Trotter's avatar Guido Trotter
Browse files

KVM netscript: add static routes, with no suffix



The /32 suffix is useless, since the kernel already assumes single-host,
if no suffix is specified. Moreover we prefer these routes to be
"static" so that routing daemons, if present, won't mess with them.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 5db6a71c
......@@ -173,10 +173,11 @@ class KVMHypervisor(hv_base.BaseHypervisor):
if nic.nicparams[constants.NIC_LINK]:
script.write(" while /sbin/ip rule del dev $INTERFACE; do :; done\n")
script.write(" /sbin/ip rule add dev $INTERFACE table $LINK\n")
script.write(" /sbin/ip route replace $IP/32 table $LINK"
script.write(" /sbin/ip route replace $IP table $LINK proto static"
" dev $INTERFACE\n")
else:
script.write(" /sbin/ip route replace $IP/32 dev $INTERFACE\n")
script.write(" /sbin/ip route replace $IP proto static"
" dev $INTERFACE\n")
interface_v4_conf = "/proc/sys/net/ipv4/conf/$INTERFACE"
interface_v6_conf = "/proc/sys/net/ipv6/conf/$INTERFACE"
script.write(" if [ -d %s ]; then\n" % interface_v4_conf)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment