Commit e014f1d0 authored by Guido Trotter's avatar Guido Trotter
Browse files

KVMHypervisor: configure v6 parameters on nic



In routing mode we are tweaking a few parameters on the interface. With
this patch we'll tweak both the v4 and v6 ones.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 2c5afffb
...@@ -177,10 +177,16 @@ class KVMHypervisor(hv_base.BaseHypervisor): ...@@ -177,10 +177,16 @@ class KVMHypervisor(hv_base.BaseHypervisor):
" dev $INTERFACE\n") " dev $INTERFACE\n")
else: else:
script.write(" /sbin/ip route replace $IP/32 dev $INTERFACE\n") script.write(" /sbin/ip route replace $IP/32 dev $INTERFACE\n")
interface_proxy_arp = "/proc/sys/net/ipv4/conf/$INTERFACE/proxy_arp" interface_v4_conf = "/proc/sys/net/ipv4/conf/$INTERFACE"
interface_forwarding = "/proc/sys/net/ipv4/conf/$INTERFACE/forwarding" interface_v6_conf = "/proc/sys/net/ipv6/conf/$INTERFACE"
script.write(" /bin/echo 1 > %s\n" % interface_proxy_arp) script.write(" if [ -d %s ]; then\n" % interface_v4_conf)
script.write(" /bin/echo 1 > %s\n" % interface_forwarding) script.write(" echo 1 > %s/proxy_arp\n" % interface_v4_conf)
script.write(" echo 1 > %s/forwarding\n" % interface_v4_conf)
script.write(" fi\n")
script.write(" if [ -d %s ]; then\n" % interface_v6_conf)
script.write(" echo 1 > %s/proxy_ndp\n" % interface_v6_conf)
script.write(" echo 1 > %s/forwarding\n" % interface_v6_conf)
script.write(" fi\n")
script.write("fi\n\n") script.write("fi\n\n")
# As much as we'd like to put this in our _ROOT_DIR, that will happen to be # As much as we'd like to put this in our _ROOT_DIR, that will happen to be
# mounted noexec sometimes, so we'll have to find another place. # mounted noexec sometimes, so we'll have to find another place.
......
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