Solved bridge0: invalid MTU: 1500(tap0) != 1480

This is on FreeBSD 13.0-STABLE #0 stable/13-6f2898503.
I never noticed this error with bridge before:

Code:
bridge0: invalid MTU: 1500(tap0) != 1480

/etc/rc.conf
Code:
cloned_interfaces="bridge0 tap0"
ifconfig_bridge0="addm em0 addm tap0 up"

Then tap0 is not added to bridge0

What I am doing to fix this error from the command line:
Code:
ifconfig tap0 up mtu 1480
ifconfig bridge0 addm tap0

I cannot seem to fix the error with MTU commands in /etc/rc.conf
 
Why are you setting the MTU of tap0 to 1480? What MTU does the bridge have, and what MTU do any of the other interfaces attached to bridge0 have? The bridge will use the same MTU as the first interface you attach to it. And all interfaces on the bridge need to have the same MTU.

Setting anything other than 1500 for ethernet is fairly useless. Unless you want to use jumbo frames, but then you set MTU to something higher than 1500.

Code:
dice@hosaka:~ % ifconfig vm-public
vm-public: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 9000
        ether 16:27:7e:87:a7:5f
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
        root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
        member: tap14 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 25 priority 128 path cost 2000000
        member: tap13 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 24 priority 128 path cost 2000000
        member: tap12 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 23 priority 128 path cost 2000000
        member: tap11 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 22 priority 128 path cost 2000000
        member: tap8 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 19 priority 128 path cost 2000000
        member: tap7 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 18 priority 128 path cost 2000000
        member: tap6 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 17 priority 128 path cost 2000000
        member: tap5 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 16 priority 128 path cost 2000000
        member: lagg0.10 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 10 priority 128 path cost 2000000
        groups: bridge vm-switch viid-4c918@
        nd6 options=9<PERFORMNUD,IFDISABLED>
 
At first, I did not set the MTU at all. I just noticed that bridge0 defaults to 1480 and then the bridge0 error message appears.
Code:
 # ifconfig bridge0
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1480

# ifconfig tap0
tap0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500

The only why I can get rid of the error message is to force 1480 on tap0.
 
I just noticed that bridge0 defaults to 1480
Nope. It defaults to 1500.
Code:
root@molly:~ # ifconfig bridge0
ifconfig: interface bridge0 does not exist
root@molly:~ # ifconfig bridge0 create
root@molly:~ # ifconfig bridge0
bridge0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 58:9c:fc:10:df:19
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
        root id 00:00:00:00:00:00 priority 0 ifcost 0 port 0
        groups: bridge
        nd6 options=9<PERFORMNUD,IFDISABLED>
Then changes its MTU to match the first interface you add:
Code:
root@molly:~ # ifconfig tap0
ifconfig: interface tap0 does not exist
root@molly:~ # ifconfig tap0 create
root@molly:~ # ifconfig tap0 mtu 1480
root@molly:~ # ifconfig bridge0
bridge0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 58:9c:fc:10:df:19
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
        root id 00:00:00:00:00:00 priority 0 ifcost 0 port 0
        groups: bridge
        nd6 options=9<PERFORMNUD,IFDISABLED>
root@molly:~ # ifconfig bridge0 addm tap0
root@molly:~ # ifconfig bridge0
bridge0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1480
        ether 58:9c:fc:10:df:19
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
        root id 00:00:00:00:00:00 priority 0 ifcost 0 port 0
        member: tap0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 5 priority 128 path cost 2000000
        groups: bridge
        nd6 options=9<PERFORMNUD,IFDISABLED>
Removing tap0, setting it to 1500 and adding it back again:
Code:
root@molly:~ # ifconfig bridge0 deletem tap0
root@molly:~ # ifconfig bridge0
bridge0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1480
        ether 58:9c:fc:10:df:19
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
        root id 00:00:00:00:00:00 priority 0 ifcost 0 port 0
        groups: bridge
        nd6 options=9<PERFORMNUD,IFDISABLED>
root@molly:~ # ifconfig tap0 mtu 1500
root@molly:~ # ifconfig bridge0 addm tap0
root@molly:~ # ifconfig bridge0
bridge0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 58:9c:fc:10:df:19
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
        root id 00:00:00:00:00:00 priority 0 ifcost 0 port 0
        member: tap0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 5 priority 128 path cost 2000000
        groups: bridge
        nd6 options=9<PERFORMNUD,IFDISABLED>
However, adding a second interface with a mismatching MTU will fail:
Code:
root@molly:~ # ifconfig bridge0 addm tap0
root@molly:~ # ifconfig bridge0
bridge0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 58:9c:fc:10:df:19
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
        root id 00:00:00:00:00:00 priority 0 ifcost 0 port 0
        member: tap0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 5 priority 128 path cost 2000000
        groups: bridge
        nd6 options=9<PERFORMNUD,IFDISABLED>
root@molly:~ # ifconfig tap1 create
root@molly:~ # ifconfig tap1 mtu 1480
root@molly:~ # ifconfig bridge0 addm tap1
ifconfig: BRDGADD tap1: Invalid argument
 
Code:
ifconfig_bridge0="addm em0 addm tap0 up"
You should check the MTU of em0, that's probably set to 1480. When you add this interface first to the bridge, that switches the MTU of the bridge0 to 1480. I would remove the MTU settings from em0, just leave that at the default 1500.
 
OK, light turns on.... I see my problem, further down in the /etc/rc.conf
I have an ifconfig statement to config em0:
Code:
ifconfig_em0_ipv6="inet6 2001:db8:8:4::4 prefixlen 64 mtu 1480"
 
Back
Top