Skip to content

Commit

Permalink
Set /proc/sys/net/ipv4/ip_forward on agent start
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Feb 24, 2019
1 parent 012bdcb commit cb5e425
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/agent/syssetup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ import (

var (
callIPTablesFile = "/proc/sys/net/bridge/bridge-nf-call-iptables"
forward = "/proc/sys/net/ipv4/ip_forward"
)

func Configure() error {
exec.Command("modprobe", "br_netfilter").Run()
if err := ioutil.WriteFile(callIPTablesFile, []byte("1"), 0640); err != nil {
logrus.Warnf("failed to write value 1 at %s: %v", callIPTablesFile, err)
}
if err := ioutil.WriteFile(forward, []byte("1"), 0640); err != nil {
logrus.Warnf("failed to write value 1 at %s: %v", forward, err)
}
return nil
}

0 comments on commit cb5e425

Please sign in to comment.