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

Offen Anfängerfreundlich
#14,784 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
62/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
linux, python
Bereich
networking

Rechercherichtung

Die Korrektur liegt im Python-Netfilter-Code des Routers. Beginne bei CsNetfilter.add_ip4_chain und finde die Stelle, an der die ip4_acl-Regeln des INPUT-Hooks erzeugt werden. Vergleiche sie dann mit der in #12986 referenzierten Änderung am Forward-Hook. Bestätige das Problem mit nft list chain ip ip4_acl INPUT. Dort sollten ct state established,related-Accepts für die öffentliche und die Gast-NIC erscheinen, aber nicht für die Gateway-NIC. Fertig ist, wenn UDP an Port 53 und TCP an Port 22 über das private Gateway Antworten vom Router erhalten und Ping weiterhin funktioniert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Java
Sterne
3.1k
Forks
1.4k
Ø Merge
6 T. 18 Std.
Gemergte PRs (30 T.)
11

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus apache/cloudstack

Alle Issues in apache/cloudstack

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.