diff --git a/vpn_slice/__main__.py b/vpn_slice/__main__.py index 16a91f7..25c112b 100755 --- a/vpn_slice/__main__.py +++ b/vpn_slice/__main__.py @@ -455,6 +455,14 @@ def parse_env(environ=os.environ): print("WARNING: IPv6 split network (CISCO_IPV6_SPLIT_%s_%d_{ADDR,MASKLEN}) %s/%d has host bits set, replacing with %s" % (pfx, n, ad, nml, net), file=stderr) env['split' + pfx.lower()].append(net) + # If MTU is <1280, then IPv6 is not possible. + # Furthermore, it appears that any-and-all IPv6-related configuration will fail (at + # least on Linux, where iproute(8) gives very cryptic errors like + # "RTNETLINK answers: Invalid argument error"), preventing vpn-slice from completing + # a working setup even for IPv4. + if env.mtu < 1280 and (env.myaddr6 or any(r.version == 6 for r in env.splitinc)): + raise RuntimeError(f"MTU of {int(mtu)} is too small for IPv6 (minimum 1280). Invoke OpenConnect with --disable-ipv6 to configure for IPv4 only", file=stderr) + return env # Parse command-line arguments and environment