When setting 0.0.0.0/1, almost traffic are routing to tun, and bind_device_by_index_v4 is used to make the socket binding to the specified network interface such that the traffic of the socket does not pass through the routing table. However, it seems not work when using net-route, the approach does work when using tproxy-config.
The error is
called Result::unwrap() on an Err value: Os { code: 51, kind: NetworkUnreachable, message: "Network is unreachable" }
When setting
0.0.0.0/1
, almost traffic are routing totun
, andbind_device_by_index_v4
is used to make the socket binding to the specified network interface such that the traffic of the socket does not pass through the routing table. However, it seems not work when usingnet-route
, the approach does work when usingtproxy-config
.The error is