Einführung in Linux IPTABLES (Teil 2 Ein Beispiel Firewall-Skript)

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ม.ค. 2025

ความคิดเห็น • 25

  • @guerselyilmaz9968
    @guerselyilmaz9968 5 ปีที่แล้ว +3

    Super klar und verständlich. Lieben Dank Boris

  • @otoube
    @otoube 21 วันที่ผ่านมา

    Klasse erklärrt, und gut verständlich ! Danke

    • @BorisGedat
      @BorisGedat  19 วันที่ผ่านมา

      Sehr gerne! 👍🏻

  • @itarends
    @itarends 8 ปีที่แล้ว

    Vielen Dank für die beiden iptables-Videos. Ich beginne iptables langsam zu verstehen. Dein Video hat mir dabei gut geholfen.

    • @BorisGedat
      @BorisGedat  8 ปีที่แล้ว +1

      +Roland Arends Ja, gerne!

  • @onlinebestellen
    @onlinebestellen ปีที่แล้ว

    Sehr gutes und verständliches Video

  • @AlexDudenhof
    @AlexDudenhof 10 ปีที่แล้ว +2

    Sehr gutes Video!
    Wirklich großes Danke dafür. Hat mir sehr stark geholfen.

  • @m-electronics5977
    @m-electronics5977 3 ปีที่แล้ว

    Sehr gut erklärt, auch für fortgeschrittene Einsteiger

  • @m-electronics5977
    @m-electronics5977 3 ปีที่แล้ว

    Auch das erste Video sehr gut erklärt👍👍👍

    • @BorisGedat
      @BorisGedat  3 ปีที่แล้ว

      danke für das gute, freut mich dass ich weiterhelfen konnte!

  • @mrmlj1911
    @mrmlj1911 5 ปีที่แล้ว +1

    Genial gutes Video. Vielen Dank :)

  • @Karpador09
    @Karpador09 10 ปีที่แล้ว +4

    Kuhl wäre noch das fertige Skript in der Beschreibung :)

  • @m_bonny_p
    @m_bonny_p 3 ปีที่แล้ว

    Frage zur letzten Zeile:
    Nach Log wird geh es ja munter weiter was passiert dann mit dem "Stuff" was zu keiner der oberen Filter passt ?
    Müsste hier nicht eigentlich wie bei MYDROP noch ein Zeile drunter der DROP Befehl hinzukomme?

  • @m-electronics5977
    @m-electronics5977 3 ปีที่แล้ว

    Ich glaube ich kann doch anfangen meinen Linux router zu bauen aber OPNSense mir GUI ist glaube ich doch angenehmer nur da macht irgendwie die Firewall-Konfiguration keinen Sinn

  • @2KLights
    @2KLights 10 ปีที่แล้ว +1

    hey ich bekomme 2 Fehlermeldungen, um die eine handelt es sich sehr wahrscheinlich um etwas was meine configuration zu verbüßen hat. Aber bei der anderen möchte ich dich um Rat fragen:
    iptables v1.4.14: Can't use -i with OUTPUT
    was habe ich hier falsch gemacht?

    • @AlexDudenhof
      @AlexDudenhof 9 ปีที่แล้ว +1

      +2KLights Die 2. Zeile der Loopback-Regeln muss
      iptables -A OUTPUT -o lo -j ACCEPT
      lauten. Also -o statt -i.
      Ist ein kleiner Fehler im Video.

    • @2KLights
      @2KLights 9 ปีที่แล้ว

      okay danke

  • @xdx8457
    @xdx8457 10 ปีที่แล้ว +2

    Falls das Script jemand braucht:
    #!/bin/bash
    echo "Initializing Firewall ..."
    # Load modules
    modprobe ip_conntrack_ftp
    # Clear all other rules
    iptables -F
    iptables -X
    iptables -P INPUT DROP
    iptables -P OUTPUT DROP
    iptables -P FORWARD DROP
    # Creation of my own chains
    iptables -N MYDROP
    iptables -N MYACCEPT
    # Loopback communication
    iptables -A INPUT -i lo -j ACCEPT
    iptables -A OUTPUT -i lo -j ACCEPT
    # Statefull Inspection
    iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
    iptables -A INPUT -m state --state INVALID -j MYDROP
    iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
    # Configuring our own chains
    iptables -A MYDROP -j LOG --log-prefix "FW-DROP: "
    iptables -A MYDROP -j DROP
    iptables -A MYACCEPT -j LOG --log-prefix "FW-ACCEPT: "
    iptables -A MYACCEPT -j DROP
    # SSH
    iptables -A INPUT -p tcp --dport 22 -j MYACCEPT
    #iptables -A OUTPUT -p tcp --dport 22 -j MYACCEPT
    # ICMP Ping
    iptables -A INPUT -p icmp -j MYACCEPT
    iptables -A OUTPUT -p icmp -j MYACCEPT
    # DNS
    #iptables -A INPUT -p udp --dport 53 -j MYACCEPT
    #iptables -A INPUT -p tcp --dport 53 -j MYACCEPT
    #iptables -A OUTPUT -p udp --dport 53 -j MYACCEPT
    #iptables -A OUTPUT -p tcp --dport 53 -j MYACCEPT
    # WWW
    #iptables -A INPUT -p tcp --dport 80 -j MYACCEPT
    #iptables -A OUTPUT -p tcp --dport 80 -j MYACCEPT
    #iptables -A INPUT -p tcp --dport 443 -j MYACCEPT
    #iptables -A OUTPUT -p tcp --dport 443 -j MYACCEPT
    # Mail
    #iptables -A INPUT -p tcp --dport 25 -j MYACCEPT
    #iptables -A OUTPUT -p tcp --dport 25 -j MYACCEPT
    #iptables -A INPUT -p tcp --dport 110 -j MYACCEPT
    #iptables -A INPUT -p tcp --dport 143 -j MYACCEPT
    # FTP
    #iptables -A INPUT -p tcp --dport 21 -j MYACCEPT
    #iptables -A OUTPUT -p tcp --dport 21 -j MYACCEPT
    # DHCP
    #iptacles -A INPUT -p udp --dport 67 -j MYACCEPT
    echo "Firewall is configured and active! :-)"
    iptables -A INPUT -j LOG --log-prefix "FW-LAST-DROP:"

    • @bm5987
      @bm5987 5 ปีที่แล้ว

      Das Skript ist Fehlerhaft, und funktioniert so nicht.
      - iptables -A MY ACCEPT DROP -> Statt DROP muss da ein ACCEPT hin.
      Ansonsten kann man sämtlichen datentrafic vergessen, sehr ärgerlich der Fehler, habe das Skript verwendet.
      Nicht böse gemeint, nur für die hilflosen Seelen die auch so verzweifelt sind

  • @m-electronics5977
    @m-electronics5977 3 ปีที่แล้ว

    Wenn man das Prinzip und die Syntax erstmal verstanden hat ist das gar nicht so kompliziert wie alle immer denken und glaube ich auch sehr mächtig

  • @xdx8457
    @xdx8457 10 ปีที่แล้ว +2

    Ubuntu 14.04 wirft mir folgende Fehlermeldung:
    iptables v1.4.21: Can't use -i with OUTPUT
    Hab das Script mal etwas angepasst und vereinfacht:
    #!/bin/bash
    echo "Initializing Firewall ..."
    # Clear all other rules and block everything
    iptables -F
    iptables -X
    iptables -P INPUT DROP
    iptables -P OUTPUT DROP
    iptables -P FORWARD DROP
    # Creation of my own chains
    iptables -N MYDROP
    iptables -N MYACCEPT
    # Loopback communication
    iptables -A INPUT -i lo -j ACCEPT
    # Statefull Inspection
    iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
    iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
    iptables -A INPUT -m state --state INVALID -j DROP
    # Configuring our own chains
    iptables -A MYDROP -j LOG --log-prefix "FW-DROP: "
    iptables -A MYDROP -j DROP
    iptables -A MYACCEPT -j LOG --log-prefix "FW-ACCEPT: "
    iptables -A MYACCEPT -j ACCEPT
    # PING
    iptables -A INPUT -p icmp -j ACCEPT
    iptables -A OUTPUT -p icmp -j ACCEPT
    # SSH
    iptables -A INPUT -p tcp --dport 22 -j MYACCEPT
    iptables -A OUTPUT -p tcp --dport 22 -j MYACCEPT
    echo "Firewall is configured and active! :-)"

    • @user-uf9sp8hq4b
      @user-uf9sp8hq4b 4 ปีที่แล้ว

      You need CentOs

    • @Roter_Wolf
      @Roter_Wolf 2 ปีที่แล้ว

      Der Fehler kommt dadurch, dass im Video bei der Loopback-Kommunikation für den Output der Parameter ...-i lo... angegeben wird, es muss aber ...-o lo... heißen.