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

Aperta Adatta ai principianti
#14,784 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
62/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
linux, python
Ambito
networking

Direzione di ricerca

La correzione si trova nel codice Python di netfilter del router. Parti da CsNetfilter.add_ip4_chain e individua dove vengono costruite le regole ip4_acl dell'hook INPUT, quindi confrontale con la modifica dell'hook forward citata in #12986. Conferma il problema con nft list chain ip ip4_acl INPUT, che dovrebbe mostrare le accept ct state established,related per le NIC pubblica e guest, ma non per la NIC del gateway. È completato quando UDP verso la porta 53 e TCP verso la porta 22 attraverso il gateway privato ricevono risposte dal router e ping continua a funzionare.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Java
Stelle
3.1k
Fork
1.4k
Merge medio
6g 18h
PR unite (30g)
11

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/cloudstack

Tutte le issue di apache/cloudstack

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.