I have a setup with a bunch of vlan interfaces on a physical interface.
Physical interface: eth1 VLANS on top of this: vlan1, vlan2, vlan3
Now, I want to know which is the parent interface of my vlan (for example, here eth1 is the parent interface of these vlans).
I can get this information by running "ip addr show vlan-name" and then in output, I will get vlan1@eth1, but I need to parse the output of this command or by looking at my network config file, parsing it and interpreting it.
Is there another way by which I can get this information without any parsing logic? For example, for bonded interfaces, the information is present in /sys/class/net/ directory and one can simply read files there.
# cat /sys/class/net/bond0/bonding/slaves eth0 eth1
Is there a similar path/file available for vlan tagged interfaces? I couldn't figure out if there is some file I can just read without any parsing and extract this information or any command/utility that just gives the parent interface name.
Kindly do let me know if there are other alternatives to this.