feature: ensure ipv4 ip_forward is enable

This commit is contained in:
RouxAntoine 2024-01-02 18:43:54 +01:00
parent fdb4db7dba
commit 500d6ad57c
Signed by: antoine
GPG Key ID: 098FB66FC0475E70

View File

@ -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