Linux: bridge containers can't reach Tailscale/VPN networks (NAT only on default-route NIC, bridges in no firewalld zone)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- linux, rust
- Área
- backend, networking
Línea de trabajo
Start with crates/kiri-init/src/linux/netlink.rs and crates/kiri-init/src/linux/net.rs, which the issue identifies for NAT installation and uplink selection. Trace bridge creation and teardown to find where firewalld zone membership can be managed. Reproduce the reported container-to-tailnet failure and verify that bridge containers can reach routed networks while internet access still works.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Kiri version and system
Kiri Lite 0.2.1 (.rpm), Fedora 44, kernel 7.2, x86-64. firewalld running (default zone FedoraWorkstation), Tailscale up. Two default routes: wired (metric 100) and wifi (metric 600).
What you did
From a container on the default bridge, connected to a host on the tailnet:
docker run --rm alpine nc -zw3 100.x.y.z 9010
What happened
nc fails with "no route to host". Internet from the same container works (wget http://1.1.1.1). --network host reaches the tailnet. Rootless Docker on the same host reached the tailnet from bridge containers.
I found two gaps; both must be fixed for it to work.
1. NAT only on the default-route NIC.
crates/kiri-init/src/linux/netlink.rsinstall_nat_from: the IPv4 rule isoif <uplink> masquerade(hereoif "enp6s0" masquerade).crates/kiri-init/src/linux/net.rshost_uplink: the uplink is the first default route in/proc/net/route, read once at engine start.- Traffic out of any other interface keeps its 172.x source:
tailscale0(routes in table 52), WireGuard/VPN interfaces, the wifi NIC after the wired link drops.
2. Kiri bridges are in no firewalld zone.
- firewalld's
filter_FORWARD_POLICIESends inreject with icmpx admin-prohibited. The zone withforward: yesonly acceptsoifnameof its own interfaces (enp6s0, wlp5s0).kiri0andtailscale0have no zone, so forwarded packets totailscale0are rejected, and the container sees EHOSTUNREACH. - Internet works only because enp6s0 is a zone interface.
- Docker handles this by adding its bridges to firewalld's
dockerzone (target ACCEPT) with thedocker-forwardingpolicy.
Tested on the host (runtime only, reverted after):
| Change | Container to tailnet | Container to internet |
|---|---|---|
| none | fail | ok |
firewall-cmd --zone=docker --add-interface=kiri0 |
fail | ok |
that + nft add rule ip kiri postrouting ip saddr 172.16.0.0/12 oifname != "kiri*" masquerade |
ok | ok |
What you expected instead
Bridge containers reach every network the host can route to, as with Docker. Suggested fix:
- Masquerade by source, as Docker does (
-s <subnet> ! -o <bridge> -j MASQUERADE) and as Kiri's IPv6 rule already does:ip saddr <subnet> oifname != "kiri*" masqueradeper network. This also removes the need to re-read the default route when it changes. - When firewalld runs (
org.fedoraproject.FirewallD1on D-Bus), add eachkiri*bridge to a zone with target ACCEPT (Kiri's own zone, or thedockerzone as Docker does), and remove it when the bridge goes away.
Anything else
Related: #247 (no forward/NAT rules with FORWARD policy DROP under ufw), #44 (same NAT gap on WSL2).
Workaround: network_mode: host for containers that need the tailnet or a VPN.
- Lenguaje dominante
- Rust
- Estrellas
- 7.5k
- Forks
- 329
- Merge medio
- 7 h 48 min
- PR fusionados (30 d)
- 105
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de libracoder/kiri
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
libracoder/kiri#364 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
libracoder/kiri#289 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 47/100
libracoder/kiri#365 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
libracoder/kiri#362 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 47/100
libracoder/kiri#359 ·
Los mantenedores suelen responder en 1 día
Todos los issues de libracoder/kiri
Issues similares
-
benchmark-review
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
Los mantenedores suelen responder en 1 día
-
area:filesystem bug need-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Captions panel does not offer to show an existing transcriptPosiblemente ocupada @thedavidweng la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
CapSoftware/Cap#4276 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
matrix-org/matrix-rust-sdk#7495 ·
Los mantenedores suelen responder en 1 día