Skip to content

Commit cb5e425

Browse files
Set /proc/sys/net/ipv4/ip_forward on agent start
1 parent 012bdcb commit cb5e425

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/agent/syssetup/setup.go

+4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ import (
99

1010
var (
1111
callIPTablesFile = "/proc/sys/net/bridge/bridge-nf-call-iptables"
12+
forward = "/proc/sys/net/ipv4/ip_forward"
1213
)
1314

1415
func Configure() error {
1516
exec.Command("modprobe", "br_netfilter").Run()
1617
if err := ioutil.WriteFile(callIPTablesFile, []byte("1"), 0640); err != nil {
1718
logrus.Warnf("failed to write value 1 at %s: %v", callIPTablesFile, err)
1819
}
20+
if err := ioutil.WriteFile(forward, []byte("1"), 0640); err != nil {
21+
logrus.Warnf("failed to write value 1 at %s: %v", forward, err)
22+
}
1923
return nil
2024
}

0 commit comments

Comments
 (0)