Other than ':', which I use for secondary IP "aliases" on a network device (e.g., eth0:1) and '.', which I use for VLANs (e.g., eth0.100), what other device name separators are permissible and wise under Linux?

In one particular system design, I'd like to name my macvlan interfaces so that their base device is obvious. These interfaces might themselves have secondary IPs or VLAN discipline, so I don't want to reuse colon and period. Solidus seems good on paper, but would probably confound scripts that interrogated sysfs looking for, e.g., eth0/1.

up vote 1 down vote accepted
+50

This is really opinion, but I'd suggest _ or -. Both can be used in interface names:

ip link set eth0 down
ip link set eth0 name eth0_sub1
ip link set eth0_sub1 up

ip link show eth0_sub1
2: eth0_sub1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 08:00:27:0f:db:b3 brd ff:ff:ff:ff:ff:ff

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.