mailman.schlittermann.de
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
January
2000
December
November
October
September
August
July
June
May
April
March
February
January
1999
December
November
October
September
August
July
June
May
April
March
February
January
List overview
Download
Lug-dd
December 2009
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
January 2001
----- 2000 -----
December 2000
November 2000
October 2000
September 2000
August 2000
July 2000
June 2000
May 2000
April 2000
March 2000
February 2000
January 2000
----- 1999 -----
December 1999
November 1999
October 1999
September 1999
August 1999
July 1999
June 1999
May 1999
April 1999
March 1999
February 1999
January 1999
lug-dd@mailman.schlittermann.de
30 participants
21 discussions
Start a n
N
ew thread
Routing Netzwerk
by Andreas Oettel
02 Dec '09
02 Dec '09
Hallo an alle, ich habe ein kleines Problem, wo ich mittlerweile nicht mehr weiß wonach ich im Google suchen soll. Ich habe hier eine Netzwerk das 2 Wohnungen miteinander verbindet. Wohnung 1 darin ist ein Switch, an dem hängt ein Rechner mit der IP 192.168.68.1 und ein DSL-Modem Wohnung 2 darin ist ein Switch, an dem hängt mein Server (Router, Firewall, Datenspeicher) mit _einer_ Netzwerkkarte und _zwei_ IP's (die erste ist die 192.168.92.11 für ein Wohnungsinternes Netzwerk und die zweite ist die 192.168.68.11 um den Rechner aus Wohnung 1 anzubinden) Dieser Rechner wählt sich auch mittels dem DSL-Modem in Wohnung 1 in die bunte weite Netzwelt ein. Ich habe iptables (siehe Abschnitt unten "firewall") soweit konfiguriert, dass ich von Wohnung 2 aus auf alle Dienste des Servers (IMAP, SQUID, dnsmasq usw.) und auf das Internet zugreifen kann. Jetzt möchte ich Wohnung 1 auch über den Server routen und (nur) das Internet und die dafür notwendigen Dienste zur Verfügung stellen. Ich scheitere aber schon mal daran, dass ich nicht mal einen Ping hinbekomme. Es kommt immer Netzwerk nicht erreichbar. Kann mir jemand ein Tip geben, wo ich suchen muss? Habe ich hier ein Problem mit der Serverkonfiguration oder evtl. den beiden Switchen? Die Switche sind der übliche Endkundenkram. Kabel einstecken ist alles was man bei den Dingern machen kann. Danke für die Hilfe Andreas Anhang: Abschnitt "firewall" (gekürzt) "interfaces" Datei "firewall" (ungekürzt) -------Datei "firewall"---------- case "$1" in start) echo "Starte IP-Paketfilter" # iptables-Modul modprobe ip_tables # Connection-Tracking-Module modprobe ip_conntrack # Das Modul ip_conntrack_irc ist erst bei Kerneln >= 2.4.19 # verfuegbar modprobe ip_conntrack_irc modprobe ip_conntrack_ftp # Tabelle flushen iptables -F iptables -t nat -F iptables -t mangle -F iptables -X iptables -t nat -X iptables -t mangle -X # Default-Policies setzen iptables -P INPUT DROP iptables -P OUTPUT DROP iptables -P FORWARD DROP # MY_REJECT-Chain iptables -N MY_REJECT # MY_REJECT fuellen iptables -A MY_REJECT -p tcp -m limit --limit 7200/h -j LOG --log-prefix "REJECT TCP " iptables -A MY_REJECT -p tcp -j REJECT --reject-with tcp-reset iptables -A MY_REJECT -p udp -m limit --limit 7200/h -j LOG --log-prefix "REJECT UDP " iptables -A MY_REJECT -p udp -j REJECT --reject-with icmp-port-unreachable iptables -A MY_REJECT -p icmp -m limit --limit 7200/h -j LOG --log-prefix "DROP ICMP " iptables -A MY_REJECT -p icmp -j DROP iptables -A MY_REJECT -m limit --limit 7200/h -j LOG --log-prefix "REJECT OTHER " iptables -A MY_REJECT -j REJECT --reject-with icmp-proto-unreachable # MY_DROP-Chain iptables -N MY_DROP iptables -A MY_DROP -m limit --limit 7200/h -j LOG --log-prefix "PORTSCAN DROP " iptables -A MY_DROP -j DROP # Alle verworfenen Pakete protokollieren iptables -A INPUT -m state --state INVALID -m limit --limit 7200/h -j LOG --log-prefix "INPUT INVALID " iptables -A OUTPUT -m state --state INVALID -m limit --limit 7200/h -j LOG --log-prefix "OUTPUT INVALID " iptables -A FORWARD -m state --state INVALID -m limit --limit 7200/h -j LOG --log-prefix "FORWARD INVALID " # Korrupte Pakete zurueckweisen iptables -A INPUT -m state --state INVALID -j DROP iptables -A OUTPUT -m state --state INVALID -j DROP iptables -A FORWARD -m state --state INVALID -j DROP # Stealth Scans etc. DROPpen # Keine Flags gesetzt iptables -A INPUT -p tcp --tcp-flags ALL NONE -j MY_DROP iptables -A FORWARD -p tcp --tcp-flags ALL NONE -j MY_DROP # SYN und FIN gesetzt iptables -A INPUT -p tcp --tcp-flags SYN,FIN SYN,FIN -j MY_DROP iptables -A FORWARD -p tcp --tcp-flags SYN,FIN SYN,FIN -j MY_DROP # SYN und RST gleichzeitig gesetzt iptables -A INPUT -p tcp --tcp-flags SYN,RST SYN,RST -j MY_DROP iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN,RST -j MY_DROP # FIN und RST gleichzeitig gesetzt iptables -A INPUT -p tcp --tcp-flags FIN,RST FIN,RST -j MY_DROP iptables -A FORWARD -p tcp --tcp-flags FIN,RST FIN,RST -j MY_DROP # FIN ohne ACK iptables -A INPUT -p tcp --tcp-flags ACK,FIN FIN -j MY_DROP iptables -A FORWARD -p tcp --tcp-flags ACK,FIN FIN -j MY_DROP # PSH ohne ACK iptables -A INPUT -p tcp --tcp-flags ACK,PSH PSH -j MY_DROP iptables -A FORWARD -p tcp --tcp-flags ACK,PSH PSH -j MY_DROP # URG ohne ACK iptables -A INPUT -p tcp --tcp-flags ACK,URG URG -j MY_DROP iptables -A FORWARD -p tcp --tcp-flags ACK,URG URG -j MY_DROP # Loopback-Netzwerk-Kommunikation zulassen iptables -A INPUT -i lo -j ACCEPT iptables -A OUTPUT -o lo -j ACCEPT # Maximum Segment Size (MSS) für das Forwarding an PMTU anpassen iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu # Connection-Tracking aktivieren iptables -A OUTPUT -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT # iptables -A FORWARD -i ! ra0 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT iptables -A FORWARD -i ! ppp0 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # HTTP iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 3128 -j ACCEPT iptables -A PREROUTING -t nat -s 192.168.92.0/16 -p tcp --dport 80 -j REDIRECT --to-ports 3128 # HTTPS iptables -A POSTROUTING -t nat -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 443 -j MASQUERADE # SMTP iptables -A POSTROUTING -t nat -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 25 -j MASQUERADE # SMTPS iptables -A POSTROUTING -t nat -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 465 -j MASQUERADE # IMAPS iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 993 -j ACCEPT iptables -A POSTROUTING -t nat -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 993 -j MASQUERADE # DNS iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 53 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p udp --dport 53 -j ACCEPT # SMB/CIFS iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 137 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 138 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 139 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 445 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p udp --dport 137 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p udp --dport 138 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p udp --dport 139 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p udp --dport 445 -j ACCEPT # SSH iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW,ESTABLISHED,RELATED -p tcp --dport 22 -j ACCEPT iptables -A OUTPUT -d 192.168.92.0/16 -m state --state NEW,ESTABLISHED,RELATED -p tcp --dport 22 -j ACCEPT # DHCP iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p udp --dport 67 -j ACCEPT iptables -A OUTPUT -d 192.168.92.0/16 -m state --state NEW -p udp --dport 67 -j ACCEPT # NTP iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p udp --dport 123 -j ACCEPT # ICMP Echo-Request (ping) zulassen und beantworten iptables -A INPUT -m state --state NEW -p icmp --icmp-type echo-request -j ACCEPT # Default-Policies mit REJECT iptables -A INPUT -j MY_REJECT iptables -A OUTPUT -j MY_REJECT iptables -A FORWARD -j MY_REJECT # Forwarding/Routing echo "Aktiviere IP-Routing" echo 1 > /proc/sys/net/ipv4/ip_forward 2> /dev/null # SYN-Cookies echo 1 > /proc/sys/net/ipv4/tcp_syncookies 2> /dev/null # Stop Source-Routing for i in /proc/sys/net/ipv4/conf/*; do echo 0 > $i/accept_source_route 2> /dev/null; done # Stop Redirecting for i in /proc/sys/net/ipv4/conf/*; do echo 0 > $i/accept_redirects 2> /dev/null; done # Log Martians for i in /proc/sys/net/ipv4/conf/*; do echo 1 > $i/log_martians 2> /dev/null; done # BOOTP-Relaying ausschalten for i in /proc/sys/net/ipv4/conf/*; do echo 0 > $i/bootp_relay 2> /dev/null; done # Proxy-ARP ausschalten for i in /proc/sys/net/ipv4/conf/*; do echo 0 > $i/proxy_arp 2> /dev/null; done # Ungültige ICMP-Antworten ignorieren echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses 2> /dev/null # ICMP Echo-Broadcasts ignorieren echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts 2> /dev/null # Max. 500/Sekunde (5/Jiffie) senden echo 5 > /proc/sys/net/ipv4/icmp_ratelimit # Speicherallozierung und -timing für IP-De/-Fragmentierung echo 262144 > /proc/sys/net/ipv4/ipfrag_high_thresh echo 196608 > /proc/sys/net/ipv4/ipfrag_low_thresh echo 30 > /proc/sys/net/ipv4/ipfrag_time # TCP-FIN-Timeout zum Schutz vor DoS-Attacken setzen echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout # Maximal 3 Antworten auf ein TCP-SYN echo 3 > /proc/sys/net/ipv4/tcp_retries1 # TCP-Pakete maximal 15x wiederholen echo 15 > /proc/sys/net/ipv4/tcp_retries2 ;; stop) echo "Stoppe IP-Paketfilter" # Tabelle flushen iptables -F iptables -t nat -F iptables -t mangle -F iptables -X iptables -t nat -X iptables -t mangle -X echo "Deaktiviere IP-Routing" echo 0 > /proc/sys/net/ipv4/ip_forward # Default-Policies setzen iptables -P INPUT ACCEPT iptables -P OUTPUT ACCEPT iptables -P FORWARD ACCEPT ;; status) echo "Tabelle filter" iptables -L -vn echo "Tabelle nat" iptables -t nat -L -vn echo "Tabelle mangle" iptables -t mangle -L -vn ;; *) echo "Fehlerhafter Aufruf" echo "Syntax: $0 {start|stop|status}" exit 1 ;; esac -------Datei "interfaces"-------- # The primary network interface allow-hotplug eth2 iface eth2 inet static address 192.168.92.11 netmask 255.255.255.0 network 192.168.92.0 broadcast 192.168.92.255 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 127.0.0.1 dns-search doham.de auto eth2 allow-hotplug eth2:0 iface eth2:0 inet static address 192.168.68.11 netmask 255.255.255.0 network 192.168.68.0 broadcast 192.168.68.255 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 127.0.0.1 dns-search doham.de auto eth2:0 auto dsl-provider iface dsl-provider inet ppp pre-up /sbin/ifconfig eth2 up # line maintained by pppoeconf provider dsl-provider #!/bin/bash # --------------------------------------------------------------------- # Linux-iptables-Firewallskript, Copyright (c) 2007 under the GPL # Autogenerated by iptables Generator v1.22 (c) 2002-2007 by Harald Bertram # Please visit
http://harry.homelinux.org
for new versions of # the iptables Generator (c). # # This Script was generated by request from: # rc5.dresden(a)gmx.net on: 2007-10-25 22:16.50 MET. # # If you have questions about the iptables Generator or about # your Firewall-Skript feel free to take a look at out website or # send me an E-Mail to webmaster(a)harry.homelinux.org. # # My special thanks are going to Lutz Heinrich (trinitywork at hotmail dot com) # who made lots of Beta-Testing and gave me lots of well qualified # Feedback that made me able to improve the iptables Generator. # -------------------------------------------------------------------- case "$1" in start) echo "Starte IP-Paketfilter" # iptables-Modul modprobe ip_tables # Connection-Tracking-Module modprobe ip_conntrack # Das Modul ip_conntrack_irc ist erst bei Kerneln >= 2.4.19 verfuegbar modprobe ip_conntrack_irc modprobe ip_conntrack_ftp # Tabelle flushen iptables -F iptables -t nat -F iptables -t mangle -F iptables -X iptables -t nat -X iptables -t mangle -X # Default-Policies setzen iptables -P INPUT DROP iptables -P OUTPUT DROP iptables -P FORWARD DROP # MY_REJECT-Chain iptables -N MY_REJECT # MY_REJECT fuellen iptables -A MY_REJECT -p tcp -m limit --limit 7200/h -j LOG --log-prefix "REJECT TCP " iptables -A MY_REJECT -p tcp -j REJECT --reject-with tcp-reset iptables -A MY_REJECT -p udp -m limit --limit 7200/h -j LOG --log-prefix "REJECT UDP " iptables -A MY_REJECT -p udp -j REJECT --reject-with icmp-port-unreachable iptables -A MY_REJECT -p icmp -m limit --limit 7200/h -j LOG --log-prefix "DROP ICMP " iptables -A MY_REJECT -p icmp -j DROP iptables -A MY_REJECT -m limit --limit 7200/h -j LOG --log-prefix "REJECT OTHER " iptables -A MY_REJECT -j REJECT --reject-with icmp-proto-unreachable # MY_DROP-Chain iptables -N MY_DROP iptables -A MY_DROP -m limit --limit 7200/h -j LOG --log-prefix "PORTSCAN DROP " iptables -A MY_DROP -j DROP # Alle verworfenen Pakete protokollieren iptables -A INPUT -m state --state INVALID -m limit --limit 7200/h -j LOG --log-prefix "INPUT INVALID " iptables -A OUTPUT -m state --state INVALID -m limit --limit 7200/h -j LOG --log-prefix "OUTPUT INVALID " iptables -A FORWARD -m state --state INVALID -m limit --limit 7200/h -j LOG --log-prefix "FORWARD INVALID " # Korrupte Pakete zurueckweisen iptables -A INPUT -m state --state INVALID -j DROP iptables -A OUTPUT -m state --state INVALID -j DROP iptables -A FORWARD -m state --state INVALID -j DROP # Stealth Scans etc. DROPpen # Keine Flags gesetzt iptables -A INPUT -p tcp --tcp-flags ALL NONE -j MY_DROP iptables -A FORWARD -p tcp --tcp-flags ALL NONE -j MY_DROP # SYN und FIN gesetzt iptables -A INPUT -p tcp --tcp-flags SYN,FIN SYN,FIN -j MY_DROP iptables -A FORWARD -p tcp --tcp-flags SYN,FIN SYN,FIN -j MY_DROP # SYN und RST gleichzeitig gesetzt iptables -A INPUT -p tcp --tcp-flags SYN,RST SYN,RST -j MY_DROP iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN,RST -j MY_DROP # FIN und RST gleichzeitig gesetzt iptables -A INPUT -p tcp --tcp-flags FIN,RST FIN,RST -j MY_DROP iptables -A FORWARD -p tcp --tcp-flags FIN,RST FIN,RST -j MY_DROP # FIN ohne ACK iptables -A INPUT -p tcp --tcp-flags ACK,FIN FIN -j MY_DROP iptables -A FORWARD -p tcp --tcp-flags ACK,FIN FIN -j MY_DROP # PSH ohne ACK iptables -A INPUT -p tcp --tcp-flags ACK,PSH PSH -j MY_DROP iptables -A FORWARD -p tcp --tcp-flags ACK,PSH PSH -j MY_DROP # URG ohne ACK iptables -A INPUT -p tcp --tcp-flags ACK,URG URG -j MY_DROP iptables -A FORWARD -p tcp --tcp-flags ACK,URG URG -j MY_DROP # Loopback-Netzwerk-Kommunikation zulassen iptables -A INPUT -i lo -j ACCEPT iptables -A OUTPUT -o lo -j ACCEPT # Maximum Segment Size (MSS) für das Forwarding an PMTU anpassen iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu # Connection-Tracking aktivieren iptables -A OUTPUT -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT # iptables -A FORWARD -i ! ra0 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT iptables -A FORWARD -i ! ppp0 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # LAN-Zugriff auf die Netzwerkschnittstelle # iptables -A INPUT -m state --state NEW -i eth2 -j ACCEPT # HTTP # iptables -A INPUT -i eth2 -m state --state NEW -p tcp --dport 3128 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 3128 -j ACCEPT iptables -A PREROUTING -t nat -s 192.168.92.0/16 -p tcp --dport 80 -j REDIRECT --to-ports 3128 # HTTPS # iptables -A INPUT -i ra0 -m state --state NEW -p tcp --dport 443 -j ACCEPT # iptables -A INPUT -i eth2 -m state --state NEW -p tcp --dport 443 -j ACCEPT iptables -A POSTROUTING -t nat -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 443 -j MASQUERADE # SMTP # iptables -A INPUT -i eth2 -m state --state NEW -p tcp --dport 25 -j ACCEPT iptables -A POSTROUTING -t nat -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 25 -j MASQUERADE # SMTPS # iptables -A INPUT -i eth2 -m state --state NEW -p tcp --dport 465 -j ACCEPT iptables -A POSTROUTING -t nat -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 465 -j MASQUERADE # POP3 # iptables -A INPUT -i ra0 -m state --state NEW -p tcp --dport 110 -j ACCEPT # POP3S # iptables -A INPUT -i ra0 -m state --state NEW -p tcp --dport 995 -j ACCEPT # IMAP # iptables -A INPUT -i ra0 -m state --state NEW -p tcp --dport 143 -j ACCEPT # IMAPS # iptables -A INPUT -i ra0 -m state --state NEW -p tcp --dport 993 -j ACCEPT # iptables -A INPUT -i eth2 -m state --state NEW -p tcp --dport 993 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 993 -j ACCEPT iptables -A POSTROUTING -t nat -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 993 -j MASQUERADE # NNTP # iptables -A INPUT -i ra0 -m state --state NEW -p tcp --dport 119 -j ACCEPT # iptables -A INPUT -i eth2 -m state --state NEW -p tcp --dport 119 -j ACCEPT # DNS # iptables -A INPUT -i eth2 -m state --state NEW -p tcp --dport 53 -j ACCEPT # iptables -A INPUT -i eth2 -m state --state NEW -p udp --dport 53 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 53 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p udp --dport 53 -j ACCEPT # FTP #iptables -A INPUT -i eth2 -m state --state NEW -p tcp --dport 21 -j ACCEPT #iptables -A OUTPUT -o ra0 -m state --state NEW -p tcp --dport 21 -j ACCEPT #iptables -A INPUT -i eth2 -m state --state NEW -p tcp --dport 21 -j ACCEPT #iptables -A OUTPUT -o ra0 -m state --state NEW -p tcp --dport 21 -j ACCEPT # SMB/CIFS # iptables -A INPUT -i eth2 -m state --state NEW -p tcp --dport 137 -j ACCEPT # iptables -A INPUT -i eth2 -m state --state NEW -p tcp --dport 138 -j ACCEPT # iptables -A INPUT -i eth2 -m state --state NEW -p tcp --dport 139 -j ACCEPT # iptables -A INPUT -i eth2 -m state --state NEW -p tcp --dport 445 -j ACCEPT # iptables -A INPUT -i eth2 -m state --state NEW -p udp --dport 137 -j ACCEPT # iptables -A INPUT -i eth2 -m state --state NEW -p udp --dport 138 -j ACCEPT # iptables -A INPUT -i eth2 -m state --state NEW -p udp --dport 139 -j ACCEPT # iptables -A INPUT -i eth2 -m state --state NEW -p udp --dport 445 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 137 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 138 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 139 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p tcp --dport 445 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p udp --dport 137 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p udp --dport 138 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p udp --dport 139 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p udp --dport 445 -j ACCEPT # SSH # iptables -A INPUT -i ra0 -m state --state NEW -p tcp --dport 22 -j ACCEPT # iptables -A INPUT -i eth2 -m state --state NEW,ESTABLISHED,RELATED -p tcp --dport 22 -j ACCEPT # iptables -A OUTPUT -o eth2 -m state --state NEW,ESTABLISHED,RELATED -p tcp --dport 22 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW,ESTABLISHED,RELATED -p tcp --dport 22 -j ACCEPT iptables -A OUTPUT -d 192.168.92.0/16 -m state --state NEW,ESTABLISHED,RELATED -p tcp --dport 22 -j ACCEPT # DHCP # iptables -A INPUT -i eth2 -m state --state NEW -p udp --dport 67 -j ACCEPT # iptables -A OUTPUT -o eth2 -m state --state NEW -p udp --dport 67 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p udp --dport 67 -j ACCEPT iptables -A OUTPUT -d 192.168.92.0/16 -m state --state NEW -p udp --dport 67 -j ACCEPT # MYSQL # iptables -A INPUT -i ra0 -m state --state NEW -p tcp --dport 3306 -j ACCEPT # NTP # iptables -A INPUT -i ra0 -m state --state NEW -p udp --dport 123 -j ACCEPT # iptables -A INPUT -i eth2 -m state --state NEW -p udp --dport 123 -j ACCEPT iptables -A INPUT -s 192.168.92.0/16 -m state --state NEW -p udp --dport 123 -j ACCEPT # IRC # iptables -A INPUT -i ra0 -m state --state NEW -p tcp --dport 6667 -j ACCEPT # EDONKEY # iptables -A INPUT -i ra0 -m state --state NEW -p tcp --dport 4661 -j ACCEPT # iptables -A INPUT -i ra0 -m state --state NEW -p tcp --dport 4662 -j ACCEPT # iptables -A INPUT -i ra0 -m state --state NEW -p tcp --dport 4663 -j ACCEPT # iptables -A INPUT -i ra0 -m state --state NEW -p udp --dport 4665 -j ACCEPT # TELNET # iptables -A INPUT -i ra0 -m state --state NEW -p tcp --dport 23 -j ACCEPT # BZFLAG # iptables -A INPUT -i ra0 -m state --state NEW -p tcp --dport 5155 -j ACCEPT # iptables -A INPUT -i ra0 -m state --state NEW -p udp --dport 5155 -j ACCEPT # iptables -A INPUT -i ra0 -m state --state NEW -p tcp --dport 5156 -j ACCEPT # iptables -A INPUT -i ra0 -m state --state NEW -p udp --dport 5156 -j ACCEPT # HALF-LIFE # iptables -A INPUT -i ra0 -m state --state NEW -p tcp --dport 6000:6003 -j ACCEPT # iptables -A INPUT -i ra0 -m state --state NEW -p tcp --dport 7001:7002 -j ACCEPT # iptables -A INPUT -i ra0 -m state --state NEW -p udp --dport 27005 -j ACCEPT # iptables -A INPUT -i ra0 -m state --state NEW -p udp --dport 27010 -j ACCEPT # iptables -A INPUT -i ra0 -m state --state NEW -p udp --dport 27015:27016 -j ACCEPT # IPSEC # iptables -A INPUT -i ra0 -p 50 -j ACCEPT # iptables -A INPUT -i ra0 -p 51 -j ACCEPT # iptables -A INPUT -i ra0 -m state --state NEW -p udp --dport 500 -j ACCEPT # OPENVPN_V1 # iptables -A INPUT -i ra0 -m state --state NEW -p udp --dport 5000 -j ACCEPT # OPENVPN_V2 # iptables -A INPUT -i ra0 -m state --state NEW -p udp --dport 1194 -j ACCEPT # ICMP Echo-Request (ping) zulassen und beantworten iptables -A INPUT -m state --state NEW -p icmp --icmp-type echo-request -j ACCEPT # IP-Adresse des LAN-Interfaces ermitteln # LAN_IP=$(ifconfig eth2 | head -n 2 | tail -n 1 | cut -d: -f2 | cut -d" " -f 1) # NAT fuer HTTP # iptables -t nat -A PREROUTING -i ra0 -p tcp --dport 80 -j DNAT --to-destination # iptables -A FORWARD -i ra0 -m state --state NEW -p tcp -d --dport 80 -j ACCEPT # Default-Policies mit REJECT iptables -A INPUT -j MY_REJECT iptables -A OUTPUT -j MY_REJECT iptables -A FORWARD -j MY_REJECT # Forwarding/Routing echo "Aktiviere IP-Routing" echo 1 > /proc/sys/net/ipv4/ip_forward 2> /dev/null # Masquerading # iptables -t nat -A POSTROUTING -o ra0 -j MASQUERADE # iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE # SYN-Cookies echo 1 > /proc/sys/net/ipv4/tcp_syncookies 2> /dev/null # Stop Source-Routing for i in /proc/sys/net/ipv4/conf/*; do echo 0 > $i/accept_source_route 2> /dev/null; done # Stop Redirecting for i in /proc/sys/net/ipv4/conf/*; do echo 0 > $i/accept_redirects 2> /dev/null; done # Reverse-Path-Filter # Auskommentiert, da IPSEC mit RP_Filter nicht funktioniert! # for i in /proc/sys/net/ipv4/conf/*; do echo 2 > $i/rp_filter 2> /dev/null; done # Log Martians for i in /proc/sys/net/ipv4/conf/*; do echo 1 > $i/log_martians 2> /dev/null; done # BOOTP-Relaying ausschalten for i in /proc/sys/net/ipv4/conf/*; do echo 0 > $i/bootp_relay 2> /dev/null; done # Proxy-ARP ausschalten for i in /proc/sys/net/ipv4/conf/*; do echo 0 > $i/proxy_arp 2> /dev/null; done # Ungültige ICMP-Antworten ignorieren echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses 2> /dev/null # ICMP Echo-Broadcasts ignorieren echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts 2> /dev/null # Max. 500/Sekunde (5/Jiffie) senden echo 5 > /proc/sys/net/ipv4/icmp_ratelimit # Speicherallozierung und -timing für IP-De/-Fragmentierung echo 262144 > /proc/sys/net/ipv4/ipfrag_high_thresh echo 196608 > /proc/sys/net/ipv4/ipfrag_low_thresh echo 30 > /proc/sys/net/ipv4/ipfrag_time # TCP-FIN-Timeout zum Schutz vor DoS-Attacken setzen echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout # Maximal 3 Antworten auf ein TCP-SYN echo 3 > /proc/sys/net/ipv4/tcp_retries1 # TCP-Pakete maximal 15x wiederholen echo 15 > /proc/sys/net/ipv4/tcp_retries2 ;; stop) echo "Stoppe IP-Paketfilter" # Tabelle flushen iptables -F iptables -t nat -F iptables -t mangle -F iptables -X iptables -t nat -X iptables -t mangle -X echo "Deaktiviere IP-Routing" echo 0 > /proc/sys/net/ipv4/ip_forward # Default-Policies setzen iptables -P INPUT ACCEPT iptables -P OUTPUT ACCEPT iptables -P FORWARD ACCEPT ;; status) echo "Tabelle filter" iptables -L -vn echo "Tabelle nat" iptables -t nat -L -vn echo "Tabelle mangle" iptables -t mangle -L -vn ;; *) echo "Fehlerhafter Aufruf" echo "Syntax: $0 {start|stop|status}" exit 1 ;; esac
3
4
0
0
← Newer
1
2
3
Older →
Jump to page:
1
2
3
Results per page:
10
25
50
100
200