TCP MSS Linux Kernel Setting

How to display and modify the TCP MSS kernel setting on Linux

Maximum Segment Size (MSS)

You can check the current setting like so:

$ sysctl net.ipv4.route.min_adv_mss
net.ipv4.route.min_adv_mss = 256

The MSS advertised by the host depends on the first hop route MTU, but will never be lower than this setting.

Dynamic Configuration

To change the running configuration, use this command with your desired value:

$ sysctl -w net.ipv4.route.min_adv_mss=NNN

You can confirm like so:

$ sysctl net.ipv4.route.min_adv_mss

Permanent Configuration

To make this setting persistent across reboots, edit the /etc/sysctl.conf file like so, save and quit:

$ vi /etc/sysctl.conf

net.ipv4.route.min_adv_mss = NNN


You can then reboot to check the setting persists, or alternatively, run this command to load them:

$ sysctl -p /etc/sysctl.conf

Confirm with this:

$ sysctl net.ipv4.route.min_adv_mss