What Length Can a Network Interface Name Have

Maximum length of the textual representation of an IPv6 address?

45 characters.

You might expect an address to be

0000:0000:0000:0000:0000:0000:0000:0000

8 * 4 + 7 = 39

8 groups of 4 digits with 7 : between them.

But if you have an IPv4-mapped IPv6 address, the last two groups can be written in base 10 separated by ., eg. [::ffff:192.168.100.228]. Written out fully:

0000:0000:0000:0000:0000:ffff:192.168.100.228

(6 * 4 + 5) + 1 + (4 * 3 + 3) = 29 + 1 + 15 = 45

Note, this is an input/display convention - it's still a 128 bit address and for storage it would probably be best to standardise on the raw colon separated format, i.e. [0000:0000:0000:0000:0000:ffff:c0a8:64e4] for the address above.

On Windows how to get network interface name whether its eth0/eth1/eth2 using batch script?

This should give you the Network Interface Name:

@Echo Off
For /F "Skip=1Delims=" %%a In (
'"WMIC NIC Where (Not NetConnectionStatus Is Null) Get NetConnectionID"'
) Do For /F "Tokens=*" %%b In ("%%a") Do Echo=%%b
Timeout -1

What can be the max length of a docker-compose network name?

So after not having had an answer after a few days I did some empirical testing of my own and found out that it is different for different OS's. I wanted to write my answer down for others with the same problem.

Here is what I found:

  • docker on a mac mac can have very long network names and can even have / chars in it
  • some linux distributions can have 16 chars (e.g. CentOs) and others 15 (e.g. Ubuntu).
  • couldn't test on Windows as I have none available

So if you want to be save and have your docker-compose.yml work on different environments you should stick to a network name with a max length of 15 chars.

Also used this answer: What length can a network interface name have?

How to get the current MTU of an interface in C#

I've found the answer by myself. I have to change the MTU also for the ipv6 interface like:

netsh interface ipv4 set subinterface 11 mtu=1700 store=persistent

netsh interface ipv6 set subinterface 11 mtu=1700 store=persistent


Related Topics



Leave a reply



Submit