Open CDFN opened 9 months ago
This is a config issue, if you add a route the gateway (next-hop) address must be reachable the kernel will validate this thus the network is unreachable
error from the kernel.
If you set the gateway for the route to 127.0.0.1 then it should work I think although it is not really nice I am not sure if it has any downsides.
Sounds like what you really want is a blackhole or unreachable route, i.e. ip route add blackhole 192.168.255.0/24
.
This is not what we support today but could certainly be added.
Thank you for your quick response. Certainly that was config error, as with existing route everything works perfectly. However setting route to 127.0.0.1 doesn't solve my problem (doesn't prevent connections to specified range). Something like blackhole route would be ideal solution for my problem. I might look around how difficult is it to add this feature. Thank you for your input once again!
Actually it does solve my problem, I just used wrong route (10.0.0.0/24
instead 10.0.0.0/8
). I'm sorry for confusion 😁
Creating network with
podman network create --route 10.1.0.0/24,1.1.1.1 --opt no_default_route=1 testserver
:and then attaching a container to it results in
DEBU[0000] ExitCode msg: "netavark (exit code 1): netlink error: network is unreachable (os error 101)"
. This happens whenever I add any route to that network. Without it, everything works. Worth mentioning network is unavailable on a container after attaching it to this network (even though attach was unsuccessful). It is also unavailable for network withoutno_default_route
opt.When creating network with
podman network create --opt no_default_route=1 testserver
results in network:Attach works fine, as expected, network doesn't work due to
no_default_route.
.My goal is to block access to private network ranges via routes.
Am I doing something wrong or it's possibly netavark bug? Thank you in advance.