feature: ensure ipv4 ip_forward is enable
This commit is contained in:
parent
fdb4db7dba
commit
500d6ad57c
@ -125,12 +125,18 @@ func NewVirtualPairing(ns netns.NsHandle, wanLinkName string) (pair *PairLink, e
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// bash -c 'echo 1 > /proc/sys/net/ipv4/conf/veth4bbc9fef/proxy_arp'
|
||||
// echo 1 > /proc/sys/net/ipv4/conf/veth4bbc9fef/proxy_arp
|
||||
err = sysctl.Set(fmt.Sprintf("net.ipv4.conf.%s.proxy_arp", veth1.Attrs().Name), "1")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||
err = sysctl.Set("net.ipv4.ip_forward", "1")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ipt, err := iptables.New()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user