Windows: wintun MTU is not set

kay kay.diam at gmail.com
Wed Mar 10 13:36:52 UTC 2021


Hi Everyone,

I noticed that the desired MTU is not set on the wintun interface.

I tried to set MTU after I create an interface:

        interfaces, err := winipcfg.GetIPInterfaceTable(windows.AF_UNSPEC)
        if err != nil {
                return err
        }
        for _, iface := range interfaces {
                if iface.InterfaceLUID == luid {
                        log.Printf("Iface: %+#v", iface)
                        iface.NLMTU = 1302
                        err = iface.Set()
                        if err != nil {
                                log.Printf("failed to set MTU: %s", err)
                        }
                }
        }

but it fails with "The parameter is incorrect." for AF_INET. Setting
MTU for AF_INET6 works with no issues.

Any idea how I can set MTU without netsh?

Regards,


More information about the WireGuard mailing list