Openconnect doesn't adjust mtu

Fresh install of 23.05.5 and I notice that openconnect tunnel no longer adjusts MTU. Any clue and what needs to be checked?

12: vpn-vpn: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 500
    link/[65534] 
    inet 192.168.2.7/32 brd 255.255.255.255 scope global vpn-vpn
       valid_lft forever preferred_lft forever

Create a /etc/openconnect/post-connect.d/set_mtu script with the following contents:

#!/bin/sh
if [ -n "$INTERNAL_IP4_MTU" ]; then
	ip link set $TUNDEV mtu $INTERNAL_IP4_MTU
fi

Although this solution does not allow setting an arbitrary mtu in /etc/config/network, but it respects the mtu negotiated with the server and survives system updates.

1 Like