1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-05 16:00:28 +08:00

fix mtu on win

This commit is contained in:
fumiama
2022-01-01 20:23:12 +08:00
parent 2b0d5059ec
commit 400a5a86e5

View File

@@ -11,7 +11,8 @@ func (n *NIC) Up() {
if err != nil {
panic(err)
}
execute("cmd", "/c", "netsh interface ip set address name=\""+n.ifce.Name()+"\" source=static addr=\""+n.ip+"\" mask=\""+(net.IP)(ipn.Mask).String()+"\" gateway=none mtu="+n.mtu)
execute("cmd", "/c", "netsh interface ip set address name=\""+n.ifce.Name()+"\" source=static addr=\""+n.ip+"\" mask=\""+(net.IP)(ipn.Mask).String()+"\" gateway=none")
execute("cmd", "/c", "netsh interface ipv4 set subinterface \""+n.ifce.Name()+"\" mtu="+n.mtu)
for _, c := range n.cidrs {
ip, cidr, err := net.ParseCIDR(c)
if err != nil {