修复没有ipv6报错的问题

This commit is contained in:
bjdgyc 2021-07-16 18:10:13 +08:00
parent e7ef29c4ad
commit a8038f8fe9
2 changed files with 5 additions and 5 deletions

View File

@ -64,9 +64,9 @@ func LinkTap(cSess *sessdata.ConnSession) error {
// arp on // arp on
cmdstr1 := fmt.Sprintf("ip link set dev %s up mtu %d multicast on", ifce.Name(), cSess.Mtu) cmdstr1 := fmt.Sprintf("ip link set dev %s up mtu %d multicast on", ifce.Name(), cSess.Mtu)
cmdstr2 := fmt.Sprintf("sysctl -w net.ipv6.conf.%s.disable_ipv6=1", ifce.Name()) cmdstr2 := fmt.Sprintf("ip link set dev %s master %s", ifce.Name(), bridgeName)
cmdstr3 := fmt.Sprintf("ip link set dev %s master %s", ifce.Name(), bridgeName) // cmdstr3 := fmt.Sprintf("sysctl -w net.ipv6.conf.%s.disable_ipv6=1", ifce.Name())
cmdStrs := []string{cmdstr1, cmdstr2, cmdstr3} cmdStrs := []string{cmdstr1, cmdstr2}
err = execCmd(cmdStrs) err = execCmd(cmdStrs)
if err != nil { if err != nil {
base.Error(err) base.Error(err)

View File

@ -46,8 +46,8 @@ func LinkTun(cSess *sessdata.ConnSession) error {
cmdstr1 := fmt.Sprintf("ip link set dev %s up mtu %d multicast off", ifce.Name(), cSess.Mtu) cmdstr1 := fmt.Sprintf("ip link set dev %s up mtu %d multicast off", ifce.Name(), cSess.Mtu)
cmdstr2 := fmt.Sprintf("ip addr add dev %s local %s peer %s/32", cmdstr2 := fmt.Sprintf("ip addr add dev %s local %s peer %s/32",
ifce.Name(), base.Cfg.Ipv4Gateway, cSess.IpAddr) ifce.Name(), base.Cfg.Ipv4Gateway, cSess.IpAddr)
cmdstr3 := fmt.Sprintf("sysctl -w net.ipv6.conf.%s.disable_ipv6=1", ifce.Name()) // cmdstr3 := fmt.Sprintf("sysctl -w net.ipv6.conf.%s.disable_ipv6=1", ifce.Name())
cmdStrs := []string{cmdstr1, cmdstr2, cmdstr3} cmdStrs := []string{cmdstr1, cmdstr2}
err = execCmd(cmdStrs) err = execCmd(cmdStrs)
if err != nil { if err != nil {
base.Error(err) base.Error(err)