Particulars about what role a Open vSwitch port/interface has is unfortunately not exposed through sysfs nor iproute2 tools POV. Open vSwitch and its data path driver would manage that based on configuration stored in Open vSwitch.
If it is sufficient to know that this is a Open vSwitch managed port I guess we could get that from udev, for example:
If you really need to know the specific role the port has you would have to query Open vSwitch:
Create a Open vSwitch vlan interface:
# ovs-vsctl add-br br0
# ovs-vsctl add-port br0 enp6s0
# ovs-vsctl add-port br0 enp6s0.9 tag=9 -- set interface enp6s0.9 type=internal
Alternatively you could do the same with "fake bridges" which allows for a slightly different CLI experience, I think netplan does the latter. Anyway, the underlying data structures inside Open vSwitch should be similar.
Particulars about what role a Open vSwitch port/interface has is unfortunately not exposed through sysfs nor iproute2 tools POV. Open vSwitch and its data path driver would manage that based on configuration stored in Open vSwitch.
If it is sufficient to know that this is a Open vSwitch managed port I guess we could get that from udev, for example:
# udevadm info /sys/class/ net/enp6s0. 9 virtual/ net/enp6s0. 9 /devices/ virtual/ net/enp6s0. 9 D=229384665 NAMING_ SCHEME= v245 DRIVER= openvswitch LINK_FILE= /usr/lib/ systemd/ network/ 99-default. link ALIAS=/ sys/subsystem/ net/devices/ enp6s0. 9
P: /devices/
L: 0
E: DEVPATH=
E: INTERFACE=enp6s0.9
E: IFINDEX=7
E: SUBSYSTEM=net
E: USEC_INITIALIZE
E: ID_MM_CANDIDATE=1
E: ID_NET_
E: ID_NET_
E: ID_NET_
E: SYSTEMD_
E: TAGS=:systemd:
If you really need to know the specific role the port has you would have to query Open vSwitch:
Create a Open vSwitch vlan interface:
# ovs-vsctl add-br br0
# ovs-vsctl add-port br0 enp6s0
# ovs-vsctl add-port br0 enp6s0.9 tag=9 -- set interface enp6s0.9 type=internal
Alternatively you could do the same with "fake bridges" which allows for a slightly different CLI experience, I think netplan does the latter. Anyway, the underlying data structures inside Open vSwitch should be similar.
# ovs-vsctl find interface name=enp6s0.9 d004-4b07- 8c81-c7f6885080 40 policing_ burst: 0 policing_ rate: 0 name=openvswitc h}
_uuid : 72ce2c2e-
admin_state : down
bfd : {}
bfd_status : {}
cfm_fault : []
cfm_fault_status : []
cfm_flap_count : []
cfm_health : []
cfm_mpid : []
cfm_remote_mpids : []
cfm_remote_opstate : []
duplex : []
error : []
external_ids : {}
ifindex : 7
ingress_
ingress_
lacp_current : []
link_resets : 0
link_speed : []
link_state : down
lldp : {}
mac : []
mac_in_use : "d2:27:14:2d:60:88"
mtu : 1500
mtu_request : []
name : enp6s0.9
ofport : 2
ofport_request : []
options : {}
other_config : {}
statistics : {collisions=0, rx_bytes=0, rx_crc_err=0, rx_dropped=0, rx_errors=0, rx_frame_err=0, rx_missed_errors=0, rx_over_err=0, rx_packets=0, tx_bytes=0, tx_dropped=0, tx_errors=0, tx_packets=0}
status : {driver_
type : internal
# ovs-vsctl find port name=enp6s0.9 53de-456e- 9c32-f1541c9d39 82 d004-4b07- 8c81-c7f6885080 40]
_uuid : 2c9e20de-
bond_active_slave : []
bond_downdelay : 0
bond_fake_iface : false
bond_mode : []
bond_updelay : 0
cvlans : []
external_ids : {}
fake_bridge : false
interfaces : [72ce2c2e-
lacp : []
mac : []
name : enp6s0.9
other_config : {}
protected : false
qos : []
rstp_statistics : {}
rstp_status : {}
statistics : {}
status : {}
tag : 9
trunks : []
vlan_mode : []
# ovs-vsctl port-to-br enp6s0.9
br0
# ovs-vsctl find bridge name=br0 98b8-43bf- aadf-8d80c7a73a ff enable: false 53de-456e- 9c32-f1541c9d39 82, bbcdb1a8- 4fc8-4e4e- 89c9-5150f7146e 7b, c823daf6- b1e6-45fa- 9e27-10b15e244e de]
_uuid : 4c807016-
auto_attach : []
controller : []
datapath_id : "000000163e96aa14"
datapath_type : ""
datapath_version : "<unknown>"
external_ids : {}
fail_mode : []
flood_vlans : []
flow_tables : {}
ipfix : []
mcast_snooping_
mirrors : []
name : br0
netflow : []
other_config : {}
ports : [2c9e20de-
protocols : []
rstp_enable : false
rstp_status : {}
sflow : []
status : {}
stp_enable : false
# ovs-vsctl show dc4d-495a- 914e-66e049a66a 82
Interface enp6s0.9
type: internal
Interface enp6s0.10
type: internal
Interface br0
type: internal
Interface enp6s0
e7c3bd47-
Bridge br0
Port enp6s0.9
tag: 9
Port enp6s0.10
tag: 10
Port br0
Port enp6s0
ovs_version: "2.13.1"