Comments (3)
try with:
./nl-route-add --scope=link --protocol=kernel --dst=10.0.0.0/24 --nexthop=dev=eth101,via=10.0.0.1
Error: Unable to add route: Unspecific failure
./nl-route-add --scope=link --protocol=kernel --dst=10.0.0.0/24 --src=10.0.0.3 --nexthop=dev=eth101,via=10.0.0.1
Error: Unable to set source address: Source based routing not supported
./nl-route-add --iif=eth101 --scope=link --protocol=kernel --dst=10.0.0.0/24 --src=10.0.0.3
Error: Unable to set source address: Source based routing not supported
change --src
into --pref-src
get Unspecific failure
from libnl.
rtnl_route_add
return error No such device
, but the route is add into system.
from libnl.
I adjust some order and it get fixed.
errn0 = nl_addr_parse(subnet, family, &dst_addr);
if( dst_addr == NULL ) {
break;
}
errn0 = rtnl_route_set_dst(route, dst_addr);
if( errn0 < 0 ) {
break;
}
errn0 = nl_addr_parse(ip, family, &src_addr);
if( src_addr == NULL ) {
break;
}
errn0 = rtnl_route_set_family(route, family);
if( errn0 < 0 ) {
break;
}
errn0 = rtnl_route_set_pref_src(route, src_addr);
if( errn0 < 0 ) {
break;
}
struct rtnl_nexthop *nh = rtnl_route_nh_alloc();
if( nh == NULL ) {
break;
}
errn0 = rtnl_route_nh_set_newdst(nh, dst_addr);
if( errn0 < 0 ) {
break;
}
rtnl_route_nh_set_ifindex(nh, ifindex);
rtnl_route_add_nexthop(route, nh);
errn0 = rtnl_route_set_family(route, family);
if( errn0 < 0 ) {
break;
}
rtnl_route_set_priority(route, RTN_UNSPEC);
rtnl_route_set_protocol(route, RTPROT_KERNEL);
rtnl_route_set_scope(route, RT_SCOPE_LINK);
rtnl_route_set_table(route, RT_TABLE_MAIN);
rtnl_route_set_iif(route, ifindex);
errn0 = rtnl_route_add(sock, route, NLM_F_CREATE | NLM_F_REPLACE);
if( errn0 < 0 ) {
break;
}
line = 0;
from libnl.
Related Issues (20)
- Warnings about missing symbol when building with mold linker HOT 11
- Get all SP policies
- Zero counter IPCTNL_MSG_CT_GET_CTRZERO while listing does not work HOT 2
- Build failed HOT 2
- Is the comment for nl_nh_group_info correct? HOT 2
- InvalidFree and InvalidRead in Valgrind when linked against libnl HOT 3
- libnl-3.8.0 fails checks HOT 6
- need help about rtnl_route_nh_set_via HOT 1
- support linux altname
- error: storage size of 'tm_buf' isn't known due to missing #include <time.h> HOT 1
- 2nd RTM_NEWLINK notification with operstate down is always 1 second delayed HOT 3
- Question: how are multiple VLANs in a bridge with VLAN filtering mode represented
- bridge object in link cache may get replaced by an incomplete object HOT 3
- Package for RHEL HOT 3
- Question: message request type for adding/deleting vlan id on port
- mdb implementation inefficient HOT 3
- Test failure on 3.9.0: `tests/nl-test-util.c:128:S:Core:test_create_iface:0: assert(r == 0) failed (errno=1, Operation not permitted)` HOT 1
- tc flower, set flowid
- Causes for TSF never increasing ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libnl.