Describe the bug
I want to create a new route in a new table. Just like the following command does: ip route add default via 192.168.0.8 dev wlo1 table 7.
Please provide a minimal, ready-to-compile example that reproduces the bug
Here's a rough example of the code I used:
Expected behavior
I expected a route to be created. However, when I run ip route show table 7, nothing is shown.
Maybe I am doing something wrong? If so, what would be the correct way to create a default route with "GATEWAY" and "DEVICE" attributes specified using neli?
Additional context
In the examples above, assume there exists a network interface with name wlo1, number 7 and IP address assigned 192.168.0.8.
Also, I have tried running the command specified above with strace and the only invocation of sendmsg command that appeared there looked like this: sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=44, nlmsg_type=RTM_NEWROUTE, nlmsg_flags=NLM_F_REQUEST|NLM_F_ACK|NLM_F_EXCL|NLM_F_CREATE, nlmsg_seq=1726254782, nlmsg_pid=0}, {rtm_family=AF_INET, rtm_dst_len=0, rtm_src_len=0, rtm_tos=0, rtm_table=0x7, rtm_protocol=RTPROT_BOOT, rtm_scope=RT_SCOPE_UNIVERSE, rtm_type=RTN_UNICAST, rtm_flags=0}, [[{nla_len=8, nla_type=RTA_GATEWAY}, inet_addr(\"192.168.0.8\")], [{nla_len=8, nla_type=RTA_OIF}, if_nametoindex(\"wlo1\")]]], iov_len=44}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 44.
Version of neli
0.6.4
Describe the bug I want to create a new route in a new table. Just like the following command does:
ip route add default via 192.168.0.8 dev wlo1 table 7
.Please provide a minimal, ready-to-compile example that reproduces the bug Here's a rough example of the code I used:
Expected behavior I expected a route to be created. However, when I run
ip route show table 7
, nothing is shown. Maybe I am doing something wrong? If so, what would be the correct way to create a default route with "GATEWAY" and "DEVICE" attributes specified usingneli
?Additional context In the examples above, assume there exists a network interface with name
wlo1
, number7
and IP address assigned192.168.0.8
. Also, I have tried running the command specified above withstrace
and the only invocation ofsendmsg
command that appeared there looked like this:sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=44, nlmsg_type=RTM_NEWROUTE, nlmsg_flags=NLM_F_REQUEST|NLM_F_ACK|NLM_F_EXCL|NLM_F_CREATE, nlmsg_seq=1726254782, nlmsg_pid=0}, {rtm_family=AF_INET, rtm_dst_len=0, rtm_src_len=0, rtm_tos=0, rtm_table=0x7, rtm_protocol=RTPROT_BOOT, rtm_scope=RT_SCOPE_UNIVERSE, rtm_type=RTN_UNICAST, rtm_flags=0}, [[{nla_len=8, nla_type=RTA_GATEWAY}, inet_addr(\"192.168.0.8\")], [{nla_len=8, nla_type=RTA_OIF}, if_nametoindex(\"wlo1\")]]], iov_len=44}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 44
.