Kein Zugriff auf den PI 4 von außen mit Portfreigabe in Fritzbox

L I V E Stammtisch ab 20:30 Uhr im Chat
  • Hallo,

    ich bin neu hier und vielleicht kann mir jemand weiterhelfen. Ich habe seit längerem einen PI4 mit Debian im Einsatz. Aktuell nutze ich den PI als VPN Gateway und TV_Headend Server.

    Leider ist es mir nicht möglich den Zugriff von außen zu ermöglichen. Ich hatte schon mit AVM Kontakt und mir wurde empfohlen das Gerät aus den Netzwerkverbindungen zu löschen.

    Hat leider alles nichts gebracht. Zum Testen habe ich ein neues Image aufgesetzt und nur die Ports auf die neue IP des 2. Images umgeleitet. Klappt wunderbar

    Es muss also an meinem PI4 oder den Einstellungen liegen.

    Was könnte ich noch ausprobieren? Würde es was bringen die IP Adresse bzw. MAC Adresse des PIs zu ändern? Welche Einstellungen sollte ich noch mal überprüfen?

    Vielen Dank

    Chris

  • Kein Zugriff auf den PI 4 von außen mit Portfreigabe in Fritzbox? Schau mal ob du hier fündig wirst!

  • Zum Testen habe ich ein neues Image aufgesetzt und nur die Ports auf die neue IP des 2. Images umgeleitet. Klappt wunderbar

    Es muss also an meinem PI4 oder den Einstellungen liegen.

    Dass bzw. ob es an den Einstellungen liegt, kannst Du auf deinem PI mit z. B. tcpdump und dem _alten_ Image testen.

    Starte auf deinem PI4 (mit dem alten Image):

    Code
    sudo tcpdump -c 20 -vvveni <Interface> dst port <Port>

    (Interface und Port anpassen und ohne spitze Klammern). Als Port nimmst Du den Port, den Du in der FritzBox weitergeleitet hast. Jetzt machst Du einen Zugriff aus dem Internet (nicht aus dem W/LAN) und postest danach die Ausgabe von tcpdump.

    EDIT:

    Zum testen kannst Du temporär auf deinem PI4 (in der Kommandozeile) mit dem alten image, mit nc auf einem Port lauschen lassen, von dem immer geantwortet wird. In der FB musst Du temporär den TCP-Port 3333 weiterleiten:

    Code
    while true; do { nc -4nv -l 3333; sleep 5; } done

    Anfragen nur im Abstand von mind. 5 Sekunden und beenden mit strg C.

    The most popular websites without IPv6 in Germany.  IPv6-Ausreden

    Meine PIs

    PI4B/8GB (border device) OpenBSD 7.4 (64bit): SSH-Server, WireGuard-Server, ircd-hybrid-Server, stunnel-Proxy, Mumble-Server

    PI3B+ FreeBSD 14.0-R-p3 (arm64): SSH-Serv., WireGuard-Serv., ircd-hybrid-Serv., stunnel-Proxy, Mumble-Serv., ddclient

    PI4B/4GB Bullseye-lite (64bit; modifiziert): SSH-Server, WireGuard-Server, ircd-hybrid-Server, stunnel-Proxy, Mumble-Server, botamusique, ample

    5 Mal editiert, zuletzt von rpi444 (14. Januar 2022 um 08:55)

  • Beitrag von chris3107 (14. Januar 2022 um 08:58)

    Dieser Beitrag wurde gelöscht, Informationen über den Löschvorgang sind nicht verfügbar.
  • Hallo vielen lieben Dank. Hier die Ausgabe nach dem Zugriff von außen. Kannst du damit was anfangen?

    pi@pi:/home/hts $ sudo tcpdump -c 20 -vvveni eth0 dst port 22
    tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
    09:00:39.226530 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x46eb (correct), seq 606214394, ack 896536934, win 2792, options [nop,nop,TS val 1627875626 ecr 1005336996], length 0
    09:00:39.229098 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x461b (correct), seq 0, ack 205, win 2791, options [nop,nop,TS val 1627875629 ecr 1005336998], length 0
    09:00:39.229105 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x4541 (correct), seq 0, ack 425, win 2788, options [nop,nop,TS val 1627875629 ecr 1005336999], length 0
    09:00:39.231615 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x446e (correct), seq 0, ack 629, win 2791, options [nop,nop,TS val 1627875631 ecr 1005337001], length 0
    09:00:39.232091 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x425a (correct), seq 0, ack 1169, win 2783, options [nop,nop,TS val 1627875631 ecr 1005337001], length 0
    09:00:39.233666 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x4182 (correct), seq 0, ack 1373, win 2791, options [nop,nop,TS val 1627875633 ecr 1005337003], length 0
    09:00:39.233713 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x40b9 (correct), seq 0, ack 1577, win 2788, options [nop,nop,TS val 1627875633 ecr 1005337003], length 0
    09:00:39.233816 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x3fe9 (correct), seq 0, ack 1781, win 2791, options [nop,nop,TS val 1627875633 ecr 1005337004], length 0
    09:00:39.234741 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x3f1c (correct), seq 0, ack 1985, win 2791, options [nop,nop,TS val 1627875634 ecr 1005337004], length 0
    09:00:39.236747 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x3d0a (correct), seq 0, ack 2517, win 2786, options [nop,nop,TS val 1627875636 ecr 1005337005], length 0
    09:00:39.237341 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x3c41 (correct), seq 0, ack 2721, win 2783, options [nop,nop,TS val 1627875636 ecr 1005337005], length 0
    09:00:39.237384 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x3b6c (correct), seq 0, ack 2925, win 2791, options [nop,nop,TS val 1627875636 ecr 1005337006], length 0
    09:00:39.237500 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x3aa3 (correct), seq 0, ack 3129, win 2788, options [nop,nop,TS val 1627875636 ecr 1005337006], length 0
    09:00:39.237504 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x39d4 (correct), seq 0, ack 3333, win 2791, options [nop,nop,TS val 1627875636 ecr 1005337006], length 0
    09:00:39.237506 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x3908 (correct), seq 0, ack 3537, win 2791, options [nop,nop,TS val 1627875636 ecr 1005337006], length 0
    09:00:39.237874 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x38e0 (correct), seq 0, ack 3573, win 2794, options [nop,nop,TS val 1627875636 ecr 1005337007], length 0
    09:00:39.240641 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x32ff (correct), seq 0, ack 5097, win 2770, options [nop,nop,TS val 1627875640 ecr 1005337008], length 0
    09:00:39.241691 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x3178 (correct), seq 0, ack 5469, win 2788, options [nop,nop,TS val 1627875640 ecr 1005337009], length 0
    09:00:39.241737 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x2e66 (correct), seq 0, ack 6249, win 2794, options [nop,nop,TS val 1627875640 ecr 1005337009], length 0
    09:00:39.243291 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x2cc8 (correct), seq 0, ack 6657, win 2794, options [nop,nop,TS val 1627875643 ecr 1005337012], length 0
    20 packets captured
    30 packets received by filter
    0 packets dropped by kernel

  • Kannst du damit was anfangen?

    pi@pi:/home/hts $ sudo tcpdump -c 20 -vvveni eth0 dst port 22
    tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
    09:00:39.226530 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0x46eb (correct), seq 606214394, ack 896536934, win 2792, options [nop,nop,TS val 1627875626 ecr 1005336996], length 0

    OK, das ist ssh. Zu welchem Zeitpunkt hast Du tcpdump gestartet? Denn man sieht nicht vom ssh-Client, den Zugriff mit dem syn-Flag.

    Fakt ist, dass die Portweiterleitung in der FritzBox funktioniert. Hast Du auf dem alten Image, etwas am sshd-Server bzw. an dessen Konfiguration geändert?

    Versuch mal mit:

    Code
    sudo tcpdump -c 20 -vvveni eth0 port 22

    , damit man auch die evtl. Antwort vom sshd-Server in der Ausgabe von tcpdump sehen kann. Benutzt Du ssh, mit Passwort oder mit pub-key?

    EDIT:

    BTW: Das war jetzt aber kein Zugriff aus dem Internet!? Du willst doch aus dem Internet zugreifen (wegen der Portweiterleitung) ...

    The most popular websites without IPv6 in Germany.  IPv6-Ausreden

    Meine PIs

    PI4B/8GB (border device) OpenBSD 7.4 (64bit): SSH-Server, WireGuard-Server, ircd-hybrid-Server, stunnel-Proxy, Mumble-Server

    PI3B+ FreeBSD 14.0-R-p3 (arm64): SSH-Serv., WireGuard-Serv., ircd-hybrid-Serv., stunnel-Proxy, Mumble-Serv., ddclient

    PI4B/4GB Bullseye-lite (64bit; modifiziert): SSH-Server, WireGuard-Server, ircd-hybrid-Server, stunnel-Proxy, Mumble-Server, botamusique, ample

    2 Mal editiert, zuletzt von rpi444 (14. Januar 2022 um 09:17)

  • Hallo,

    vielen Dank. An der ssh-Konfiguraiton habe ich nichts verändert und ich nutze zur Anmeldung ein PW.

    Ich habe den SSH-Zugriff von meinem Smartphone über Mobilfunk auf die Dyndns-Adresse gemacht. Dieser wird richtig aufgelöst. aber es geht nicht weiter.

    Hier die Ausgabe nach dem Zugriff:

    pi@pi:/home/hts $ sudo tcpdump -c 20 -vvveni eth0 port 22
    tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
    10:26:00.833473 dc:a6:32:44:08:96 > f8:ff:c2:6a:6d:60, ethertype IPv4 (0x0800), length 190: (tos 0x10, ttl 64, id 43627, offset 0, flags [DF], proto TCP (6), length 176)
    192.168.10.99.22 > 192.168.10.25.52050: Flags [P.], cksum 0x966f (incorrect -> 0xbad3), seq 896562854:896562978, ack 606214666, win 501, options [nop,nop,TS val 1010458605 ecr 163049510
    4], length 124
    10:26:00.833724 dc:a6:32:44:08:96 > f8:ff:c2:6a:6d:60, ethertype IPv4 (0x0800), length 278: (tos 0x10, ttl 64, id 43628, offset 0, flags [DF], proto TCP (6), length 264)
    192.168.10.99.22 > 192.168.10.25.52050: Flags [P.], cksum 0x96c7 (incorrect -> 0xebf8), seq 124:336, ack 1, win 501, options [nop,nop,TS val 1010458605 ecr 1630495104], length 212
    10:26:00.833840 dc:a6:32:44:08:96 > f8:ff:c2:6a:6d:60, ethertype IPv4 (0x0800), length 478: (tos 0x10, ttl 64, id 43629, offset 0, flags [DF], proto TCP (6), length 464)
    192.168.10.99.22 > 192.168.10.25.52050: Flags [P.], cksum 0x978f (incorrect -> 0x3f06), seq 336:748, ack 1, win 501, options [nop,nop,TS val 1010458605 ecr 1630495104], length 412
    10:26:00.833890 dc:a6:32:44:08:96 > f8:ff:c2:6a:6d:60, ethertype IPv4 (0x0800), length 286: (tos 0x10, ttl 64, id 43630, offset 0, flags [DF], proto TCP (6), length 272)
    192.168.10.99.22 > 192.168.10.25.52050: Flags [P.], cksum 0x96cf (incorrect -> 0x34ef), seq 748:968, ack 1, win 501, options [nop,nop,TS val 1010458605 ecr 1630495104], length 220
    10:26:00.833967 dc:a6:32:44:08:96 > f8:ff:c2:6a:6d:60, ethertype IPv4 (0x0800), length 278: (tos 0x10, ttl 64, id 43631, offset 0, flags [DF], proto TCP (6), length 264)
    192.168.10.99.22 > 192.168.10.25.52050: Flags [P.], cksum 0x96c7 (incorrect -> 0x2a50), seq 968:1180, ack 1, win 501, options [nop,nop,TS val 1010458605 ecr 1630495104], length 212
    10:26:00.834024 dc:a6:32:44:08:96 > f8:ff:c2:6a:6d:60, ethertype IPv4 (0x0800), length 462: (tos 0x10, ttl 64, id 43632, offset 0, flags [DF], proto TCP (6), length 448)
    192.168.10.99.22 > 192.168.10.25.52050: Flags [P.], cksum 0x977f (incorrect -> 0x09a5), seq 1180:1576, ack 1, win 501, options [nop,nop,TS val 1010458605 ecr 1630495104], length 396
    10:26:00.834076 dc:a6:32:44:08:96 > f8:ff:c2:6a:6d:60, ethertype IPv4 (0x0800), length 286: (tos 0x10, ttl 64, id 43633, offset 0, flags [DF], proto TCP (6), length 272)
    192.168.10.99.22 > 192.168.10.25.52050: Flags [P.], cksum 0x96cf (incorrect -> 0x6ade), seq 1576:1796, ack 1, win 501, options [nop,nop,TS val 1010458605 ecr 1630495104], length 220
    10:26:00.834136 dc:a6:32:44:08:96 > f8:ff:c2:6a:6d:60, ethertype IPv4 (0x0800), length 630: (tos 0x10, ttl 64, id 43634, offset 0, flags [DF], proto TCP (6), length 616)
    192.168.10.99.22 > 192.168.10.25.52050: Flags [P.], cksum 0x9827 (incorrect -> 0x7aca), seq 1796:2360, ack 1, win 501, options [nop,nop,TS val 1010458606 ecr 1630495104], length 564
    10:26:00.834191 dc:a6:32:44:08:96 > f8:ff:c2:6a:6d:60, ethertype IPv4 (0x0800), length 462: (tos 0x10, ttl 64, id 43635, offset 0, flags [DF], proto TCP (6), length 448)
    192.168.10.99.22 > 192.168.10.25.52050: Flags [P.], cksum 0x977f (incorrect -> 0x7008), seq 2360:2756, ack 1, win 501, options [nop,nop,TS val 1010458606 ecr 1630495104], length 396
    10:26:00.834244 dc:a6:32:44:08:96 > f8:ff:c2:6a:6d:60, ethertype IPv4 (0x0800), length 294: (tos 0x10, ttl 64, id 43636, offset 0, flags [DF], proto TCP (6), length 280)
    192.168.10.99.22 > 192.168.10.25.52050: Flags [P.], cksum 0x96d7 (incorrect -> 0xfea0), seq 2756:2984, ack 1, win 501, options [nop,nop,TS val 1010458606 ecr 1630495104], length 228
    10:26:00.838417 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0xc049 (correct), seq 1, ack 124, win 2792, options [nop,nop,TS val 1630495296 ecr 1010458605], length 0
    10:26:00.838459 dc:a6:32:44:08:96 > f8:ff:c2:6a:6d:60, ethertype IPv4 (0x0800), length 1254: (tos 0x10, ttl 64, id 43637, offset 0, flags [DF], proto TCP (6), length 1240)
    192.168.10.99.22 > 192.168.10.25.52050: Flags [P.], cksum 0x9a97 (incorrect -> 0xc679), seq 2984:4172, ack 1, win 501, options [nop,nop,TS val 1010458610 ecr 1630495296], length 1188
    10:26:00.838498 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0xbf78 (correct), seq 1, ack 336, win 2789, options [nop,nop,TS val 1630495296 ecr 1010458605], length 0
    10:26:00.838500 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0xbde3 (correct), seq 1, ack 748, win 2782, options [nop,nop,TS val 1630495296 ecr 1010458605], length 0
    10:26:00.838502 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0xbcfe (correct), seq 1, ack 968, win 2791, options [nop,nop,TS val 1630495296 ecr 1010458605], length 0
    10:26:00.838504 f8:ff:c2:6a:6d:60 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 66: (tos 0x48, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    192.168.10.25.52050 > 192.168.10.99.22: Flags [.], cksum 0xbc2e (correct), seq 1, ack 1180, win 2787, options [nop,nop,TS val 1630495296 ecr 1010458605], length 0
    10:26:00.838562 dc:a6:32:44:08:96 > f8:ff:c2:6a:6d:60, ethertype IPv4 (0x0800), length 270: (tos 0x10, ttl 64, id 43638, offset 0, flags [DF], proto TCP (6), length 256)
    192.168.10.99.22 > 192.168.10.25.52050: Flags [P.], cksum 0x96bf (incorrect -> 0x6c91), seq 4172:4376, ack 1, win 501, options [nop,nop,TS val 1010458610 ecr 1630495296], length 204
    10:26:00.838666 dc:a6:32:44:08:96 > f8:ff:c2:6a:6d:60, ethertype IPv4 (0x0800), length 630: (tos 0x10, ttl 64, id 43639, offset 0, flags [DF], proto TCP (6), length 616)
    192.168.10.99.22 > 192.168.10.25.52050: Flags [P.], cksum 0x9827 (incorrect -> 0x7e38), seq 4376:4940, ack 1, win 501, options [nop,nop,TS val 1010458610 ecr 1630495296], length 564
    10:26:00.838762 dc:a6:32:44:08:96 > f8:ff:c2:6a:6d:60, ethertype IPv4 (0x0800), length 1102: (tos 0x10, ttl 64, id 43640, offset 0, flags [DF], proto TCP (6), length 1088)
    192.168.10.99.22 > 192.168.10.25.52050: Flags [P.], cksum 0x99ff (incorrect -> 0xb845), seq 4940:5976, ack 1, win 501, options [nop,nop,TS val 1010458610 ecr 1630495296], length 1036
    10:26:00.838859 dc:a6:32:44:08:96 > f8:ff:c2:6a:6d:60, ethertype IPv4 (0x0800), length 1150: (tos 0x10, ttl 64, id 43641, offset 0, flags [DF], proto TCP (6), length 1136)
    192.168.10.99.22 > 192.168.10.25.52050: Flags [P.], cksum 0x9a2f (incorrect -> 0x36ce), seq 5976:7060, ack 1, win 501, options [nop,nop,TS val 1010458610 ecr 1630495296], length 1084
    20 packets captured
    28 packets received by filter
    0 packets dropped by kernel

  • Ich habe den SSH-Zugriff von meinem Smartphone über Mobilfunk auf die Dyndns-Adresse gemacht. Dieser wird richtig aufgelöst. aber es geht nicht weiter.

    Hier die Ausgabe nach dem Zugriff:

    pi@pi:/home/hts $ sudo tcpdump -c 20 -vvveni eth0 port 22
    tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
    10:26:00.833473 dc:a6:32:44:08:96 > f8:ff:c2:6a:6d:60, ethertype IPv4 (0x0800), length 190: (tos 0x10, ttl 64, id 43627, offset 0, flags [DF], proto TCP (6), length 176)
    192.168.10.99.22 > 192.168.10.25.52050: Flags [P.], cksum 0x966f (incorrect -> 0xbad3), seq 896562854:896562978, ack 606214666, win 501, options [nop,nop,TS val 1010458605 ecr 163049510
    4], length 124

    Da stimmt etwas nicht, mit dem Zugriff via Internet. Was für ein Dyndns-provider ist das? Evtl. MyFritz?

    Bist Du sicher, dass dein Smartphone zum Zeitpunkt des Zugriffs, nicht auch gleichzeitig auf dein WLAN zugreifen konnte? Denn wegen dem NAT-Loopback (Hairpinning) das die FritzBox macht, wird im WLAN, der Zugriff via externe IP-Adresse der FritzBox, wie ein interner Zugriff gehandhabt und deshalb sieht man als source IP-Adresse die interne IP 192.168.10.25. Ist die .25 die interne IP-Adresse deines Smartphones? Wenn Du nicht weißt, wie Du dein Smartphone umstellst, dann entferne dich ca. 500 Meter von deiner FritzBox und mache dann den Zugriff via externe IP-Adresse der FritzBox.

    EDIT:

    BTW: Merkwürdig ist bei dir auch, dass Du mit tcpdump nicht in der Lage bist, den 3-Wege-handshake (syn / syn+ack / ack) zu sniffen. Man sieht in der Ausgabe von tcpdump, nur den Austausch von pusk+ack- und ack-Datenpaketen, zwischen Client und Server. Wann startest Du den tcpdump?

    The most popular websites without IPv6 in Germany.  IPv6-Ausreden

    Meine PIs

    PI4B/8GB (border device) OpenBSD 7.4 (64bit): SSH-Server, WireGuard-Server, ircd-hybrid-Server, stunnel-Proxy, Mumble-Server

    PI3B+ FreeBSD 14.0-R-p3 (arm64): SSH-Serv., WireGuard-Serv., ircd-hybrid-Serv., stunnel-Proxy, Mumble-Serv., ddclient

    PI4B/4GB Bullseye-lite (64bit; modifiziert): SSH-Server, WireGuard-Server, ircd-hybrid-Server, stunnel-Proxy, Mumble-Server, botamusique, ample

    Einmal editiert, zuletzt von rpi444 (14. Januar 2022 um 10:53)

  • Die .25 ist die Adresse meines Notebooks mit dem ich den tcpdump ausgeführt habe

    Dann musst Du den Filter von tcpdump ändern, denn Du willst bei einer vorhandenen internen ssh-Verbindung, zusätzlich eine externe mit dem Smartphone herstellen und der Laptop hat das "-c 20" bis dann schon "verbraucht":

    Code
    sudo tcpdump -c 20 -vvveni eth0 port 22 and not host 192.168.10.25

    EDIT:

    Poste mal auch die Ausgaben von:

    Code
    sudo sshd -t
    cat /etc/ssh/sshd_config
    sudo iptables -nvx -L INPUT

    EDIT 2:

    Du hast einen Kabelanschluss bei VF (in BaWü). Hast Du dort natives IPv4 oder DS oder DS-lite? BTW: Welche FritzBox-cable hast Du?

    The most popular websites without IPv6 in Germany.  IPv6-Ausreden

    Meine PIs

    PI4B/8GB (border device) OpenBSD 7.4 (64bit): SSH-Server, WireGuard-Server, ircd-hybrid-Server, stunnel-Proxy, Mumble-Server

    PI3B+ FreeBSD 14.0-R-p3 (arm64): SSH-Serv., WireGuard-Serv., ircd-hybrid-Serv., stunnel-Proxy, Mumble-Serv., ddclient

    PI4B/4GB Bullseye-lite (64bit; modifiziert): SSH-Server, WireGuard-Server, ircd-hybrid-Server, stunnel-Proxy, Mumble-Server, botamusique, ample

    3 Mal editiert, zuletzt von rpi444 (14. Januar 2022 um 11:33)

  • Hier die Ausgabe, die Ip 46.114. passt, diese habe ich über das Mobilfunknetz bekommen. Gut zu sehen, dass die Anfrage zumindest mal am PI ankommt.

    Ja ich bin bei Vodafone BW und habe eine Fritzbox 6660 und nutze IP4

    pi@pi:~ $ sudo tcpdump -c 20 -vvveni eth0 port 22 and not host 192.168.10.25
    tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
    11:49:48.931196 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.53053 > 192.168.10.99.22: Flags [S], cksum 0x0fc0 (correct), seq 3470563416, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 4111818508 ecr 0,sackOK,eol], length
    0
    11:49:49.910255 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.53053 > 192.168.10.99.22: Flags [S], cksum 0x0bd7 (correct), seq 3470563416, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 4111819509 ecr 0,sackOK,eol], length
    0
    11:49:50.930404 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.53053 > 192.168.10.99.22: Flags [S], cksum 0x07ee (correct), seq 3470563416, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 4111820510 ecr 0,sackOK,eol], length
    0
    11:49:51.950521 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.53053 > 192.168.10.99.22: Flags [S], cksum 0x0404 (correct), seq 3470563416, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 4111821512 ecr 0,sackOK,eol], length
    0
    11:49:53.950693 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.53053 > 192.168.10.99.22: Flags [S], cksum 0xfc31 (correct), seq 3470563416, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 4111823514 ecr 0,sackOK,eol], length
    0
    11:49:57.950405 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.53053 > 192.168.10.99.22: Flags [S], cksum 0xec8f (correct), seq 3470563416, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 4111827516 ecr 0,sackOK,eol], length
    0
    11:50:05.950532 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.53053 > 192.168.10.99.22: Flags [S], cksum 0xcd4e (correct), seq 3470563416, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 4111835517 ecr 0,sackOK,eol], length
    0
    11:50:59.592289 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.32978 > 192.168.10.99.22: Flags [S], cksum 0x94d5 (correct), seq 1011436976, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 1496883579 ecr 0,sackOK,eol], length
    0
    11:51:00.603264 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.32978 > 192.168.10.99.22: Flags [S], cksum 0x90ed (correct), seq 1011436976, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 1496884579 ecr 0,sackOK,eol], length
    0
    11:51:01.622525 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.32978 > 192.168.10.99.22: Flags [S], cksum 0x8d05 (correct), seq 1011436976, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 1496885579 ecr 0,sackOK,eol], length
    0
    11:51:02.622497 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.32978 > 192.168.10.99.22: Flags [S], cksum 0x891b (correct), seq 1011436976, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 1496886581 ecr 0,sackOK,eol], length
    0
    11:51:03.622735 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.32978 > 192.168.10.99.22: Flags [S], cksum 0x8532 (correct), seq 1011436976, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 1496887582 ecr 0,sackOK,eol], length
    0
    11:51:04.623860 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.32978 > 192.168.10.99.22: Flags [S], cksum 0x8149 (correct), seq 1011436976, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 1496888583 ecr 0,sackOK,eol], length
    0
    11:51:06.623129 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.32978 > 192.168.10.99.22: Flags [S], cksum 0x7977 (correct), seq 1011436976, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 1496890585 ecr 0,sackOK,eol], length
    0
    11:51:10.622663 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.32978 > 192.168.10.99.22: Flags [S], cksum 0x69d6 (correct), seq 1011436976, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 1496894586 ecr 0,sackOK,eol], length
    0
    11:51:18.622982 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.32978 > 192.168.10.99.22: Flags [S], cksum 0x4a94 (correct), seq 1011436976, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 1496902588 ecr 0,sackOK,eol], length
    0


    hier noch die anderen Ausgaben:

    cat /etc/ssh/sshd_config
    # $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $

    # This is the sshd server system-wide configuration file. See
    # sshd_config(5) for more information.

    # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

    # The strategy used for options in the default sshd_config shipped with
    # OpenSSH is to specify options with their default value where
    # possible, but leave them commented. Uncommented options override the
    # default value.

    #Port 22
    #AddressFamily any
    #ListenAddress 0.0.0.0
    #ListenAddress ::

    #HostKey /etc/ssh/ssh_host_rsa_key
    #HostKey /etc/ssh/ssh_host_ecdsa_key
    #HostKey /etc/ssh/ssh_host_ed25519_key

    # Ciphers and keying
    #RekeyLimit default none

    # Logging
    #SyslogFacility AUTH
    #LogLevel INFO

    # Authentication:

    #LoginGraceTime 2m
    #PermitRootLogin prohibit-password
    #StrictModes yes
    #MaxAuthTries 6
    #MaxSessions 10

    #PubkeyAuthentication yes

    # Expect .ssh/authorized_keys2 to be disregarded by default in future.
    #AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2

    #AuthorizedPrincipalsFile none

    #AuthorizedKeysCommand none
    #AuthorizedKeysCommandUser nobody

    # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
    #HostbasedAuthentication no
    # Change to yes if you don't trust ~/.ssh/known_hosts for
    # HostbasedAuthentication
    #IgnoreUserKnownHosts no
    # Don't read the user's ~/.rhosts and ~/.shosts files
    #IgnoreRhosts yes

    # To disable tunneled clear text passwords, change to no here!
    #PasswordAuthentication yes
    #PermitEmptyPasswords no

    # Change to yes to enable challenge-response passwords (beware issues with
    # some PAM modules and threads)
    ChallengeResponseAuthentication no

    # Kerberos options
    #KerberosAuthentication no
    #KerberosOrLocalPasswd yes
    #KerberosTicketCleanup yes
    #KerberosGetAFSToken no

    # GSSAPI options
    #GSSAPIAuthentication no
    #GSSAPICleanupCredentials yes
    #GSSAPIStrictAcceptorCheck yes
    #GSSAPIKeyExchange no

    # Set this to 'yes' to enable PAM authentication, account processing,
    # and session processing. If this is enabled, PAM authentication will
    # be allowed through the ChallengeResponseAuthentication and
    # PasswordAuthentication. Depending on your PAM configuration,
    # PAM authentication via ChallengeResponseAuthentication may bypass
    # the setting of "PermitRootLogin without-password".
    # If you just want the PAM account and session checks to run without
    # PAM authentication, then enable this but set PasswordAuthentication
    # and ChallengeResponseAuthentication to 'no'.
    UsePAM yes

    #AllowAgentForwarding yes
    #AllowTcpForwarding yes
    #GatewayPorts no
    X11Forwarding yes
    #X11DisplayOffset 10
    #X11UseLocalhost yes
    #PermitTTY yes
    PrintMotd no
    #PrintLastLog yes
    #TCPKeepAlive yes
    #PermitUserEnvironment no
    #Compression delayed
    #ClientAliveInterval 0
    #ClientAliveCountMax 3
    #UseDNS no
    #PidFile /var/run/sshd.pid
    #MaxStartups 10:30:100
    #PermitTunnel no
    #ChrootDirectory none
    #VersionAddendum none

    # no default banner path
    #Banner none

    # Allow client to pass locale environment variables
    AcceptEnv LANG LC_*

    # override default of no subsystems
    Subsystem sftp /usr/lib/openssh/sftp-server

    # Example of overriding settings on a per-user basis
    #Match User anoncvs
    # X11Forwarding no
    # AllowTcpForwarding no
    # PermitTTY no
    # ForceCommand cvs server

    ---

    sudo iptables -nvx -L INPUT
    Chain INPUT (policy ACCEPT 530663 packets, 155719965 bytes)
    pkts bytes target prot opt in out source destination
    41347 11624977 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
    103 123504 ACCEPT icmp -- eth0 * 0.0.0.0/0 0.0.0.0/0
    2142 140299 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
    6899393 3354308434 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED

  • Es kommen anscheinend nur eingehende syn-Anfrage aus dem Internet beim (sshd? des) PI an, die von diesem ignoriert, weil er nicht mit syn+ack antwortet. Die sshd_config ist im default-Zustand.

    Wer und warum hat die 4 iptables-Regeln (mit dem target ACCEPT) in der INPUT chain gesetzt, wenn doch die default policy der INPUT chain auch auf ACCEPT ist. Diese Regeln erfassen nur den Traffic und bewirken sonst nichts. Oder sind das doch nicht alle Regeln aus der input Chain?

    Wie sind die Ausgaben von:

    Code
    cat /etc/hosts.allow
    cat /etc/hosts.deny
    systemctl cat ssh
    sudo netstat -tlpena | grep -i 22

    ?

    The most popular websites without IPv6 in Germany.  IPv6-Ausreden

    Meine PIs

    PI4B/8GB (border device) OpenBSD 7.4 (64bit): SSH-Server, WireGuard-Server, ircd-hybrid-Server, stunnel-Proxy, Mumble-Server

    PI3B+ FreeBSD 14.0-R-p3 (arm64): SSH-Serv., WireGuard-Serv., ircd-hybrid-Serv., stunnel-Proxy, Mumble-Serv., ddclient

    PI4B/4GB Bullseye-lite (64bit; modifiziert): SSH-Server, WireGuard-Server, ircd-hybrid-Server, stunnel-Proxy, Mumble-Server, botamusique, ample

  • Ich habe bewusst nichts gesetzt. Als ich den VPN-Gateway aufgesetzt habe habe ich die IPtables und das IP-Forwarding bearbeitet. Ich habe die komplette Ausgabe oben gepostet.


    Hier die Ausgabe:

    cat /etc/hosts.allow
    # /etc/hosts.allow: list of hosts that are allowed to access the system.
    # See the manual pages hosts_access(5) and hosts_options(5).
    #
    # Example: ALL: LOCAL @some_netgroup
    # ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
    #
    # If you're going to protect the portmapper use the name "rpcbind" for the
    # daemon name. See rpcbind(8) and rpc.mountd(8) for further information.
    #

    cat /etc/hosts.deny
    # /etc/hosts.deny: list of hosts that are _not_ allowed to access the system.
    # See the manual pages hosts_access(5) and hosts_options(5).
    #
    # Example: ALL: some.host.name, .some.domain
    # ALL EXCEPT in.fingerd: other.host.name, .other.domain
    #
    # If you're going to protect the portmapper use the name "rpcbind" for the
    # daemon name. See rpcbind(8) and rpc.mountd(8) for further information.
    #
    # The PARANOID wildcard matches any host whose name does not match its
    # address.
    #
    # You may wish to enable this to ensure any programs that don't
    # validate looked up hostnames still leave understandable logs. In past
    # versions of Debian this has been the default.
    # ALL: PARANOID

    systemctl cat ssh
    # /lib/systemd/system/ssh.service
    [Unit]
    Description=OpenBSD Secure Shell server
    Documentation=man:sshd(8) man:sshd_config(5)
    After=network.target auditd.service
    ConditionPathExists=!/etc/ssh/sshd_not_to_be_run

    [Service]
    EnvironmentFile=-/etc/default/ssh
    ExecStartPre=/usr/sbin/sshd -t
    ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
    ExecReload=/usr/sbin/sshd -t
    ExecReload=/bin/kill -HUP $MAINPID
    KillMode=process
    Restart=on-failure
    RestartPreventExitStatus=255
    Type=notify
    RuntimeDirectory=sshd
    RuntimeDirectoryMode=0755

    [Install]
    WantedBy=multi-user.target
    Alias=sshd.service

    sudo netstat -tlpena | grep -i 22
    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 0 20658 628/sshd
    tcp 0 0 192.168.10.99:22 192.168.10.25:56920 ESTABLISHED 0 513832 23726/sshd: pi [pri
    tcp6 0 0 :::21 :::* LISTEN 120 22082 1051/proftpd: (acce
    tcp6 0 0 :::22 :::* LISTEN 0 20660 628/sshd

  • ... habe ich die IPtables und das IP-Forwarding bearbeitet.

    Aber warum und nach welcher Anleitung hast Du die iptables-Regeln in der INPUT chain so gesetzt? Denn sie bewirken nichts.

    Stoppe den tcpdump und trenne mal die ssh-Verbindung mit dem Laptop zum PI, damit ich mit einem Portscan via Internet schaue, wie sich der sshd auf dem PI verhält, wenn keine aktive Verbindung aufgebaut ist. Poste hier wenn bzw. wann ich den Portscan machen kann.

    EDIT:

    Evtl. liegt es auch an deiner erwähnten VPN-Verbindung, dass dann keine wirksame/brauchbare default route, für den Rückweg mehr vorhanden ist. Evtl. fehlt auch ein erforderliches source-NAT (MASQUERADING?) beim zuständigen Interface. Poste die Ausgabe von:

    Code
    route -n

    vom PI und beschreibe deine VPN-Konstellation bzw. wie und wofür Du dieses VPN benutzen willst.

    The most popular websites without IPv6 in Germany.  IPv6-Ausreden

    Meine PIs

    PI4B/8GB (border device) OpenBSD 7.4 (64bit): SSH-Server, WireGuard-Server, ircd-hybrid-Server, stunnel-Proxy, Mumble-Server

    PI3B+ FreeBSD 14.0-R-p3 (arm64): SSH-Serv., WireGuard-Serv., ircd-hybrid-Serv., stunnel-Proxy, Mumble-Serv., ddclient

    PI4B/4GB Bullseye-lite (64bit; modifiziert): SSH-Server, WireGuard-Server, ircd-hybrid-Server, stunnel-Proxy, Mumble-Server, botamusique, ample

    Einmal editiert, zuletzt von rpi444 (14. Januar 2022 um 12:37)

  • Das ist schon etwas her und wie gesagt so tief bin ich da auch nicht drin im Thema. Was würdest du mir denn empfehlen mit der Input Chain zu ändern?

    Die SSH-Verbindung ist getrennt. Du kannst gerne den Scan jetzt machen

  • Du kannst gerne den Scan jetzt machen

    Hab ich gemacht und der Port 22 ist auch jetzt nicht erreichbar.

    Siehe EDIT oben. ich denke es liegt an der config, die Du für das VPN gemacht hast. Poste mal die Ausgaben:

    Code
    ip a
    route -n
    sudo iptables -nvx -L -t nat

    The most popular websites without IPv6 in Germany.  IPv6-Ausreden

    Meine PIs

    PI4B/8GB (border device) OpenBSD 7.4 (64bit): SSH-Server, WireGuard-Server, ircd-hybrid-Server, stunnel-Proxy, Mumble-Server

    PI3B+ FreeBSD 14.0-R-p3 (arm64): SSH-Serv., WireGuard-Serv., ircd-hybrid-Serv., stunnel-Proxy, Mumble-Serv., ddclient

    PI4B/4GB Bullseye-lite (64bit; modifiziert): SSH-Server, WireGuard-Server, ircd-hybrid-Server, stunnel-Proxy, Mumble-Server, botamusique, ample

  • ip a
    1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    valid_lft forever preferred_lft forever

    inet6 ::1/128 scope host
    valid_lft forever preferred_lft forever
    2: eth0:
    mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether dc:a6:32:44:08:96 brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.99/24 brd 192.168.10.255 scope global eth0
    valid_lft forever preferred_lft forever
    inet6 fd1a:9bc0:b4fa:1:dea6:32ff:fe44:896/64 scope global dynamic mngtmpaddr
    valid_lft 1672sec preferred_lft 1672sec
    inet6 fe80::dea6:32ff:fe44:896/64 scope link
    valid_lft forever preferred_lft forever
    3: wlan0:
    mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether dc:a6:32:44:08:99 brd ff:ff:ff:ff:ff:ff
    5: tun0:

    mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100 link/none inet 10.8.1.11/24 brd 10.8.1.255 scope global tun0 valid_lft forever preferred_lft forever inet6 fe80::f0ab:f7bf:22b9:bd0f/64 scope link stable-privacy valid_lft forever preferred_lft forever

    ---

    ---

    route -n
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    0.0.0.0 10.8.1.1 128.0.0.0 UG 0 0 0 tun0
    0.0.0.0 192.168.10.1 0.0.0.0 UG 0 0 0 eth0
    5.180.62.123 192.168.10.1 255.255.255.255 UGH 0 0 0 eth0
    10.8.1.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
    128.0.0.0 10.8.1.1 128.0.0.0 UG 0 0 0 tun0
    192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

    ---

    --

    sudo iptables -nvx -L -t nat
    Chain PREROUTING (policy ACCEPT 97345 packets, 13509311 bytes)
    pkts bytes target prot opt in out source destination

    Chain INPUT (policy ACCEPT 37555 packets, 7562002 bytes)
    pkts bytes target prot opt in out source destination

    Chain POSTROUTING (policy ACCEPT 15123 packets, 1429204 bytes)
    pkts bytes target prot opt in out source destination
    75756 7179776 MASQUERADE all -- * tun0 0.0.0.0/0 0.0.0.0/0

    Chain OUTPUT (policy ACCEPT 31138 packets, 2663911 bytes)
    pkts bytes target prot opt in out source destination


  • Kein Rückweg für Datenpakete die via eth0 kommen. Versuch mal mit:

    Code
    sudo iptables -t nat -I POSTROUTING 1 -o eth0 -j MASQUERADE

    The most popular websites without IPv6 in Germany.  IPv6-Ausreden

    Meine PIs

    PI4B/8GB (border device) OpenBSD 7.4 (64bit): SSH-Server, WireGuard-Server, ircd-hybrid-Server, stunnel-Proxy, Mumble-Server

    PI3B+ FreeBSD 14.0-R-p3 (arm64): SSH-Serv., WireGuard-Serv., ircd-hybrid-Serv., stunnel-Proxy, Mumble-Serv., ddclient

    PI4B/4GB Bullseye-lite (64bit; modifiziert): SSH-Server, WireGuard-Server, ircd-hybrid-Server, stunnel-Proxy, Mumble-Server, botamusique, ample

  • Scheint leider nichts gebracht zu haben:

    sudo tcpdump -c 20 -vvveni eth0 port 22 and not host 192.168.10.25
    tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
    12:55:14.622535 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.55356 > 192.168.10.99.22: Flags [S], cksum 0x8501 (correct), seq 2434029546, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 1001920608 ecr 0,sackOK,eol], length
    0
    12:55:15.640957 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.55356 > 192.168.10.99.22: Flags [S], cksum 0x8118 (correct), seq 2434029546, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 1001921609 ecr 0,sackOK,eol], length
    0
    12:55:16.640949 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.55356 > 192.168.10.99.22: Flags [S], cksum 0x7d2f (correct), seq 2434029546, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 1001922610 ecr 0,sackOK,eol], length
    0
    12:55:17.641088 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.55356 > 192.168.10.99.22: Flags [S], cksum 0x7946 (correct), seq 2434029546, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 1001923611 ecr 0,sackOK,eol], length
    0
    12:55:18.661368 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.55356 > 192.168.10.99.22: Flags [S], cksum 0x755d (correct), seq 2434029546, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 1001924612 ecr 0,sackOK,eol], length
    0
    12:55:19.661320 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.55356 > 192.168.10.99.22: Flags [S], cksum 0x7174 (correct), seq 2434029546, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 1001925613 ecr 0,sackOK,eol], length
    0
    12:55:21.641622 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.55356 > 192.168.10.99.22: Flags [S], cksum 0x69a3 (correct), seq 2434029546, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 1001927614 ecr 0,sackOK,eol], length
    0
    12:55:25.668232 2c:3a:fd:a3:4b:a6 > dc:a6:32:44:08:96, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 54, id 0, offset 0, flags [DF], proto TCP (6), length 64)
    46.114.163.119.55356 > 192.168.10.99.22: Flags [S], cksum 0x5a02 (correct), seq 2434029546, win 65535, options [mss 1360,nop,wscale 6,nop,nop,TS val 1001931615 ecr 0,sackOK,eol], length
    0
    ^C
    8 packets captured
    10 packets received by filter
    0 packets dropped by kernel


    ip a
    1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
    valid_lft forever preferred_lft forever
    2: eth0:
    mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether dc:a6:32:44:08:96 brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.99/24 brd 192.168.10.255 scope global eth0
    valid_lft forever preferred_lft forever
    inet6 fd1a:9bc0:b4fa:1:dea6:32ff:fe44:896/64 scope global dynamic mngtmpaddr
    valid_lft 1702sec preferred_lft 1702sec
    inet6 fe80::dea6:32ff:fe44:896/64 scope link
    valid_lft forever preferred_lft forever
    3: wlan0:
    mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether dc:a6:32:44:08:99 brd ff:ff:ff:ff:ff:ff
    5: tun0:

    mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100 link/none inet 10.8.1.11/24 brd 10.8.1.255 scope global tun0 valid_lft forever preferred_lft forever inet6 fe80::f0ab:f7bf:22b9:bd0f/64 scope link stable-privacy valid_lft forever preferred_lft forever


    route -n
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    0.0.0.0 10.8.1.1 128.0.0.0 UG 0 0 0 tun0
    0.0.0.0 192.168.10.1 0.0.0.0 UG 0 0 0 eth0
    5.180.62.123 192.168.10.1 255.255.255.255 UGH 0 0 0 eth0
    10.8.1.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
    128.0.0.0 10.8.1.1 128.0.0.0 UG 0 0 0 tun0
    192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0


    sudo iptables -nvx -L -t nat
    Chain PREROUTING (policy ACCEPT 99051 packets, 13774490 bytes)
    pkts bytes target prot opt in out source destination

    Chain INPUT (policy ACCEPT 38204 packets, 7732112 bytes)
    pkts bytes target prot opt in out source destination

    Chain POSTROUTING (policy ACCEPT 15250 packets, 1441249 bytes)
    pkts bytes target prot opt in out source destination
    15 1123 MASQUERADE all -- * eth0 0.0.0.0/0 0.0.0.0/0
    76958 7286121 MASQUERADE all -- * tun0 0.0.0.0/0 0.0.0.0/0

    Chain OUTPUT (policy ACCEPT 31427 packets, 2688435 bytes)
    pkts bytes target prot opt in out source destination


  • Versuch mal mit geänderter metric, bei der Route via tun0-Interface:

    Code
    sudo ip route del 10.8.1.1/1 via 10.8.1.11 && sudo ip route add 10.8.1.1/1 via 10.8.1.11 metric 300

    Ist das eine permanente VPN-Verbindung zwischen deinem PI und NordVPN-Server? Wenn ja, warum brauchst Du das? Hast Du evtl. auch in deiner FritzBox eine Konfiguration/Eintragung (z. B. statische Route) bzgl. dieser VPN-Verbindung zu NordVPN?

    EDIT:

    Teste den Zugriff von extern, auch mal mit deaktivierter NordVPN-Verbindung.

    The most popular websites without IPv6 in Germany.  IPv6-Ausreden

    Meine PIs

    PI4B/8GB (border device) OpenBSD 7.4 (64bit): SSH-Server, WireGuard-Server, ircd-hybrid-Server, stunnel-Proxy, Mumble-Server

    PI3B+ FreeBSD 14.0-R-p3 (arm64): SSH-Serv., WireGuard-Serv., ircd-hybrid-Serv., stunnel-Proxy, Mumble-Serv., ddclient

    PI4B/4GB Bullseye-lite (64bit; modifiziert): SSH-Server, WireGuard-Server, ircd-hybrid-Server, stunnel-Proxy, Mumble-Server, botamusique, ample

    Einmal editiert, zuletzt von rpi444 (14. Januar 2022 um 14:37)

Jetzt mitmachen!

Du hast noch kein Benutzerkonto auf unserer Seite? Registriere dich kostenlos und nimm an unserer Community teil!