NEPacketTunnelNetworkSettings - Has anyone been successful setting MTU larger than 1500?

I have the following settings. It fails if I set the mtu to anything larger than 1500. Has anyone been successful with?


let settings = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: "0.0.0.1")

let addresses: [String] = ["0.0.0.2"]

let subnetMasks: [String] = ["255.255.255.0"]

settings.ipv4Settings = NEIPv4Settings(addresses: addresses, subnetMasks: subnetMasks)

settings.mtu = Int(1500) as NSNumber


Thanks,


Dankira.

Answered by dankira in 395072022

HI Eskimo,


Thank you for the response.


I am testing both on iOS 12.1.1 and 13.2.2:


On 12.1.1, it fails consistently with the following message:



NetworkExtension 380 error 11:46:11.257106 -0500 nesessionmanager SIOCGIFMTU failed: Device not configured

NetworkExtension 380 error 11:46:11.257216 -0500 nesessionmanager NEVirtualInterfaceAdjustReadBufferSize: interface_get_mtu failed (6), defaulting to max mtu

NetworkExtension 380 error 11:46:44.847684 -0500 nesessionmanager SIOCGIFMTU failed: Device not configured

NetworkExtension 380 error 11:46:44.847730 -0500 nesessionmanager NEVirtualInterfaceAdjustReadBufferSize: interface_get_mtu failed (6), defaulting to max mtu

NetworkExtension 380 error 11:55:31.579471 -0500 nesessionmanager SIOCGIFMTU failed: Device not configured

NetworkExtension 380 error 11:55:31.579514 -0500 nesessionmanager NEVirtualInterfaceAdjustReadBufferSize: interface_get_mtu failed (6), defaulting to max mtu

NetworkExtension 380 error 11:55:36.318867 -0500 nesessionmanager Failed to set MTU with NEHelper: Invalid argument

nehelper 18562 error 11:55:36.319392 -0500 nehelper Cannot set MTU, Invalid argument

nesessionmanager 380 error 11:55:36.319436 -0500 nesessionmanager NESMVPNSession[iboss cloud connector 2020:BF1772CF-BE07-4EE4-9789-2BD877083041]: failed to set the MTU to 16000


On 13.2.2, I see it failing most of the time but succeeds only rarely.


When it succeeds, I see the MSS being advertised as 1760 but I expect it to be close to 16000.


Thanks,


Dankira.

Define “fails”. Do you get an error reported somewhere? Or is the interface’s MTU simply clipped to 1500?

Also, what platform is this on? And version?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Accepted Answer

HI Eskimo,


Thank you for the response.


I am testing both on iOS 12.1.1 and 13.2.2:


On 12.1.1, it fails consistently with the following message:



NetworkExtension 380 error 11:46:11.257106 -0500 nesessionmanager SIOCGIFMTU failed: Device not configured

NetworkExtension 380 error 11:46:11.257216 -0500 nesessionmanager NEVirtualInterfaceAdjustReadBufferSize: interface_get_mtu failed (6), defaulting to max mtu

NetworkExtension 380 error 11:46:44.847684 -0500 nesessionmanager SIOCGIFMTU failed: Device not configured

NetworkExtension 380 error 11:46:44.847730 -0500 nesessionmanager NEVirtualInterfaceAdjustReadBufferSize: interface_get_mtu failed (6), defaulting to max mtu

NetworkExtension 380 error 11:55:31.579471 -0500 nesessionmanager SIOCGIFMTU failed: Device not configured

NetworkExtension 380 error 11:55:31.579514 -0500 nesessionmanager NEVirtualInterfaceAdjustReadBufferSize: interface_get_mtu failed (6), defaulting to max mtu

NetworkExtension 380 error 11:55:36.318867 -0500 nesessionmanager Failed to set MTU with NEHelper: Invalid argument

nehelper 18562 error 11:55:36.319392 -0500 nehelper Cannot set MTU, Invalid argument

nesessionmanager 380 error 11:55:36.319436 -0500 nesessionmanager NESMVPNSession[iboss cloud connector 2020:BF1772CF-BE07-4EE4-9789-2BD877083041]: failed to set the MTU to 16000


On 13.2.2, I see it failing most of the time but succeeds only rarely.


When it succeeds, I see the MSS being advertised as 1760 but I expect it to be close to 16000.


Thanks,


Dankira.

On 13.2.2, if I set it to anything larger than 16K then it complains with the following message.


tunnelOverheadBytes = 0

MTU = 65000

NetworkExtension 126 error 12:44:45.793492 -0500 nesessionmanager Requested MTU (65000) is larger than maximum allowed (16000)

nesessionmanager 126 error 12:44:45.793600 -0500 nesessionmanager NESMVPNSession[Primary Tunnel:iboss cloud connector 2020:E8DD1908-D4D7-4153-8369-109C13416821:(null)]: failed to set the MTU to 65000

The maximum MTU that can set is 4064 without emitting "Invalid argument". Setting higher will clipped to 1500. Will Apple raise this limit in the future?

NEPacketTunnelNetworkSettings - Has anyone been successful setting MTU larger than 1500?
 
 
Q