MTU of Current NIC

I am trying to create an analysis to list the MTU value of the adapter with the current IP address. The following relevance fails if the system does not have an adapter with the description “Ethernet connection”. Any help would be appreciated.

maximum transmission unit of adapters whose (description of it as lowercase contains “ethernet connection”) of networks

I wonder whether MTU has a meaning in context of a virtual adapter…

Switching to plurals will avoid an error message for nonexistent values

maximum transmission units of adapters of network

Or, for organizing results

(descriptions of it, maximum transmission units of it) of adapters of network

1 Like

Thanks I will try that. Maybe what I want is the adapter with the current IP address.

What OSes do you need this for? Windows Only? Windows+Linux+Mac?

It is only needed for the Windows OS.

This is MTUs of active adapters:

maximum transmission units of adapters whose(up of it) of networks

Then with IPs: (NOT Loopback)

(maximum transmission units of it, concatenations ";" of (it as string) of addresses of it) of adapters whose(up of it AND not loopback of it) of networks

Thanks jgstew. That is perfect.

This should be Ethernet only: (Type 6)

(maximum transmission units of it, concatenations ";" of (it as string) of addresses of it) of adapters whose(up of it AND not loopback of it AND 6 = type of it) of networks

I don’t know a ton about network adapter types.

Returns the interface type of the specified adapter as defined by the Internet Assigned Names Authority (IANA). Possible values for the interface type are listed in the Ipifcons.h header file.

From here: https://developer.bigfix.com/relevance/reference/network-adapter.html#type-of-network-adapter-integer

I only want IPV4. If that is what you mean.

No i mean, do you want MTU of wifi as well as ethernet, or only ethernet?

I think only Ethernet for now.

Then I think this is the most complete answer:

(maximum transmission units of it, concatenations ";" of (it as string) of addresses of it) of adapters whose(up of it AND not loopback of it AND 6 = type of it) of networks

Where:

adapters whose(up of it AND not loopback of it AND 6 = type of it) of networks

excludes loopback, down, and non ethernet adapters.

2 Likes

This might be a slight enhancement on the filter… adding address of it != "0.0.0.0"

(maximum transmission units of it, concatenations ";" of (it as string) of addresses of it) of adapters whose(up of it AND not loopback of it AND 6 = type of it AND address of it != "0.0.0.0") of networks

Apparently, this inspector is not looking in the correct place. It does not return the same results as this command:
netsh interface ipv4 show subinterface

well that sounds like a platform bug or something. Can you provide more details of how it is wrong?