How to determine the real MTU and MSS size of my WAN connection (cable modem)
during the setup of wireguard tunnels on my pfSense, I stumbled over the topic of MSS and how to set it correctly. There are many values and recommendations, but as far as I understand the real question is what is the actual MTU of the WAN link which depends on the type of connection (cable, PPPoE, etc.).
Starting from this MTU, I should be able to calculate the optimal MSS value to be set for my LAN interfaces, right?
What I do not understand is how I can really determine my correct MTU and MSS
My setup::
Internet <-> cable modem (bridged mode) <-> pfsense WAN interface (ix1, automatically set to MTU 1500)
When I ping from pfSense via the WAN interface the MTU is 1472. Reasonable as there are 8 Bytes for the ICMP header and 20 Bytes for the IP header. With 1473 I get fragmentation.
(ping -c 1 -S WANIP -s 1472 -D google.com
)
Now, when I ping via the wireguard gateway, I get the same results which I don not understand as all the headers with wireguard should be 60 Bytes.
(ping -c 1 -S WIREGUARDIP -f -l 1472 -D google.com
)
I found also a way to use tcpdump in order to investigate the handshake between the ISP and modem which should reveal the correct MSS.
Using tcpdump -ni ix1 'tcp[13] == 2 or tcp[13] == 16' -vv
even leaves with more questions marks as I do not really understand why I get many results with the WAN IP as destination but with different MSS values: sometimes it’s “mss 1380” and sometimes “1460”
Could you please advice how I can find out about the best MSS value to use in my setup?
Thx in advance