[quagga-dev 10451] Re: zebra: Add support for setting interface MTU

David Lamparter equinox at opensourcerouting.org
Sun Apr 21 15:24:56 BST 2013

On Sun, Apr 21, 2013 at 02:13:52PM +0200, Joachim Nilsson wrote:
> Hi,
> I'd like to submit a forward port of Pawel S. Veselov's
> "MTU value for interface" from the GNU Zebra project¹
> It's available for audit at my GitHub repository, under
> the branch zebra-set-mtu.
>      https://github.com/troglobit/quagga/
>      https://github.com/troglobit/quagga/tree/zebra-set-mtu

+/* Attempt to guess default MTU for interface */
+if_default_mtu (struct interface *ifp)
+  if (if_is_loopback (ifp))
+    return 16436;
+  if (if_is_pointopoint (ifp))
+    return 1492;
+  return 1500;
+       "mtu <68-16436>",

Loopback MTU on Linux is 65536 these days.  It has been changed in
0cf833a [v3.6-rc5] "net: loopback: set default mtu to 64K".

In general, guessing the default MTU is probably a bad idea.  Also,
you're using the "default_mtu" as "max" value, which is not only bad
coding style but also wrong (PPP over serial does 1500 w/o problems, my
Ethernet at home does 9200 without problems, etc.)

Just make the "no mtu ..." not reset the MTU, instead just remove the
configuration.  Print a warning "% warning: 'no mtu' does not reset
interface MTU".


More information about the Quagga-dev mailing list