Skip to content
Snippets Groups Projects
Commit 0a3c881e authored by Guido Trotter's avatar Guido Trotter
Browse files

KVM nic script: enable interface forwarding


If forwarding is enabled globally this is a no-op. If instead it's
enabled only for some special interfaces where instance traffic has to
go to/comes from (for example a gre tunnel) then it's useful to
explicitely enable it for the instances interfaces as well.

Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 7c60f7a2
No related branches found
No related tags found
No related merge requests found
...@@ -174,7 +174,9 @@ class KVMHypervisor(hv_base.BaseHypervisor): ...@@ -174,7 +174,9 @@ class KVMHypervisor(hv_base.BaseHypervisor):
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_proxy_arp = "/proc/sys/net/ipv4/conf/$INTERFACE/proxy_arp"
interface_forwarding = "/proc/sys/net/ipv4/conf/$INTERFACE/forwarding"
script.write(" /bin/echo 1 > %s\n" % interface_proxy_arp) script.write(" /bin/echo 1 > %s\n" % interface_proxy_arp)
script.write(" /bin/echo 1 > %s\n" % interface_forwarding)
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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment