diff --git a/server/handler/link_tap.go b/server/handler/link_tap.go index fe3ed13..a9ff4b0 100644 --- a/server/handler/link_tap.go +++ b/server/handler/link_tap.go @@ -65,15 +65,16 @@ func LinkTap(cSess *sessdata.ConnSession) error { // arp on cmdstr1 := fmt.Sprintf("ip link set dev %s up mtu %d multicast on", ifce.Name(), cSess.Mtu) cmdstr2 := 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} - err = execCmd(cmdStrs) + err = execCmd([]string{cmdstr1, cmdstr2}) if err != nil { base.Error(err) _ = ifce.Close() return err } + cmdstr3 := fmt.Sprintf("sysctl -w net.ipv6.conf.%s.disable_ipv6=1", ifce.Name()) + execCmd([]string{cmdstr3}) + go tapRead(ifce, cSess) go tapWrite(ifce, cSess) return nil diff --git a/server/handler/link_tun.go b/server/handler/link_tun.go index 822c92a..3d0e456 100644 --- a/server/handler/link_tun.go +++ b/server/handler/link_tun.go @@ -46,15 +46,16 @@ func LinkTun(cSess *sessdata.ConnSession) error { 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", ifce.Name(), base.Cfg.Ipv4Gateway, cSess.IpAddr) - // cmdstr3 := fmt.Sprintf("sysctl -w net.ipv6.conf.%s.disable_ipv6=1", ifce.Name()) - cmdStrs := []string{cmdstr1, cmdstr2} - err = execCmd(cmdStrs) + err = execCmd([]string{cmdstr1, cmdstr2}) if err != nil { base.Error(err) _ = ifce.Close() return err } + cmdstr3 := fmt.Sprintf("sysctl -w net.ipv6.conf.%s.disable_ipv6=1", ifce.Name()) + execCmd([]string{cmdstr3}) + go tunRead(ifce, cSess) go tunWrite(ifce, cSess) return nil