Is VLAN setting through IPDB.interface supported?

65 views
Skip to first unread message

Debashis Prusty

unread,
Jul 11, 2017, 4:48:38 AM7/11/17
to pyroute2-dev
Hi,

I am getting the below "Operation not supported" error while trying to set VLAN. Am I not doing the right thing or there is some other way to achieve it?

>>> intf.load(json.loads('{"vlans":[11]}'));
{'family': 0, 'txqlen': 1000, 'ipdb_scope': 'system', 'index': 4, 'operstate': 'UP', 'num_tx_queues': 1, 'group': 0, 'carrier_changes': 6, 'ipaddr': (('5.5.5.5', 24),), 'neighbours': (), 'ifname': 'enp0s9', 'promiscuity': 0, 'linkmode': 0, 'broadcast': 'ff:ff:ff:ff:ff:ff', 'address': '08:00:27:93:c6:4f', 'vlans': (), 'ipdb_priority': 0, 'qdisc': 'pfifo_fast', 'mtu': 1500, 'num_rx_queues': 1, 'carrier': 1, 'flags': 69699, 'ifi_type': 1, 'ports': ()}
>>> 
>>> intf.review();
{'map': None, '-vlans': set([]), 'stats': None, '-ports': set([]), 'protinfo': None, '-ipaddr': set([]), '+ports': set([]), 'stats64': None, 'af_spec': None, '+vlans': (11,), '+ipaddr': set([]), 'linkinfo': None}
>>> intf.commit();
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/pyroute2/ipdb/interfaces.py", line 1040, in commit
    raise error
pyroute2.netlink.exceptions.NetlinkError: (95, 'Operation not supported')
>>> 

Peter Saveliev

unread,
Jul 11, 2017, 6:07:07 AM7/11/17
to Debashis Prusty, pyroute2-dev
«Operation not supported» is returned not by the IPDB, but by the kernel.

To set VLAN filters on an interface, that interface should be a bridge port, while in the example above enp0s9 has no master (thus it's not a port)

--
You received this message because you are subscribed to the Google Groups "pyroute2-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyroute2-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages