Windows: wintun MTU is not set

kay kay.diam at gmail.com
Wed Mar 10 14:13:40 UTC 2021


Thanks. The following code worked for me:

        luid := winipcfg.LUID(tun.LUID())
        iface, err := luid.IPInterface(windows.AF_INET)
        if err != nil {
                return err
        }
        iface.NLMTU = 1302
        err = iface.Set()
        if err != nil {
                return fmt.Errorf("failed to set MTU: %s", err)
        }

On Wed, Mar 10, 2021 at 3:03 PM Jason A. Donenfeld <Jason at zx2c4.com> wrote:
>
> Try using the object returned by luid.IPInterface(windows.AF_INET). Or
> in your example, use AF_INET instead of AF_UNSPEC.


More information about the WireGuard mailing list