Subject: GRE and MTU
To: None <tech-kern@NetBSD.ORG>
From: Martin Husemann <martin@duskware.de>
List: tech-kern
Date: 06/08/2002 22:39:20
In PR 16761 Jasper Wallace suggests to bump the GRE MTU from 1450 to 1476.

Myself I'm using a gre tunnel routed over a PPPoE connection, so for me the
correct value probably would be 1470.

Now you can change the mtu with ifconfig any time, but net/if_gre.c clamps
the change to GREMTU (=1450 currently).

So an easy change to make the problem described in the PR at least fixable
by a cluefull admin would be to define a GRE_DEFAULT_MTU (and maybe let that
remain at 1450), which is used to initialize sc->sc_if.if_mtu. Then define
a GRE_MAX_MTU (and maybe set that to 1500), used to clamp the MTU settable
via SIOCSIFMTU.

If possible a better approach might be to use the host route allocated to the
outer tunnel endpoint (oops, another can of worms if you look at the code,
and subject to the recursion bug discussed here some time ago) and use the
route mtu. I don't know how that could be updated when PMTUD changes it, but
if it would be possible, we'd get the optimal MTU for the gre interface.

Any comments or suggestions?

Martin