Skip to content

OpenWrt - Basics der Firewall

Linux
  • Ein tolles Video zu den Grundeinstellungen. Muss das mal hier pinnen, damit das nicht verloren geht 😉

  • NanoPi5 - eMMC

    Verschoben NanoPi R5S openwrt nanopir5s linux
    1
    4
    0 Stimmen
    1 Beiträge
    247 Aufrufe
    Niemand hat geantwortet
  • OpenWrt - Docker & DNS & Zugriff auf WAN

    Linux openwrt portainer
    4
    2
    0 Stimmen
    4 Beiträge
    572 Aufrufe
    FrankMF
    Es geht weiter, der erste und ich bin mit der Lösung nicht so richtig zufrieden, also suchen. Als erstes habe ich heute Morgen ein frisches SD-Karten Image mit Docker von FreindlyWrt genommen und auf meinem Test NanoPi R5S installiert. Dort mal die Config angeschaut um zu sehen, ob der Eintrag standardmäßig gesetzt ist. Doch dort taucht dann einmal eine ganz ander Config auf # The following settings require a restart of docker to take full effect, A reload will only have partial or no effect: # bip # blocked_interfaces # extra_iptables_args # device config globals 'globals' # option alt_config_file '/etc/docker/daemon.json' option enable '1' option data_root '/mnt/nvme_part2/docker' option log_level 'warn' option iptables '1' #list hosts 'unix:///var/run/docker.sock' # option bip '172.18.0.1/24' # option fixed_cidr '172.17.0.0/16' # option fixed_cidr_v6 'fc00:1::/80' # option ipv6 '1' # option ip '::ffff:0.0.0.0' # list dns '172.17.0.1' # list registry_mirrors 'https://<my-docker-mirror-host>' list registry_mirrors 'https://hub.docker.com' option remote_endpoint '0' # option bridge 'br-container' # Docker ignores fw3 rules and by default all external source IPs are allowed to connect to the Docker host. # See https://docs.docker.com/network/iptables/ for more details. # firewall config changes are only additive i.e firewall will need to be restarted first to clear old changes, # then docker restarted to load in new changes. config firewall 'firewall' option device 'docker0' list blocked_interfaces 'wan' option extra_iptables_args '--match conntrack ! --ctstate RELATED,ESTABLISHED' # allow outbound connections Das interessiert uns jetzt list blocked_interfaces 'wan' option extra_iptables_args '--match conntrack ! --ctstate RELATED,ESTABLISHED' # allow outbound connections Wenn ich das jetzt alles richtig verstehe, muss WAN geblockt sein, weil sonst der Docker Host offen im Netz steht (Hierbei bin ich mir nicht 100% sicher) Die zweite Zeile ist eine iptables Regel, die es den Containern dann ermöglicht das Internet zu erreichen. Das habe ich jetzt so eingestellt und getestet. root@b9ffae24913a:/# ping 1.1.1.1 PING 1.1.1.1 (1.1.1.1): 56 data bytes 64 bytes from 1.1.1.1: icmp_seq=0 ttl=57 time=17.151 ms 64 bytes from 1.1.1.1: icmp_seq=1 ttl=57 time=16.553 ms 64 bytes from 1.1.1.1: icmp_seq=2 ttl=57 time=20.630 ms 64 bytes from 1.1.1.1: icmp_seq=3 ttl=57 time=13.948 ms ^C--- 1.1.1.1 ping statistics --- 4 packets transmitted, 4 packets received, 0% packet loss round-trip min/avg/max/stddev = 13.948/17.071/20.630/2.382 ms root@b9ffae24913a:/# ping google.de PING google.de (142.250.185.195): 56 data bytes 64 bytes from 142.250.185.195: icmp_seq=0 ttl=58 time=23.797 ms 64 bytes from 142.250.185.195: icmp_seq=1 ttl=58 time=16.953 ms 64 bytes from 142.250.185.195: icmp_seq=2 ttl=58 time=19.441 ms ^C--- google.de ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max/stddev = 16.953/20.064/23.797/2.829 ms Ich hoffe mal das ich diese Thema jetzt zu den Akten legen kann. Wenn was falsch ist, bitte hier kommentieren, damit ich das ändern kann.
  • NanoPi R4S - OpenWrt kompilieren Teil 2

    Angeheftet NanoPi R4S openwrt nanopir4s
    5
    5
    0 Stimmen
    5 Beiträge
    482 Aufrufe
    FrankMF
    Kurzes Update. Der R4S im Alugehäuse, der hier als Router / Firewall rumliegt, läuft jetzt seit 44 Tagen einwandfrei. [image: 1615410154967-98ef6d29-e822-4847-a038-f02a027fb6fe-grafik.png]
  • OpenWrt - Sysupgrade

    OpenWRT & Ubiquiti ER-X openwrt linux er-x
    1
    0 Stimmen
    1 Beiträge
    279 Aufrufe
    Niemand hat geantwortet
  • OpenWRT - Zonen

    Verschoben OpenWRT & Ubiquiti ER-X openwrt linux
    2
    3
    0 Stimmen
    2 Beiträge
    658 Aufrufe
    FrankMF
    Es ist was heller geworden [image: 1610188645165-7b86e97c-31a5-44b6-809f-25d9d1c2ee4a-image.png] Die besagte Forward Regel [image: 1610188840619-zonen.png] Diese Forward Regel zieht erst dann, wenn es mehrere Interfaces in einer Zone gibt. Aus der Doku INPUT rules for a zone describe what happens to traffic trying to reach the router itself through an interface in that zone. OUTPUT rules for a zone describe what happens to traffic originating from the router itself going through an interface in that zone. FORWARD rules for a zone describe what happens to traffic passing between different interfaces belonging in the same zone. Das heisst nun, das ein Forwarding zwischen zwei Zonen immer eine spezifische Regel unter Traffic Rules benötigt. Forwarding between zones always requires a specific rule. Somit ist ein Forwarding zwischen zwei Zonen in den Standard Einstellungen nicht erlaubt. Das kann ich hier auch so bestätigen. Das ist ja auch das was ich mit meiner "DMZ"-Zone erreichen möchte. Kein Zugriff auf LAN. Unter Zone ⇒ Forwardings kann man jetzt sehen, das das Forwarding von LAN in Richtung WAN und DMZ erlaubt ist. WAN ist logisch, sonst komme ich ja nicht ins Internet. DMZ habe ich eingestellt, damit ich auch Teilnehmer im DMZ Netz erreichen kann, wenn ich da mal ran muss. [image: 1610189307657-8a548c29-8bc5-4074-8099-66460bcea9a8-image.png] Stelle ich das jetzt so ein. [image: 1610189398985-dca8b393-f613-4cab-a377-ffbc2bb8ddf5-image.png] Dann kann ich von der DMZ Zone aus das LAN erreichen. Aha, so langsam verstehe ich Quelle: https://forum.openwrt.org/t/firewall-zones-and-settings/84369
  • Ubiquiti ER-X - iperf

    Verschoben OpenWRT & Ubiquiti ER-X openwrt linux er-x
    2
    1
    0 Stimmen
    2 Beiträge
    341 Aufrufe
    FrankMF
    Hier noch ein Test von DMZ / LAN und andersrum. frank@frank-MS-7C37:~$ iperf3 -c 192.168.5.15 Connecting to host 192.168.5.15, port 5201 [ 5] local 192.168.3.213 port 44052 connected to 192.168.5.15 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 114 MBytes 952 Mbits/sec 314 153 KBytes [ 5] 1.00-2.00 sec 112 MBytes 937 Mbits/sec 259 205 KBytes [ 5] 2.00-3.00 sec 111 MBytes 929 Mbits/sec 210 212 KBytes [ 5] 3.00-4.00 sec 111 MBytes 934 Mbits/sec 235 202 KBytes [ 5] 4.00-5.00 sec 112 MBytes 936 Mbits/sec 263 153 KBytes [ 5] 5.00-6.00 sec 111 MBytes 935 Mbits/sec 255 209 KBytes [ 5] 6.00-7.00 sec 112 MBytes 937 Mbits/sec 313 129 KBytes [ 5] 7.00-8.00 sec 111 MBytes 932 Mbits/sec 296 209 KBytes [ 5] 8.00-9.00 sec 111 MBytes 934 Mbits/sec 258 208 KBytes [ 5] 9.00-10.00 sec 111 MBytes 934 Mbits/sec 292 201 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 1.09 GBytes 936 Mbits/sec 2695 sender [ 5] 0.00-10.00 sec 1.09 GBytes 935 Mbits/sec receiver iperf Done. frank@frank-MS-7C37:~$ iperf3 -R -c 192.168.5.15 Connecting to host 192.168.5.15, port 5201 Reverse mode, remote host 192.168.5.15 is sending [ 5] local 192.168.3.213 port 44058 connected to 192.168.5.15 port 5201 [ ID] Interval Transfer Bitrate [ 5] 0.00-1.00 sec 109 MBytes 911 Mbits/sec [ 5] 1.00-2.00 sec 109 MBytes 912 Mbits/sec [ 5] 2.00-3.00 sec 109 MBytes 912 Mbits/sec [ 5] 3.00-4.00 sec 109 MBytes 912 Mbits/sec [ 5] 4.00-5.00 sec 109 MBytes 912 Mbits/sec [ 5] 5.00-6.00 sec 108 MBytes 903 Mbits/sec [ 5] 6.00-7.00 sec 109 MBytes 912 Mbits/sec [ 5] 7.00-8.00 sec 109 MBytes 912 Mbits/sec [ 5] 8.00-9.00 sec 109 MBytes 912 Mbits/sec [ 5] 9.00-10.00 sec 109 MBytes 912 Mbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 1.06 GBytes 913 Mbits/sec 114 sender [ 5] 0.00-10.00 sec 1.06 GBytes 911 Mbits/sec receiver iperf Done.
  • Ubiquiti ER-X - Switch

    Verschoben OpenWRT & Ubiquiti ER-X openwrt linux er-x
    1
    1
    0 Stimmen
    1 Beiträge
    295 Aufrufe
    Niemand hat geantwortet
  • NanoPi R2S - OpenWRT

    Verschoben NanoPi R2S nanopir2s openwrt linux
    6
    6
    0 Stimmen
    6 Beiträge
    732 Aufrufe
    FrankMF
    @thrakath1980 Ich wollte noch auf ein Thema zurück kommen. Das Original OpenWRT auf dem R2S ist ja ein Snapshot. Den kann man ohne Probleme aktualisieren. Unten ist dann ein Haken mit "Keep settings...." Gerade probiert, ging einwandfrei. Netzwerkeinstellungen und Firewall Settings blieben erhalten.