pyroute2
pyroute2 copied to clipboard
Python Netlink and PF_ROUTE library — network configuration and monitoring
We've been looking into the performance of this code: ``` import pyroute2 import cProfile ipr = pyroute2.IPRoute() cProfile.run("ipr.get_addr(ifindex=29)") ``` Substitute the ifindex for an interface with a few addresses on...
* alt_ifname field as a list of strings * schema -- single text field with JSON data
What I think: `ipr.link_lookup(ifname='xxx')` - should lookup by iface name (works OK) This one gives nothing: `ipr.link_lookup(alt_ifname='xxx')` - should lookup by alternative name (IFLA_ALT_IFNAME) This one works partly: `ipr.link_lookup('xxx')` -...
Suppose I want to list the routes. The code ``` for record in ndb.routes.summary().format('csv'): print(record) ``` works, whereas ``` for key in ndb.routes: try: print(ndb.routes[key]) except KeyError: print(f'Offending key: {key._as_dict()}')...
pyroute2: 0.7.3 Steps: 1. Create a vxlan interface ` ip link add enp3s0.4096 type vxlan id 4096 remote X.X.X.X dstport 4789 dev enp3s0` 2. Create some macvlan interfaces based on...
The devlink.DL class prints the VF port MAC incorrectly. For example in [1], the port "enp4s0f1np1_2", that is assigned to a virtual machine and has MAC address "fa:16:3e:5d:9b:a9". The output...
I try to add a record of type hash:net,port for ICMP, here is my shell code ```shell ipset add aclblacklist 219.144.207.0/24,icmp:echo-request ``` aclblacklist is ``` Name: aclblacklist Type: hash:net,port Revision:...
We are using pyroute2.Conntrack class. Our application run in Kubernetes environment, we have several pods which replicate connections between themselves upon needs. Events like pod delete/add/restart in the cluster triggers...
Is it possible to make [`NetlinkSocket.get()`](https://github.com/svinota/pyroute2/blob/0.7.3/pyroute2/netlink/nlsocket.py#L831) non-blocking? E.g. in C we can close the socket from another thread or a signal handler and [`recv()`](https://www.man7.org/linux/man-pages/man2/recv.2.html) would return with `EBADF`. Or we...