Summary: | route delete fails when specifying -iface | ||
---|---|---|---|
Product: | Base System | Reporter: | mmendoza |
Component: | kern | Assignee: | freebsd-net (Nobody) <net> |
Status: | Closed FIXED | ||
Severity: | Affects Some People | CC: | freebsd, rcm, zlei |
Priority: | --- | ||
Version: | 14.0-CURRENT | ||
Hardware: | Any | ||
OS: | Any |
Description
mmendoza
2023-09-08 19:08:30 UTC
is this with or without netlink? In the 12.3 test, without netlink; in the 14.0 test, with netlink. Further tests indicate that it's only an issue with combining both "-inet" and "-iface" (IPv6 works), and only when the CIDR size is omitted. This works: # route del -inet 192.168.1.0/24 -iface vmx0 i seem to have figured most of that out, too, when writing this code https://github.com/canonical/cloud-init/blob/main/cloudinit/net/netops/bsd_netops.py#L35 (contrast the Linux Code here, it's based on: https://github.com/canonical/cloud-init/blob/main/cloudinit/net/netops/iproute2.py#L51 ) (In reply to mmendoza from comment #0) > Example route: > # route show -inet default > route to: default > destination: default > mask: default > gateway: 10.0.5.1 > fib: 0 > interface: vmx0 > flags: <UP,GATEWAY,DONE,STATIC> > recvpipe sendpipe ssthresh rtt,msec mtu weight expire 0 0 0 0 1500 0 0 Option `-iface` of route(8) is for directly connected route. In the above example, the `default` or `0.0.0.0/0` is not directly connected. It does not make sense if you try to delete it with option `-iface`. (In reply to mmendoza from comment #2) > Further tests indicate that it's only an issue with combining both "-inet" and > "-iface" (IPv6 works), and only when the CIDR size is omitted. This works: > # route del -inet 192.168.1.0/24 -iface vmx0 I bet your route `192.168.1.0/24` is directly connected. It may looks like: ``` route to: 192.168.1.0 destination: 192.168.1.0 mask: 255.255.255.0 fib: 0 interface: vmx0 flags: <UP,DONE,PINNED> recvpipe sendpipe ssthresh rtt,msec mtu weight expire 0 0 0 0 1500 1 0 ``` It fails either way. (In reply to mmendoza from comment #5) Can you share your route table ? (In reply to Zhenlei Huang from comment #6) The test was on a system with a single interface where "10.0.5.1" is the connected network and "192.168.1.0/24" is a manually-added static route. I can recreate the test and pull the output if needed. Closing this as fixed - I am not able to reproduce it on more recent 14.0-ALPHA builds. For reference, it seems to have been fixed between src commits 680ad06f and b23dbabb. |