ROUTED VPC router drops replies to its own traffic over a private gateway

Abierto Apto para principiantes
#14,784 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
62/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
linux, python
Área
networking

Línea de trabajo

La solución está en el código de netfilter en Python del router. Empieza en CsNetfilter.add_ip4_chain y busca dónde se construyen las reglas de ip4_acl del hook INPUT; luego compáralo con el cambio del hook forward al que hace referencia #12986. Confirma el problema con nft list chain ip ip4_acl INPUT, que debería mostrar aceptaciones de ct state established,related para las NIC pública y de invitados, pero no para la NIC de la puerta de enlace. Está terminado cuando UDP al puerto 53 y TCP al puerto 22 a través de la puerta de enlace privada reciben respuestas del router y ping sigue funcionando.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug
problem

On a ROUTED VPC the router can't get replies back for connections it starts itself over a private gateway.
DNS and TCP from the router to a network behind the gateway time out, while ping works.
It looks like the ip4_acl INPUT chain has no ct state established,related accept, so the replies hit the drop policy. Ping only gets through because echo replies are accepted by type.

versions

CloudStack 4.22.1.1, KVM, systemvm template 4.22.0. ROUTED VPC with Static routing and a private gateway (no BGP). Also reproduced on the 4.20 router scripts.

The steps to reproduce the bug
  1. Create a ROUTED VPC with a private gateway (e.g. 100.64.0.1/30) and put a host on the far side (100.64.0.2) running sshd and something on UDP 53.
  2. On the router, ping 100.64.0.2 works.
  3. A UDP query to 100.64.0.2 port 53 or a TCP connect to port 22 from the router times out. tcpdump on the far side shows it answering every time (UDP reply, SYN-ACK), and the router keeps retrying.
  4. nft list chain ip ip4_acl INPUT has ct state established,related accepts for the public NIC and guest tiers, nothing for the gateway NIC.
What to do about it?

Add ct state established,related accept to the input hook in CsNetfilter.add_ip4_chain, like #12986 did for the forward hook. With that rule on the same router, the UDP and TCP tests both work. I'll raise a PR against 4.20.

Lenguaje dominante
Java
Estrellas
3.1k
Forks
1.4k
Merge medio
6 d 18 h
PR fusionados (30 d)
11

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/cloudstack

Todos los issues de apache/cloudstack

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.