Move AWSVPC sysctls into Go code
This commit is contained in:
1 parent
ab380ed2c1
commit
c8e0c12d34
2 files changed
+12
-8
No files matched your search
@@ -228,6 +228,18 @@ func CreateBridge(config *BridgeConfig) (BridgeType, error) {
|
|||||||
|
|
||||||
if config.IsAWSVPC {
|
if config.IsAWSVPC {
|
||||||
bridgeType = AWSVPC
|
bridgeType = AWSVPC
|
||||||
|
// Set proxy_arp on the bridge, so that it could accept packets destined
|
||||||
|
// to containers within the same subnet but running on remote hosts.
|
||||||
|
// Without it, exact routes on each container are required.
|
||||||
|
if err := sysctl("net/ipv4/conf/"+config.WeaveBridgeName+"/proxy_arp", "1"); err != nil {
|
||||||
|
return bridgeType, errors.Wrap(err, "setting proxy_arp")
|
||||||
|
}
|
||||||
|
// Avoid delaying the first ARP request. Also, setting it to 0 avoids
|
||||||
|
// placing the request into a bounded queue as it can be seen:
|
||||||
|
// https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/net/ipv4/arp.c?id=refs/tags/v4.6.1#n819
|
||||||
|
if err := sysctl("net/ipv4/neigh/"+config.WeaveBridgeName+"/proxy_delay", "0"); err != nil {
|
||||||
|
return bridgeType, errors.Wrap(err, "setting proxy_arp")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if bridgeType == Bridge {
|
if bridgeType == Bridge {
|
||||||
|
|||||||
@@ -1427,14 +1427,6 @@ launch_router() {
|
|||||||
|
|
||||||
setup_awsvpc() {
|
setup_awsvpc() {
|
||||||
if [ -n "$AWSVPC" ]; then
|
if [ -n "$AWSVPC" ]; then
|
||||||
# Set proxy_arp on the bridge, so that it could accept packets destined
|
|
||||||
# to containers within the same subnet but running on remote hosts.
|
|
||||||
# Without it, exact routes on each container are required.
|
|
||||||
echo 1 >$PROC_PATH/sys/net/ipv4/conf/$BRIDGE/proxy_arp
|
|
||||||
# Avoid delaying the first ARP request. Also, setting it to 0 avoids
|
|
||||||
# placing the request into a bounded queue as it can be seen:
|
|
||||||
# https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/net/ipv4/arp.c?id=refs/tags/v4.6.1#n819
|
|
||||||
echo 0 >$PROC_PATH/sys/net/ipv4/neigh/$BRIDGE/proxy_delay
|
|
||||||
expose_ip
|
expose_ip
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user