foto2004
Goto Top

NAT auf Proxmox für einen LXC Container

Hallo Gemeinde,

da ich mit NAT und iptables native noch nicht viel Erfahrung habe nehme ich an dass ich irgend etwas übersehen habe oder grundsätzlich was falsch mache.

Ausgangspunkt:

ich habe einen Server bei Hetzner mit Proxmox einer öffentlicher ip und 2 weiteren öffentlichen IP-Ranges.
Es laufen auch einige Win-Server und Linux-Server. Das Routing funktioniert soweit und alle Server sind erreichbar Fundkönnen mit dem Internet kommunizieren.

Die NIC auf dem Proxmox ist die eno1

dann habe ich noch 3 Bridges

vmbr0 10.0.0.0/24
vmbr1 1. IP-Range (öffentlich)
vmbr2 2. IP-Range (öffentlich)

So jetzt bin ich aber auf die Idee gekommen in das vmbr0 (10.0.0.0/24) einen LXC-2 (Mailrelay) zu setzen.
Der LXC-2 kann mit allen meinen iOS die auf dem Proxmox sind kommunizieren aber er kommt nicht ins internet.

Ich habe diese iptables Regel definiert (nach einer Suche im Internet):
iptables -t nat -A POSTROUTING -o eno1 -j SNAT --to-source 10.0.0.0/24
es soll ja nur das 10.0.0.0/24 umgebogen werden.

Aber trotzdem kommt er nicht weiter als zu der NIC des Proxmox Servers.

Was habe ich übersehen? Beziehungsweise was mache ich falsch?

anbei noch ein Bild das mein Dilemma grafisch darstellt.
it-jul.drawio

Content-Key: 7857325180

Url: https://administrator.de/contentid/7857325180

Printed on: April 28, 2024 at 02:04 o'clock

Mitglied: 7426148943
7426148943 Jul 15, 2023 updated at 05:46:07 (UTC)
Goto Top
Die Regel ist falsch, du willst ja nicht jede private Quelladresse zu einer privaten umschreiben sondern die private in die öffentliche des Proxmox, ergo ein Masquerade auf die Public IP von eno1
iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o eno1 -j MASQUERADE
Alternativ auf eine bestimmte IP aus deinem Pool von öffentlichen Adressen umschreiben die von Hetzner auf deine eno1 geroutet wird
iptables -t nat -A POSTROUTING -o eno1 -s 10.0.0.0/24 -j SNAT --to-source [PUBLIC IP]
https://techlr.de/proxmox-nat-vms-einrichten/

Zeppel
Member: foto2004
foto2004 Jul 15, 2023 at 05:59:43 (UTC)
Goto Top
OK leuchtet ein. habe ich eingetragen aber geht trotzdem nicht auch wen ich:
pve-firewall restart
loslasse tut sich nichts.
Mitglied: 7426148943
7426148943 Jul 15, 2023 updated at 07:03:15 (UTC)
Goto Top
Lies den Link.

Erst mal eine IP z.B. 1.1.1.1 Pingen, geht das dann ist die DNS-Auflösung schuld, wenn nicht prüfen ob Proxmox Gateway der VM ist.
Und auch die Firewall-Regeln auf der LXC Bridge checken ob die überhaupt ein Routing ins Internet zulassen.
Ansonsten Wireshark ist dein Freund und Helfer.

Ohne deine Config des Hosts im Klartext vorliegen zu haben, Glaskugel, du verstehen ... "Tut sich nix" hilft hier keinem.
Member: foto2004
foto2004 Jul 15, 2023 at 07:30:17 (UTC)
Goto Top
Es geht kein Ping auf die 1.1.1.1 (siehe Grafik)

hier meine /etc/network/interfaces vom Proxmox

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

iface lo inet6 loopback

auto eno1
iface eno1 inet static
        address 142.x.x.114/26
        gateway 142.x.x.65
        up route add -net 142.x.x.64 netmask 255.255.255.192 gw 142.x.x.65 dev eno1
# route 142.x.x.64/26 via 142.x.x.65

iface eno1 inet6 static
        address 2a01:4f8:x:x::2/64
        gateway fe80::1

auto vmbr0
iface vmbr0 inet static
        address 10.0.0.10/24
        bridge-ports none
        bridge-stp off
        bridge-fd 0
        post-up iptables -t nat -A POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j MASQUERADE  
        post-down iptables -t nat -F

#Internes Netz

auto vmbr1
iface vmbr1 inet static
        address 5.9.x.x/29
        bridge-ports none
        bridge-stp off
        bridge-fd 0

auto vmbr2
iface vmbr2 inet static
        address 136.243.x.x/29
        bridge-ports none
        bridge-stp off
        bridge-fd 0

und hier die vom LXC-2:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 10.0.0.20/24
        gateway 10.0.0.10

Bitte sag mir welche Config du noch brauchst
Mitglied: 7426148943
7426148943 Jul 15, 2023 updated at 07:47:40 (UTC)
Goto Top
post-up iptables -t nat -A POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j MASQUERADE
Wieder ein Fehler. out-Interface sollte hier eno1 und nicht vmbr0 sein, wir wollen ja nur die Quelladresse umschreiben wenn der Traffic den Host gen Internet verlässt intern kann er ja die SRC-Adresse behalten da reicht normales Routing ohne NAT.

Bitte sag mir welche Config du noch brauchst
Die gesamte Firewall Config von iptables.
Member: foto2004
foto2004 Jul 15, 2023 at 07:54:22 (UTC)
Goto Top
O sry war in Kopierfehler

wie komme ich an gesamte Firewall Config von iptables?
Mitglied: 7426148943
7426148943 Jul 15, 2023 at 08:00:44 (UTC)
Goto Top
iptables -S
Member: foto2004
foto2004 Jul 15, 2023 at 08:13:48 (UTC)
Goto Top
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-N GROUP-serv1-IN
-N GROUP-serv1-OUT
-N PVEFW-Drop
-N PVEFW-DropBroadcast
-N PVEFW-FORWARD
-N PVEFW-FWBR-IN
-N PVEFW-FWBR-OUT
-N PVEFW-INPUT
-N PVEFW-OUTPUT
-N PVEFW-Reject
-N PVEFW-SET-ACCEPT-MARK
-N PVEFW-logflags
-N PVEFW-reject
-N PVEFW-smurflog
-N PVEFW-smurfs
-N PVEFW-tcpflags
-N tap247i0-IN
-N tap247i0-OUT
-N tap501i0-IN
-N tap501i0-OUT
-N veth100i0-IN
-N veth100i0-OUT
-N veth100i1-IN
-N veth100i1-OUT
-A INPUT -j PVEFW-INPUT
-A FORWARD -j PVEFW-FORWARD
-A OUTPUT -j PVEFW-OUTPUT
-A GROUP-serv1-IN -j MARK --set-xmark 0x0/0x80000000
-A GROUP-serv1-IN -p tcp -m set --match-set PVEFW-0-admin-range-v4 src -m tcp --dport 22 -g PVEFW-SET-ACCEPT-MARK
-A GROUP-serv1-IN -p icmp -m icmp --icmp-type 8 -g PVEFW-SET-ACCEPT-MARK
-A GROUP-serv1-IN -p tcp -m tcp --dport 25 -g PVEFW-SET-ACCEPT-MARK
-A GROUP-serv1-IN -p tcp -m tcp --dport 465 -g PVEFW-SET-ACCEPT-MARK
-A GROUP-serv1-IN -p tcp -m tcp --dport 587 -g PVEFW-SET-ACCEPT-MARK
-A GROUP-serv1-IN -p tcp -m tcp --dport 995 -g PVEFW-SET-ACCEPT-MARK
-A GROUP-serv1-IN -p tcp -m tcp --dport 110 -g PVEFW-SET-ACCEPT-MARK
-A GROUP-serv1-IN -p tcp -m tcp --dport 993 -g PVEFW-SET-ACCEPT-MARK
-A GROUP-serv1-IN -p tcp -m tcp --dport 143 -g PVEFW-SET-ACCEPT-MARK
-A GROUP-serv1-IN -p tcp -m set --match-set PVEFW-0-admin-range-v4 src -m tcp --dport 3389 -g PVEFW-SET-ACCEPT-MARK
-A GROUP-serv1-IN -p udp -m udp --dport 53 -g PVEFW-SET-ACCEPT-MARK
-A GROUP-serv1-IN -p tcp -m tcp --dport 53 -g PVEFW-SET-ACCEPT-MARK
-A GROUP-serv1-IN -p tcp -m tcp --dport 443 -g PVEFW-SET-ACCEPT-MARK
-A GROUP-serv1-IN -p tcp -m tcp --dport 80 -g PVEFW-SET-ACCEPT-MARK
-A GROUP-serv1-IN -m comment --comment "PVESIG:cQBjf5dnVam7kBZIum05C0LpJfc"  
-A GROUP-serv1-OUT -j MARK --set-xmark 0x0/0x80000000
-A GROUP-serv1-OUT -m comment --comment "PVESIG:/hHNlJ8SbY/hItC+YRM84Vyn8Ao"  
-A PVEFW-Drop -j PVEFW-DropBroadcast
-A PVEFW-Drop -p icmp -m icmp --icmp-type 3/4 -j ACCEPT
-A PVEFW-Drop -p icmp -m icmp --icmp-type 11 -j ACCEPT
-A PVEFW-Drop -m conntrack --ctstate INVALID -j DROP
-A PVEFW-Drop -p udp -m multiport --dports 135,445 -j DROP
-A PVEFW-Drop -p udp -m udp --dport 137:139 -j DROP
-A PVEFW-Drop -p udp -m udp --sport 137 --dport 1024:65535 -j DROP
-A PVEFW-Drop -p tcp -m multiport --dports 135,139,445 -j DROP
-A PVEFW-Drop -p udp -m udp --dport 1900 -j DROP
-A PVEFW-Drop -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -j DROP
-A PVEFW-Drop -p udp -m udp --sport 53 -j DROP
-A PVEFW-Drop -m comment --comment "PVESIG:83WlR/a4wLbmURFqMQT3uJSgIG8"  
-A PVEFW-DropBroadcast -m addrtype --dst-type BROADCAST -j DROP
-A PVEFW-DropBroadcast -m addrtype --dst-type MULTICAST -j DROP
-A PVEFW-DropBroadcast -m addrtype --dst-type ANYCAST -j DROP
-A PVEFW-DropBroadcast -d 224.0.0.0/4 -j DROP
-A PVEFW-DropBroadcast -m comment --comment "PVESIG:NyjHNAtFbkH7WGLamPpdVnxHy4w"  
-A PVEFW-FORWARD -m conntrack --ctstate INVALID -j DROP
-A PVEFW-FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A PVEFW-FORWARD -m physdev --physdev-in fwln+ --physdev-is-bridged -j PVEFW-FWBR-IN
-A PVEFW-FORWARD -m physdev --physdev-out fwln+ --physdev-is-bridged -j PVEFW-FWBR-OUT
-A PVEFW-FORWARD -m comment --comment "PVESIG:qnNexOcGa+y+jebd4dAUqFSp5nw"  
-A PVEFW-FWBR-IN -m physdev --physdev-out tap247i0 --physdev-is-bridged -j tap247i0-IN
-A PVEFW-FWBR-IN -m physdev --physdev-out tap501i0 --physdev-is-bridged -j tap501i0-IN
-A PVEFW-FWBR-IN -m physdev --physdev-out veth100i0 --physdev-is-bridged -j veth100i0-IN
-A PVEFW-FWBR-IN -m physdev --physdev-out veth100i1 --physdev-is-bridged -j veth100i1-IN
-A PVEFW-FWBR-IN -m comment --comment "PVESIG:yz8j8WWbojrWc7SWPb5sOuZyQZc"  
-A PVEFW-FWBR-OUT -m physdev --physdev-in tap247i0 --physdev-is-bridged -j tap247i0-OUT
-A PVEFW-FWBR-OUT -m physdev --physdev-in tap501i0 --physdev-is-bridged -j tap501i0-OUT
-A PVEFW-FWBR-OUT -m physdev --physdev-in veth100i0 --physdev-is-bridged -j veth100i0-OUT
-A PVEFW-FWBR-OUT -m physdev --physdev-in veth100i1 --physdev-is-bridged -j veth100i1-OUT
-A PVEFW-FWBR-OUT -m comment --comment "PVESIG:2tNIoIVTJRX1q2Q45SoWn1tKHa4"  
-A PVEFW-INPUT -m comment --comment "PVESIG:2jmj7l5rSw0yVb/vlWAYkK/YBwk"  
-A PVEFW-OUTPUT -m comment --comment "PVESIG:2jmj7l5rSw0yVb/vlWAYkK/YBwk"  
-A PVEFW-Reject -j PVEFW-DropBroadcast
-A PVEFW-Reject -p icmp -m icmp --icmp-type 3/4 -j ACCEPT
-A PVEFW-Reject -p icmp -m icmp --icmp-type 11 -j ACCEPT
-A PVEFW-Reject -m conntrack --ctstate INVALID -j DROP
-A PVEFW-Reject -p udp -m multiport --dports 135,445 -j PVEFW-reject
-A PVEFW-Reject -p udp -m udp --dport 137:139 -j PVEFW-reject
-A PVEFW-Reject -p udp -m udp --sport 137 --dport 1024:65535 -j PVEFW-reject
-A PVEFW-Reject -p tcp -m multiport --dports 135,139,445 -j PVEFW-reject
-A PVEFW-Reject -p udp -m udp --dport 1900 -j DROP
-A PVEFW-Reject -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -j DROP
-A PVEFW-Reject -p udp -m udp --sport 53 -j DROP
-A PVEFW-Reject -m comment --comment "PVESIG:h3DyALVslgH5hutETfixGP08w7c"  
-A PVEFW-SET-ACCEPT-MARK -j MARK --set-xmark 0x80000000/0x80000000
-A PVEFW-SET-ACCEPT-MARK -m comment --comment "PVESIG:Hg/OIgIwJChBUcWU8Xnjhdd2jUY"  
-A PVEFW-logflags -j DROP
-A PVEFW-logflags -m comment --comment "PVESIG:MN4PH1oPZeABMuWr64RrygPfW7A"  
-A PVEFW-reject -m addrtype --dst-type BROADCAST -j DROP
-A PVEFW-reject -s 224.0.0.0/4 -j DROP
-A PVEFW-reject -p icmp -j DROP
-A PVEFW-reject -p tcp -j REJECT --reject-with tcp-reset
-A PVEFW-reject -p udp -j REJECT --reject-with icmp-port-unreachable
-A PVEFW-reject -p icmp -j REJECT --reject-with icmp-host-unreachable
-A PVEFW-reject -j REJECT --reject-with icmp-host-prohibited
-A PVEFW-reject -m comment --comment "PVESIG:Jlkrtle1mDdtxDeI9QaDSL++Npc"  
-A PVEFW-smurflog -j DROP
-A PVEFW-smurflog -m comment --comment "PVESIG:2gfT1VMkfr0JL6OccRXTGXo+1qk"  
-A PVEFW-smurfs -s 0.0.0.0/32 -j RETURN
-A PVEFW-smurfs -m addrtype --src-type BROADCAST -g PVEFW-smurflog
-A PVEFW-smurfs -s 224.0.0.0/4 -g PVEFW-smurflog
-A PVEFW-smurfs -m comment --comment "PVESIG:HssVe5QCBXd5mc9kC88749+7fag"  
-A PVEFW-tcpflags -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,PSH,URG -g PVEFW-logflags
-A PVEFW-tcpflags -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -g PVEFW-logflags
-A PVEFW-tcpflags -p tcp -m tcp --tcp-flags SYN,RST SYN,RST -g PVEFW-logflags
-A PVEFW-tcpflags -p tcp -m tcp --tcp-flags FIN,SYN FIN,SYN -g PVEFW-logflags
-A PVEFW-tcpflags -p tcp -m tcp --sport 0 --tcp-flags FIN,SYN,RST,ACK SYN -g PVEFW-logflags
-A PVEFW-tcpflags -m comment --comment "PVESIG:CMFojwNPqllyqD67NeI5m+bP5mo"  
-A tap247i0-IN -p udp -m udp --sport 67 --dport 68 -j ACCEPT
-A tap247i0-IN -p tcp -m set --match-set PVEFW-0-admin-range-v4 src -m tcp --dport 3389 -j ACCEPT
-A tap247i0-IN -p tcp -m tcp --dport 3389 -j DROP
-A tap247i0-IN -j GROUP-serv1-IN
-A tap247i0-IN -m mark --mark 0x80000000/0x80000000 -j ACCEPT
-A tap247i0-IN -j PVEFW-Drop
-A tap247i0-IN -j DROP
-A tap247i0-IN -m comment --comment "PVESIG:bon2F1ZcqqKYu5+zqKlbTiP5DAM"  
-A tap247i0-OUT -p udp -m udp --sport 68 --dport 67 -g PVEFW-SET-ACCEPT-MARK
-A tap247i0-OUT -m mac ! --mac-source e2:4f:16:a5:f3:7f -j DROP
-A tap247i0-OUT -j MARK --set-xmark 0x0/0x80000000
-A tap247i0-OUT -j GROUP-serv1-OUT
-A tap247i0-OUT -m mark --mark 0x80000000/0x80000000 -j RETURN
-A tap247i0-OUT -g PVEFW-SET-ACCEPT-MARK
-A tap247i0-OUT -m comment --comment "PVESIG:qpE8hOykCgYH5xpyezx3+v1+H4o"  
-A tap501i0-IN -p udp -m udp --sport 67 --dport 68 -j ACCEPT
-A tap501i0-IN -p tcp -m tcp --dport 8081 -j ACCEPT
-A tap501i0-IN -p tcp -m tcp --dport 21 -j ACCEPT
-A tap501i0-IN -p tcp -m tcp --dport 25 -j ACCEPT
-A tap501i0-IN -p tcp -m tcp --dport 465 -j ACCEPT
-A tap501i0-IN -p tcp -m tcp --dport 587 -j ACCEPT
-A tap501i0-IN -p tcp -m tcp --dport 995 -j ACCEPT
-A tap501i0-IN -p tcp -m tcp --dport 993 -j ACCEPT
-A tap501i0-IN -p tcp -m set --match-set PVEFW-0-admin-range-v4 src -m tcp --dport 8080 -j ACCEPT
-A tap501i0-IN -p tcp -m set --match-set PVEFW-0-admin-range-v4 src -m tcp --dport 22 -j ACCEPT
-A tap501i0-IN -j GROUP-serv1-IN
-A tap501i0-IN -m mark --mark 0x80000000/0x80000000 -j ACCEPT
-A tap501i0-IN -j ACCEPT
-A tap501i0-IN -m comment --comment "PVESIG:xrDsk7Iz8YFxSWm+ZPe2ul2hRFo"  
-A tap501i0-OUT -p udp -m udp --sport 68 --dport 67 -g PVEFW-SET-ACCEPT-MARK
-A tap501i0-OUT -m mac ! --mac-source 82:d5:90:87:5b:7b -j DROP
-A tap501i0-OUT -j MARK --set-xmark 0x0/0x80000000
-A tap501i0-OUT -j GROUP-serv1-OUT
-A tap501i0-OUT -m mark --mark 0x80000000/0x80000000 -j RETURN
-A tap501i0-OUT -g PVEFW-SET-ACCEPT-MARK
-A tap501i0-OUT -m comment --comment "PVESIG:FcVcYRKkTIRW6BdLCyVqYo523p0"  
-A veth100i0-IN -p udp -m udp --sport 67 --dport 68 -j ACCEPT
-A veth100i0-IN -p udp -m udp --dport 5201 -j ACCEPT
-A veth100i0-IN -p tcp -m tcp --dport 5201 -j ACCEPT
-A veth100i0-IN -p tcp -m set --match-set PVEFW-5BCF1CDC src -m tcp --dport 81 -m limit --limit 1/sec -j NFLOG --nflog-prefix  ":100:1:veth100i0-IN: ACCEPT: "  
-A veth100i0-IN -p tcp -m set --match-set PVEFW-5BCF1CDC src -m tcp --dport 81 -j ACCEPT
-A veth100i0-IN -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A veth100i0-IN -p tcp -m tcp --dport 443 -m limit --limit 1/sec -j NFLOG --nflog-prefix  ":100:1:veth100i0-IN: ACCEPT: "  
-A veth100i0-IN -p tcp -m tcp --dport 443 -j ACCEPT
-A veth100i0-IN -p tcp -m tcp --dport 80 -m limit --limit 1/sec -j NFLOG --nflog-prefix  ":100:1:veth100i0-IN: ACCEPT: "  
-A veth100i0-IN -p tcp -m tcp --dport 80 -j ACCEPT
-A veth100i0-IN -s 87.168.77.250/32 -p tcp -m tcp --dport 9443 -m limit --limit 1/sec -j NFLOG --nflog-prefix  ":100:1:veth100i0-IN: ACCEPT: "  
-A veth100i0-IN -s 87.168.77.250/32 -p tcp -m tcp --dport 9443 -j ACCEPT
-A veth100i0-IN -s 87.168.77.250/32 -p tcp -m tcp --dport 8000 -m limit --limit 1/sec -j NFLOG --nflog-prefix  ":100:1:veth100i0-IN: ACCEPT: "  
-A veth100i0-IN -s 87.168.77.250/32 -p tcp -m tcp --dport 8000 -j ACCEPT
-A veth100i0-IN -s 87.168.77.250/32 -p tcp -m tcp --dport 22 -m limit --limit 1/sec -j NFLOG --nflog-prefix  ":100:1:veth100i0-IN: ACCEPT: "  
-A veth100i0-IN -s 87.168.77.250/32 -p tcp -m tcp --dport 22 -j ACCEPT
-A veth100i0-IN -j PVEFW-Drop
-A veth100i0-IN -j DROP
-A veth100i0-IN -m comment --comment "PVESIG:tQR09HOQFwNhHIrmv70aAEfNrUE"  
-A veth100i0-OUT -p udp -m udp --sport 68 --dport 67 -g PVEFW-SET-ACCEPT-MARK
-A veth100i0-OUT -m mac ! --mac-source de:7f:2e:2d:9f:e6 -j DROP
-A veth100i0-OUT -j MARK --set-xmark 0x0/0x80000000
-A veth100i0-OUT -g PVEFW-SET-ACCEPT-MARK
-A veth100i0-OUT -m comment --comment "PVESIG:LtXyLnSLVkleOBR5Yz6etmdozJE"  
-A veth100i1-IN -p udp -m udp --sport 67 --dport 68 -j ACCEPT
-A veth100i1-IN -p udp -m udp --dport 5201 -j ACCEPT
-A veth100i1-IN -p tcp -m tcp --dport 5201 -j ACCEPT
-A veth100i1-IN -p tcp -m set --match-set PVEFW-5BCF1CDC src -m tcp --dport 81 -m limit --limit 1/sec -j NFLOG --nflog-prefix  ":100:1:veth100i1-IN: ACCEPT: "  
-A veth100i1-IN -p tcp -m set --match-set PVEFW-5BCF1CDC src -m tcp --dport 81 -j ACCEPT
-A veth100i1-IN -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A veth100i1-IN -p tcp -m tcp --dport 443 -m limit --limit 1/sec -j NFLOG --nflog-prefix  ":100:1:veth100i1-IN: ACCEPT: "  
-A veth100i1-IN -p tcp -m tcp --dport 443 -j ACCEPT
-A veth100i1-IN -p tcp -m tcp --dport 80 -m limit --limit 1/sec -j NFLOG --nflog-prefix  ":100:1:veth100i1-IN: ACCEPT: "  
-A veth100i1-IN -p tcp -m tcp --dport 80 -j ACCEPT
-A veth100i1-IN -s 87.168.77.250/32 -p tcp -m tcp --dport 9443 -m limit --limit 1/sec -j NFLOG --nflog-prefix  ":100:1:veth100i1-IN: ACCEPT: "  
-A veth100i1-IN -s 87.168.77.250/32 -p tcp -m tcp --dport 9443 -j ACCEPT
-A veth100i1-IN -s 87.168.77.250/32 -p tcp -m tcp --dport 8000 -m limit --limit 1/sec -j NFLOG --nflog-prefix  ":100:1:veth100i1-IN: ACCEPT: "  
-A veth100i1-IN -s 87.168.77.250/32 -p tcp -m tcp --dport 8000 -j ACCEPT
-A veth100i1-IN -s 87.168.77.250/32 -p tcp -m tcp --dport 22 -m limit --limit 1/sec -j NFLOG --nflog-prefix  ":100:1:veth100i1-IN: ACCEPT: "  
-A veth100i1-IN -s 87.168.77.250/32 -p tcp -m tcp --dport 22 -j ACCEPT
-A veth100i1-IN -j PVEFW-Drop
-A veth100i1-IN -j DROP
-A veth100i1-IN -m comment --comment "PVESIG:5X457Vej647mT1rz+fVfA7tDRXQ"  
-A veth100i1-OUT -p udp -m udp --sport 68 --dport 67 -g PVEFW-SET-ACCEPT-MARK
-A veth100i1-OUT -m mac ! --mac-source fa:5c:da:8d:b7:af -j DROP
-A veth100i1-OUT -j MARK --set-xmark 0x0/0x80000000
-A veth100i1-OUT -g PVEFW-SET-ACCEPT-MARK
-A veth100i1-OUT -m comment --comment "PVESIG:gyYGdJ6/MNQ7c5ltMib6dUmnS8c"  
Mitglied: 7426148943
7426148943 Jul 15, 2023 updated at 08:23:54 (UTC)
Goto Top
Ah sorry noch vergessen ...
iptables -S -t nat
Member: foto2004
foto2004 Jul 15, 2023 at 08:24:24 (UTC)
Goto Top
-P PREROUTING ACCEPT
-P INPUT ACCEPT
-P OUTPUT ACCEPT
-P POSTROUTING ACCEPT
-A POSTROUTING -s 10.0.0.0/24 -o eno1 -j MASQUERADE
Mitglied: 7426148943
7426148943 Jul 15, 2023 at 08:41:34 (UTC)
Goto Top
Da wird vermutlich der Interface-Name wohl nicht stimmen mach mal ein ifconfig
Member: foto2004
foto2004 Jul 15, 2023 at 08:49:59 (UTC)
Goto Top
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 142.x.x.114  netmask 255.255.255.192  broadcast 0.0.0.0
        inet6 fe80::bxxxxf:fecd:6f  prefixlen 64  scopeid 0x20<link>
        inet6 2a01:4f8:xxx3b95::2  prefixlen 64  scopeid 0x0<global>
        ether b4:2e:x:x:00:6f  txqueuelen 1000  (Ethernet)
        RX packets 156865  bytes 52531246 (50.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 137518  bytes 40561432 (38.6 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0x51200000-51220000  

fwbr100i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 6a:26:10:29:0d:9d  txqueuelen 1000  (Ethernet)
        RX packets 1640  bytes 72945 (71.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwbr100i1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 76:79:63:74:e6:e2  txqueuelen 1000  (Ethernet)
        RX packets 54  bytes 3586 (3.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwbr101i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 72:39:2e:95:47:02  txqueuelen 1000  (Ethernet)
        RX packets 43  bytes 2712 (2.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwbr201i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 1a:fd:27:c8:e0:1c  txqueuelen 1000  (Ethernet)
        RX packets 1328  bytes 55026 (53.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwbr202i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 5a:fc:4b:d3:6a:65  txqueuelen 1000  (Ethernet)
        RX packets 1313  bytes 54282 (53.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwbr247i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 6a:cf:94:78:10:73  txqueuelen 1000  (Ethernet)
        RX packets 1597  bytes 70769 (69.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwbr302i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 1e:2b:aa:82:5a:3c  txqueuelen 1000  (Ethernet)
        RX packets 1583  bytes 70349 (68.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwbr303i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether f6:5a:fb:1e:77:93  txqueuelen 1000  (Ethernet)
        RX packets 1571  bytes 70013 (68.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwbr304i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 12:5f:d8:14:9f:d6  txqueuelen 1000  (Ethernet)
        RX packets 1254  bytes 52630 (51.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwbr501i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 46:2e:1b:88:25:4e  txqueuelen 1000  (Ethernet)
        RX packets 1488  bytes 56655 (55.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwln100i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether b2:1e:cd:e7:a6:15  txqueuelen 1000  (Ethernet)
        RX packets 3781  bytes 1941122 (1.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 913  bytes 278336 (271.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwln100i1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether da:d1:38:c8:cc:5c  txqueuelen 1000  (Ethernet)
        RX packets 30  bytes 2570 (2.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 25  bytes 1922 (1.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwln101i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 6e:8d:3f:ed:af:a7  txqueuelen 1000  (Ethernet)
        RX packets 47  bytes 2828 (2.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1082  bytes 104058 (101.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwln201i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 3e:75:99:1d:9a:8f  txqueuelen 1000  (Ethernet)
        RX packets 72734  bytes 11565074 (11.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 84065  bytes 22574354 (21.5 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwln202i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether d6:ad:d5:4a:95:c2  txqueuelen 1000  (Ethernet)
        RX packets 16433  bytes 8102588 (7.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 11706  bytes 2480837 (2.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwln247i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether f2:5c:64:d7:4a:3a  txqueuelen 1000  (Ethernet)
        RX packets 3168  bytes 209309 (204.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 514  bytes 51186 (49.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwln302i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 96:ea:59:65:38:aa  txqueuelen 1000  (Ethernet)
        RX packets 6739  bytes 5881426 (5.6 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3444  bytes 636237 (621.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwln303i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 4a:1d:29:de:0f:cc  txqueuelen 1000  (Ethernet)
        RX packets 17336  bytes 8323577 (7.9 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12688  bytes 2909077 (2.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwln304i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 0a:83:63:47:47:9a  txqueuelen 1000  (Ethernet)
        RX packets 3390  bytes 5296672 (5.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1195  bytes 185257 (180.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwln501i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 66:ab:af:d8:dd:af  txqueuelen 1000  (Ethernet)
        RX packets 5977  bytes 889109 (868.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4925  bytes 629548 (614.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwpr100p0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 26:4b:6a:7e:af:38  txqueuelen 1000  (Ethernet)
        RX packets 913  bytes 278336 (271.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3781  bytes 1941122 (1.8 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwpr100p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether c6:b3:06:83:d9:6b  txqueuelen 1000  (Ethernet)
        RX packets 25  bytes 1922 (1.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 30  bytes 2570 (2.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwpr101p0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether c6:6f:d6:c9:42:83  txqueuelen 1000  (Ethernet)
        RX packets 1082  bytes 104058 (101.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 47  bytes 2828 (2.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwpr201p0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 62:b8:7f:62:34:fc  txqueuelen 1000  (Ethernet)
        RX packets 84065  bytes 22574354 (21.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 72734  bytes 11565074 (11.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwpr202p0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 9a:18:1a:0a:cd:a2  txqueuelen 1000  (Ethernet)
        RX packets 11706  bytes 2480837 (2.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 16433  bytes 8102588 (7.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwpr247p0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether be:8f:6c:4c:f4:0d  txqueuelen 1000  (Ethernet)
        RX packets 514  bytes 51186 (49.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3168  bytes 209309 (204.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwpr302p0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 2e:33:b8:04:16:8e  txqueuelen 1000  (Ethernet)
        RX packets 3444  bytes 636237 (621.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6739  bytes 5881426 (5.6 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwpr303p0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether da:3b:7d:cb:4d:a7  txqueuelen 1000  (Ethernet)
        RX packets 12688  bytes 2909077 (2.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 17336  bytes 8323577 (7.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwpr304p0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 96:f0:c9:08:15:c8  txqueuelen 1000  (Ethernet)
        RX packets 1195  bytes 185257 (180.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3390  bytes 5296672 (5.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

fwpr501p0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether ce:ae:23:b0:99:ad  txqueuelen 1000  (Ethernet)
        RX packets 4925  bytes 629548 (614.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 5977  bytes 889109 (868.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 7721  bytes 3775138 (3.6 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 7721  bytes 3775138 (3.6 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tap201i0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST>  mtu 1500
        ether 0e:dc:77:d9:b5:8b  txqueuelen 1000  (Ethernet)
        RX packets 84067  bytes 22574462 (21.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 72761  bytes 11566436 (11.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tap202i0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST>  mtu 1500
        ether da:76:6f:d3:a4:0e  txqueuelen 1000  (Ethernet)
        RX packets 11712  bytes 2481173 (2.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 18876  bytes 8234510 (7.8 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tap247i0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST>  mtu 1500
        ether aa:56:db:23:e1:1e  txqueuelen 1000  (Ethernet)
        RX packets 514  bytes 51186 (49.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2056  bytes 115904 (113.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tap302i0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST>  mtu 1500
        ether 6e:35:37:fb:b3:f3  txqueuelen 1000  (Ethernet)
        RX packets 3444  bytes 636237 (621.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 9555  bytes 6033490 (5.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tap303i0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST>  mtu 1500
        ether 56:00:13:0b:20:c8  txqueuelen 1000  (Ethernet)
        RX packets 12688  bytes 2909077 (2.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 20049  bytes 8470079 (8.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tap304i0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST>  mtu 1500
        ether 02:66:7b:e5:cf:8b  txqueuelen 1000  (Ethernet)
        RX packets 1195  bytes 185257 (180.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 5666  bytes 5419576 (5.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tap501i0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST>  mtu 1500
        ether 82:a2:f4:b2:85:96  txqueuelen 1000  (Ethernet)
        RX packets 4925  bytes 638162 (623.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6017  bytes 891749 (870.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth100i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether fe:94:4d:ea:4c:f0  txqueuelen 1000  (Ethernet)
        RX packets 913  bytes 278336 (271.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2501  bytes 1836970 (1.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth100i1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether fe:14:0b:44:89:85  txqueuelen 1000  (Ethernet)
        RX packets 25  bytes 1922 (1.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12  bytes 828 (828.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth101i0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether fe:fc:86:73:b9:ff  txqueuelen 1000  (Ethernet)
        RX packets 1082  bytes 104058 (101.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 47  bytes 2828 (2.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vmbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.0.10  netmask 255.255.255.0  broadcast 0.0.0.0
        inet6 fe80::407b:72ff:fe97:78c9  prefixlen 64  scopeid 0x20<link>
        ether 42:7b:x:x:78:c9  txqueuelen 1000  (Ethernet)
        RX packets 1107  bytes 90482 (88.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 34  bytes 2084 (2.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vmbr1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 5.x.x.222  netmask 255.255.255.248  broadcast 0.0.0.0
        inet6 fe80::6xxxxfe39:afb0  prefixlen 64  scopeid 0x20<link>
        ether 66:e0:x:x:af:b0  txqueuelen 1000  (Ethernet)
        RX packets 96884  bytes 23876364 (22.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 89922  bytes 24814532 (23.6 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vmbr2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 136.x.x.222  netmask 255.255.255.248  broadcast 0.0.0.0
        inet6 fe80::xxx:fe25:9a68  prefixlen 64  scopeid 0x20<link>
        ether 92:x:x:25:9a:68  txqueuelen 1000  (Ethernet)
        RX packets 22144  bytes 3935837 (3.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 30422  bytes 16630880 (15.8 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Mitglied: 7426148943
7426148943 Jul 15, 2023 updated at 09:14:34 (UTC)
Goto Top
Führe mal testweise live folgendes aus und probiere es dann nochmal
iptables -I FORWARD 1 -s 10.0.0.0/24 -j ACCEPT
Member: foto2004
foto2004 Jul 15, 2023 at 10:18:35 (UTC)
Goto Top
reicht es wen ich
pve-firewall restart
ausführe ? oder muss ich wirklich den Server jedesmal neu starten?

weil so ist es immer noch ohne Erfolg
Mitglied: 7426148943
7426148943 Jul 15, 2023 updated at 13:14:01 (UTC)
Goto Top
Zitat von @foto2004:

reicht es wen ich
pve-firewall restart
ausführe ? oder muss ich wirklich den Server jedesmal neu starten?

Du darfst nicht neu starten die Regel wirkt sofort, startest du neu oder startest du den Firewall-Dienst neu ist die temporär in der Running-Config angelegte Regel wieder weg und kann nicht ihren Dienst verrichten!!
weil so ist es immer noch ohne Erfolg
Läuft auf dem Container eine Firewall?
Denn mit der o.g. Regel ist der Weg vollkommen frei für den Container und es muss am Container selbst liegen.

Im Zweifel einfach mal die Interfaces mit TCP-Dump/Wireshark capturen und prüfen wie und bis wohin der Traffic kommt.

Schau auch mal ob für den Container/VM eine Separate Firewall Config hinterlegt ist

/etc/pve/firewall/<VMID>.fw

Darin stehen Regeln die nur für die/den VM/Container gelten.
Lesenswert dazu
https://pve.proxmox.com/wiki/Firewall#pve_firewall_default_rules
Member: foto2004
foto2004 Jul 15, 2023 at 13:55:28 (UTC)
Goto Top
nein für den LXC ist keine Firewall am laufen und auch kein File in dem Ordner

Das kommt bei einem tcpdump -i vmbr0 raus wenn ich einen ping auf die 1.1.1.1 (geht nicht), oder web.de(geht nicht) oder auf die 142.x.x.114 (geht) mache.

# tcpdump -i vmbr0
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on vmbr0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
15:39:16.358329 IP 10.0.0.20 > one.one.one.one: ICMP echo request, id 30349, seq 1, length 64
15:39:17.372952 IP 10.0.0.20 > one.one.one.one: ICMP echo request, id 30349, seq 2, length 64
15:39:18.392951 IP 10.0.0.20 > one.one.one.one: ICMP echo request, id 30349, seq 3, length 64
15:39:21.369130 ARP, Request who-has 10.0.0.10 tell 10.0.0.20, length 28
15:39:21.369135 ARP, Reply 10.0.0.10 is-at 42:7b:72:97:78:c9 (oui Unknown), length 28
15:40:01.944068 IP 10.0.0.20.53507 > ns1.recursivedns.hetzner.com.domain: 45547+ A? web.de. (24)
15:40:01.944077 IP 10.0.0.20.53507 > ns1.recursivedns.hetzner.com.domain: 9198+ AAAA? web.de. (24)
15:40:06.948997 IP 10.0.0.20.33065 > ns2.recursivedns.hetzner.com.domain: 45547+ A? web.de. (24)
15:40:06.949004 IP 10.0.0.20.33065 > ns2.recursivedns.hetzner.com.domain: 9198+ AAAA? web.de. (24)
15:40:07.193127 ARP, Request who-has 10.0.0.10 tell 10.0.0.20, length 28
15:40:07.193134 ARP, Reply 10.0.0.10 is-at 42:7b:72:97:78:c9 (oui Unknown), length 28
15:51:22.375584 IP 10.0.0.20 > Debian-bullseye-latest-amd64-base: ICMP echo request, id 18004, seq 1, length 64
15:51:22.375591 IP Debian-bullseye-latest-amd64-base > 10.0.0.20: ICMP echo reply, id 18004, seq 1, length 64
15:51:23.385065 IP 10.0.0.20 > Debian-bullseye-latest-amd64-base: ICMP echo request, id 18004, seq 2, length 64
15:51:23.385080 IP Debian-bullseye-latest-amd64-base > 10.0.0.20: ICMP echo reply, id 18004, seq 2, length 64
15:51:24.413033 IP 10.0.0.20 > Debian-bullseye-latest-amd64-base: ICMP echo request, id 18004, seq 3, length 64
15:51:24.413047 IP Debian-bullseye-latest-amd64-base > 10.0.0.20: ICMP echo reply, id 18004, seq 3, length 64
15:51:25.436966 IP 10.0.0.20 > Debian-bullseye-latest-amd64-base: ICMP echo request, id 18004, seq 4, length 64
15:51:25.436981 IP Debian-bullseye-latest-amd64-base > 10.0.0.20: ICMP echo reply, id 18004, seq 4, length 64
15:51:27.384916 ARP, Request who-has 10.0.0.20 tell 10.0.0.10, length 28
15:51:27.384943 ARP, Request who-has 10.0.0.10 tell 10.0.0.20, length 28
15:51:27.384944 ARP, Reply 10.0.0.10 is-at 42:7b:72:97:78:c9 (oui Unknown), length 28
15:51:27.384946 ARP, Reply 10.0.0.20 is-at d2:27:5b:3a:cd:b4 (oui Unknown), length 28
Mitglied: 7426148943
7426148943 Jul 15, 2023 updated at 14:10:23 (UTC)
Goto Top
Sniffer mal am eno1 um zu sehen ob die ICMP-Pakete den Host verlassen und wenn ja mit welcher Absender-IP um zu sehen ob das Masquerading greift oder eben nicht.
Dazu bitte den Parameter -n von TCP-Dump benutzen so dass IPs nicht zu Namen aufgelöst werden.

tcpdump -ni eno1 icmp
Member: foto2004
foto2004 Jul 15, 2023 at 15:28:27 (UTC)
Goto Top
tcpdump -ni eno1 icmp
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on eno1, link-type EN10MB (Ethernet), snapshot length 262144 bytes
17:26:42.168938 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 56418, seq 27, length 64
17:26:43.193045 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 56418, seq 28, length 64
17:26:44.216961 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 56418, seq 29, length 64
17:26:45.244953 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 56418, seq 30, length 64
17:26:46.268965 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 56418, seq 31, length 64
17:26:47.288942 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 56418, seq 32, length 64
17:26:48.152966 IP 142.x.x.114 > 95.214.53.134: ICMP host 5.9.217.216 unreachable, length 48
17:26:48.312887 IP 142.x.x.114 > 45.128.232.252: ICMP host 136.243.203.216 unreachable, length 48
17:26:48.312893 IP 142.x.x.114 > 141.98.10.153: ICMP host 136.243.203.216 unreachable, length 48
17:26:48.312953 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 56418, seq 33, length 64
17:26:49.340970 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 56418, seq 34, length 64
17:26:50.360971 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 56418, seq 35, length 64
17:26:51.389048 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 56418, seq 36, length 64
17:26:52.409001 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 56418, seq 37, length 64
 17:26:53.436969 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 56418, seq 38, length 64
^C
15 packets captured
15 packets received by filter
0 packets dropped by kernel
Mitglied: 7426148943
7426148943 Jul 15, 2023 updated at 15:52:58 (UTC)
Goto Top
Da haben wir den Fehler. Die Pakete verlassen das IF mit der privaten IP, klar das da nichts zurück kommen kann . Die Masquerading-Regel hast du aber schon noch im Regelwerk?
Ansonsten nochmal explizit in die Running-Config eintragen (keine Restarts oder Dienstneustarts bitte!)
iptables -t nat -I POSTROUTING 1 -s 10.0.0.0/24 -o eno1 -j MASQUERADE
Das muss gehen ansonsten hat der Host oder iptables einen Weg oder die Firewall ist auf dem Host generell deaktiviert worden, dann fände nämlich auch kein SRCNAT mehr statt.

Nur zur Sicherheit : Die Firewall von Hetzner lässt überhaupt ausgehenden Traffic durch? Die arbeitet ja nicht statefull, soweit ich mich erinnern kann.
Member: foto2004
foto2004 Jul 15, 2023 at 16:04:35 (UTC)
Goto Top
die Firewall bei Hetzner ist so eingestellt dass sie alles durchlässt bis auf 3 Ports die sind nur von einer bestimmen ip aus erreichbar.

18:02:08.376921 IP 142.132.193.114 > 91.208.52.17: ICMP host 136.243.203.216 unreachable, length 68
18:02:08.376927 IP 142.132.193.114 > 91.208.52.17: ICMP host 136.243.203.216 unreachable, length 68
18:02:08.376932 IP 142.132.193.114 > 3.91.2.33: ICMP host 136.243.203.216 unreachable, length 60
18:02:08.376944 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 7081, seq 6, length 64
18:02:08.746937 IP 136.243.203.222 > 194.32.146.143: ICMP 136.243.203.222 udp port 123 unreachable, length 44
18:02:09.400950 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 7081, seq 7, length 64
18:02:10.425048 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 7081, seq 8, length 64
18:02:11.453041 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 7081, seq 9, length 64
18:02:11.800995 IP 142.132.193.114 > 194.32.146.143: ICMP host 136.243.203.216 unreachable, length 44
18:02:12.473077 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 7081, seq 10, length 64
18:02:13.500961 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 7081, seq 11, length 64
18:02:14.525048 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 7081, seq 12, length 64
18:02:15.549068 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 7081, seq 13, length 64
18:02:15.960915 IP 142.132.193.114 > 3.91.2.33: ICMP host 136.243.203.216 unreachable, length 60
18:02:15.960921 IP 142.132.193.114 > 91.240.118.71: ICMP host 136.243.203.216 unreachable, length 48
18:02:16.441022 IP 142.132.193.114 > 162.216.150.142: ICMP host 5.9.217.216 unreachable, length 52
18:02:16.569060 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 7081, seq 14, length 64
18:02:17.592951 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 7081, seq 15, length 64
Member: foto2004
foto2004 Jul 15, 2023 at 16:10:02 (UTC)
Goto Top
Das ist die Einstellung am Host
bildschirmfoto 2023-07-15 um 18.08.09
bildschirmfoto 2023-07-15 um 18.09.29
Member: foto2004
foto2004 Jul 15, 2023 at 16:11:38 (UTC)
Goto Top
Und das ist die beim Datacenter oben
bildschirmfoto 2023-07-15 um 18.10.53
Mitglied: 7426148943
7426148943 Jul 15, 2023 updated at 16:24:11 (UTC)
Goto Top
Schalte die FW auf beiden ein.
Member: foto2004
foto2004 Jul 16, 2023 at 06:49:48 (UTC)
Goto Top
Hatte und habe ich gemacht bring keine Änderung.


Wenn ich von dem anderen LXC der eine öffentliche IP hat, einen Ping auf die 1.1.1.1 mache so geht der einwandfrei durch und auch die Aufzeichnung mit tcpdump -ni eno1 icmp zeigt die Verbindung raus und rein. Nur eben von dem anderen LXC aus, der mit der Privaten Adresse, kommt nichts zurück.

08:46:29.370348 IP 136.x.x.221 > 1.1.1.1: ICMP echo request, id 948, seq 8, length 64
08:46:29.375799 IP 1.1.1.1 > 136.x.x.221: ICMP echo reply, id 948, seq 8, length 64
08:46:30.371936 IP 136.x.x.221 > 1.1.1.1: ICMP echo request, id 948, seq 9, length 64
08:46:30.377293 IP 1.1.1.1 > 136.x.x.221: ICMP echo reply, id 948, seq 9, length 64
08:46:31.372911 IP 136.x.x.221 > 1.1.1.1: ICMP echo request, id 948, seq 10, length 64
08:46:31.378327 IP 1.1.1.1 > 136.x.x.221: ICMP echo reply, id 948, seq 10, length 64
08:46:49.308933 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 53709, seq 1, length 64
08:46:50.329047 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 53709, seq 2, length 64
08:46:51.353041 IP 10.0.0.20 > 1.1.1.1: ICMP echo request, id 53709, seq 3, length 64

Ich werde jetzt mal eine VM im Privaten Bereich aufsetzen und mal schauen wie es sich da verhält.
Member: foto2004
foto2004 Jul 16, 2023 at 06:57:20 (UTC)
Goto Top
Auch das installieren einer weiteren linux VM scheitert schon an die Net-Installation
Mitglied: 7426148943
7426148943 Jul 16, 2023 updated at 08:05:48 (UTC)
Goto Top
Dann ist die IP an eno1 nicht öffentlich routbar und du musst die Quell-Adresse auf eine deiner zugewiesenen öffentlichen IPs umschreiben wie oben schon im zweiten Beipspiel gezeigt.
Member: foto2004
foto2004 Jul 18, 2023 at 17:23:05 (UTC)
Goto Top
ich habe auch eine andere VM in das 10er Netzgehängt und da hat es auch das selbe Ergebnis.
ich habe schön langsam die Vermutung dass da Hetzner irgend wie was nicht so weiterleitet wie es soll.
Mitglied: 7426148943
7426148943 Jul 18, 2023 updated at 20:00:26 (UTC)
Goto Top
Zitat von @foto2004:

ich habe auch eine andere VM in das 10er Netzgehängt und da hat es auch das selbe Ergebnis.
ich habe schön langsam die Vermutung dass da Hetzner irgend wie was nicht so weiterleitet wie es soll.
Siehe letzter Post, NATe mal auf eine deiner öffentlichen IPs die nicht belegt ist und achte darauf das die nicht an die anderen VMs geroutet wird.

Beachte auch das die Hetzner Firewall nicht statefull arbeitet man also immer beide Richtungen definieren muss!