• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

[gelöst] SuSEfirewall2 Weiterleitung von OpenVPN

Hi,
ich versuche seit einiger Zeit VPN einzurichten. Leider bekomme ich nur lokal eine Verbingung zum VPN-Server. Von Extern bekomme ich den Tunnel nicht richtig zum Server geroutet.

Kann mir jemand erklären, wie ich die SuSEfirewall2 konfigurieren muss, damit ich den Tunnel auf meinen Server umgeleitet wird?

Der Aufbau des Netzes sieht folgendermaßen aus:

Gateway:
SuSE 11.4
SuSEfirewall, Proxy
IP: 192.168.11.111

OpenVPN-Server
192.168.11.112
Bridge tap0
proto tcp
Port 1194

Wär super, wenn mir jemand ne beispielconfig sagen könnte, damit ich diese testen kann.
Zur not kann ich auch logs bzw. configs gnau posten, jedoch würde ich gerne einfach eine config testen, die funktionieren sollte...
 

framp

Moderator
Teammitglied
Leide habe ich keine fertige Config. Sehr hilfreich ist immer
Code:
FW_LOG_DROP_ALL="yes"
in der SuSEfirewall config zu setzen, dann ein
Code:
tail -f /var/log/messages
aufzusetzen und einen Verbindungsaufbau zu starten. Dann sieht Du sehr genau welche Requests auf welchen Ports geblocked werden. Wenn Du diese dann hier postest bekommen wir sicherlich die Regeln hin ;)
 
Ok, also die Logs sehen folgendermaßen aus:

Code:
Apr 14 20:55:58 srv-z11 kernel: [ 7035.516296] SFW2-INext-DROP-DEFLT IN=eth1 OUT= MAC=00:50:56:82:00:0c:00:15:0c:bd:92:e6:08:00 SRC=89.210.167.236 DST=192.168.10.111 LEN=52 TOS=0x00 PREC=0x00 TTL=125 ID=174 DF PROTO=TCP SPT=62499 DPT=1194 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405AC0103030201010402)

Apr 14 20:56:24 srv-z11 kernel: [ 7061.535301] SFW2-INext-DROP-DEFLT IN=eth1 OUT= MAC=00:50:56:82:00:0c:00:15:0c:bd:92:e6:08:00 SRC=89.210.167.236 DST=192.168.10.111 LEN=52 TOS=0x00 PREC=0x00 TTL=125 ID=177 DF PROTO=TCP SPT=62500 DPT=1194 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405AC0103030201010402)

Apr 14 20:56:50 srv-z11 kernel: [ 7087.590564] SFW2-INext-DROP-DEFLT IN=eth1 OUT= MAC=00:50:56:82:00:0c:00:15:0c:bd:92:e6:08:00 SRC=89.210.167.236 DST=192.168.10.111 LEN=52 TOS=0x00 PREC=0x00 TTL=125 ID=182 DF PROTO=TCP SPT=62501 DPT=1194 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405AC0103030201010402)

Apr 14 20:56:59 srv-z11 kernel: [ 7096.650453] SFW2-INext-DROP-DEFLT IN=eth1 OUT= MAC=00:50:56:82:00:0c:00:15:0c:bd:92:e6:08:00 SRC=89.210.167.236 DST=192.168.10.111 LEN=52 TOS=0x00 PREC=0x00 TTL=125 ID=184 DF PROTO=TCP SPT=62501 DPT=1194 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405AC0103030201010402)

Apr 14 20:57:16 srv-z11 kernel: [ 7113.671597] SFW2-INext-DROP-DEFLT IN=eth1 OUT= MAC=00:50:56:82:00:0c:00:15:0c:bd:92:e6:08:00 SRC=89.210.167.236 DST=192.168.10.111 LEN=52 TOS=0x00 PREC=0x00 TTL=125 ID=185 DF PROTO=TCP SPT=62502 DPT=1194 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405AC0103030201010402)

Apr 14 20:57:42 srv-z11 kernel: [ 7139.687103] SFW2-INext-DROP-DEFLT IN=eth1 OUT= MAC=00:50:56:82:00:0c:00:15:0c:bd:92:e6:08:00 SRC=89.210.167.236 DST=192.168.10.111 LEN=52 TOS=0x00 PREC=0x00 TTL=125 ID=188 DF PROTO=TCP SPT=62503 DPT=1194 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405AC0103030201010402)

Apr 14 20:58:08 srv-z11 kernel: [ 7166.071863] SFW2-INext-DROP-DEFLT IN=eth1 OUT= MAC=00:50:56:82:00:0c:00:15:0c:bd:92:e6:08:00 SRC=89.210.167.236 DST=192.168.10.111 LEN=52 TOS=0x00 PREC=0x00 TTL=125 ID=192 DF PROTO=TCP SPT=62504 DPT=1194 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405AC0103030201010402)

Apr 14 20:58:17 srv-z11 kernel: [ 7175.133784] SFW2-INext-DROP-DEFLT IN=eth1 OUT= MAC=00:50:56:82:00:0c:00:15:0c:bd:92:e6:08:00 SRC=89.210.167.236 DST=192.168.10.111 LEN=52 TOS=0x00 PREC=0x00 TTL=125 ID=194 DF PROTO=TCP SPT=62504 DPT=1194 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405AC0103030201010402)
 

framp

Moderator
Teammitglied
kinyonga schrieb:
Code:
Apr 14 20:55:58 srv-z11 kernel: [ 7035.516296] SFW2-INext-DROP-DEFLT IN=eth1 OUT= MAC=00:50:56:82:00:0c:00:15:0c:bd:92:e6:08:00 SRC=89.210.167.236 DST=192.168.10.111 LEN=52 TOS=0x00 PREC=0x00 TTL=125 ID=174 DF PROTO=TCP SPT=62499 DPT=1194 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405AC0103030201010402)
Da siehst Du, dass auf eth1 jemand auf Port 1194 mit Protokoll tcp ankommen will - aber rejected wird. Da der Port nicht auf dem .111 sondern auf dem .112 offen ist must Du den Router sagen, dass alles vauf Port 1194 nach .112 redirected werden soll.
Code:
iptables -t nat -I PREROUTING -p tcp  -dport 1194 -j DNAT --to 192.168.10.112
Damit schaltest Du nat redirection an. Weiterhin fehlt das Enablen des Forwarding zu .112 mit
Code:
iptables -I FORWARD -p tcp -i eth1 -d 192.168.10.112 --dport 1194 -j ACCEPT
Gib das mal als root ein und probiere noch mal und beobachte das log.
 
Also ich hab jetzt doch die Config für FIrewall und VPN zusammengepackt:

DSL-Modem --> eth1 (129.168.10.0/24) --> FW, Proxy --> eth0 (129.168.11.0/24, LAN)

Firewall (https wird vom Gateway richtig behandelt):
Code:
FW_DEV_EXT="eth1"
FW_DEV_INT="eth0"
FW_DEV_DMZ=""
FW_ROUTE="yes"
FW_MASQUERADE="yes"
FW_MASQ_DEV="eth1"
FW_MASQ_NETS="0/0"
FW_NOMASQ_NETS=""
FW_PROTECT_FROM_INT="no"
FW_SERVICES_EXT_TCP="1194"
FW_SERVICES_EXT_UDP=""
FW_SERVICES_EXT_IP=""
FW_SERVICES_EXT_RPC=""
FW_CONFIGURATIONS_EXT=""
FW_SERVICES_DMZ_TCP=""
FW_SERVICES_DMZ_UDP=""
FW_SERVICES_DMZ_IP=""
FW_SERVICES_DMZ_RPC=""
FW_CONFIGURATIONS_DMZ=""
FW_SERVICES_INT_TCP=""
FW_SERVICES_INT_UDP=""
FW_SERVICES_INT_IP=""
FW_SERVICES_INT_RPC=""
FW_CONFIGURATIONS_INT=""
FW_SERVICES_DROP_EXT=""
FW_SERVICES_DROP_DMZ=""
FW_SERVICES_DROP_INT=""
FW_SERVICES_REJECT_EXT=""
FW_SERVICES_REJECT_DMZ=""
FW_SERVICES_REJECT_INT=""
FW_SERVICES_ACCEPT_EXT=""
FW_SERVICES_ACCEPT_DMZ=""
FW_SERVICES_ACCEPT_INT=""
FW_SERVICES_ACCEPT_RELATED_EXT=""
FW_SERVICES_ACCEPT_RELATED_DMZ=""
FW_SERVICES_ACCEPT_RELATED_INT=""
FW_TRUSTED_NETS=""
FW_FORWARD="192.168.11.111/24,0/0"
FW_FORWARD_REJECT=""
FW_FORWARD_DROP=""
FW_FORWARD_MASQ="0/0,192.168.11.107,tcp,443,443 0/0,192.168.11.112,tcp,1194,1194"
FW_REDIRECT=""
FW_LOG_DROP_CRIT="yes"
FW_LOG_DROP_ALL="yes"
FW_LOG_ACCEPT_CRIT="yes"
FW_LOG_ACCEPT_ALL="no"
FW_LOG_LIMIT=""
FW_LOG=""
FW_KERNEL_SECURITY=""
FW_STOP_KEEP_ROUTING_STATE=""
FW_ALLOW_PING_FW=""
FW_ALLOW_PING_DMZ=""
FW_ALLOW_PING_EXT=""
FW_ALLOW_FW_SOURCEQUENCH=""
FW_ALLOW_FW_BROADCAST_EXT="no"
FW_ALLOW_FW_BROADCAST_INT="no"
FW_ALLOW_FW_BROADCAST_DMZ="no"
FW_IGNORE_FW_BROADCAST_EXT="no"
FW_IGNORE_FW_BROADCAST_INT="no"
FW_IGNORE_FW_BROADCAST_DMZ="no"
FW_ALLOW_CLASS_ROUTING="yes"
FW_CUSTOMRULES=""
FW_REJECT=""
FW_REJECT_INT=""
FW_HTB_TUNE_DEV=""
FW_IPv6=""
FW_IPv6_REJECT_OUTGOING=""
FW_IPSEC_TRUST="no"
FW_ZONES=""
FW_ZONE_DEFAULT=""
FW_USE_IPTABLES_BATCH=""
FW_LOAD_MODULES="nf_conntrack_netbios_ns"
FW_FORWARD_ALWAYS_INOUT_DEV=""
FW_FORWARD_ALLOW_BRIDGING="yes"
FW_WRITE_STATUS=""
FW_RUNTIME_OVERRIDE=""
FW_LO_NOTRACK=""
FW_BOOT_FULL_INIT=""

Die Open VPN Config sollte nicht so wichtig sein, da ich mit dem Client lokal eine Verbindung zum CPN-Server aufbauen kann. Von extern kommend sieht der VPN-Server vom Client gar nichts --> Problem sollte die Firewall sein bzw. Portweiterleitung.
Die VPN Config des Clients hat auch die IP die auf mein Modem zeigt, kann also auch ausgeschlossen werden.

Open VPN
Code:
;local a.b.c.d
port 1194
proto tcp
;proto udp
dev tap
;dev tun
;dev-node MyTap
ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt
cert /etc/openvpn/easy-rsa/2.0/keys/server.crt
dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem
ifconfig-pool-persist ipp.txt
server-bridge 192.168.11.112 255.255.255.0 192.168.11.10 192.168.11.20
;server-bridge
push "route 192.168.11.0 255.255.255.0"
;push "route 192.168.20.0 255.255.255.0"
;client-config-dir ccd
;route 192.168.40.128 255.255.255.248
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
;learn-address ./script
;push "redirect-gateway def1 bypass-dhcp"
;push "dhcp-option DNS 208.67.222.222"
;push "dhcp-option DNS 208.67.220.220"
;client-to-client
;duplicate-cn
keepalive 10 120
comp-lzo
;max-clients 100
;user nobody
;group nobody
persist-key
persist-tun
status openvpn-status.log
;log         openvpn.log
;log-append  openvpn.log
verb 3
;mute 20

Bei der obigen Config bekomme ich trotzdem folgende Logs

Code:
Apr 14 22:26:14 srv-z11 kernel: [12448.585566] SFW2-FWDext-ACC-REVMASQ IN=eth1 OUT=eth0 SRC=89.210.167.236 DST=192.168.11.112 LEN=52 TOS=0x00 PREC=0x00 TTL=124 ID=309 DF PROTO=TCP SPT=62534 DPT=1194 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405AC0103030201010402)

Apr 14 22:26:21 srv-z11 kernel: [12454.817518] SFW2-FWDext-ACC-REVMASQ IN=eth1 OUT=eth0 SRC=89.210.167.236 DST=192.168.11.112 LEN=52 TOS=0x00 PREC=0x00 TTL=124 ID=310 DF PROTO=TCP SPT=62534 DPT=1194 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405AC0103030201010402)

Brauche ich unbedingt iptables? Bisher konnte ich alles über die Config der Firewall regeln. Die Firewall am VPN-Server ist übrigens aus. Ich verstehe auch nicht ganz warum sich die SPT immer ändert.
 

framp

Moderator
Teammitglied
kinyonga schrieb:
Bei der obigen Config bekomme ich trotzdem folgende Logs

Code:
Apr 14 22:26:14 srv-z11 kernel: [12448.585566] SFW2-FWDext-ACC-REVMASQ IN=eth1 OUT=eth0 SRC=89.210.167.236 DST=192.168.11.112 LEN=52 TOS=0x00 PREC=0x00 TTL=124 ID=309 DF PROTO=TCP SPT=62534 DPT=1194 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405AC0103030201010402)

Apr 14 22:26:21 srv-z11 kernel: [12454.817518] SFW2-FWDext-ACC-REVMASQ IN=eth1 OUT=eth0 SRC=89.210.167.236 DST=192.168.11.112 LEN=52 TOS=0x00 PREC=0x00 TTL=124 ID=310 DF PROTO=TCP SPT=62534 DPT=1194 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405AC0103030201010402)

Brauche ich unbedingt iptables? Bisher konnte ich alles über die Config der Firewall regeln. Die Firewall am VPN-Server ist übrigens aus. Ich verstehe auch nicht ganz warum sich die SPT immer ändert.
Die Konfig sieht soweit schon sehr gut aus. Du bekommst die Fehlermeldung immer noch weil Du die iptable Befehle nicht eingegeben hast bzw in der custom nicht eingetragen hast.

Zu
Brauche ich unbedingt iptables?
Nein, die meissten Fälle kann man auch mit der SusE FW Config abdecken. Diese generiert aber letzendlich auch nur iptable Rules entsprechend Deiner Konfiguration. Da ich mich mit den iptables Regeln und -befehlen auskenne kann ich Dir helfen die iptables Regeln zu finden und in die FW2 custom config einzutragen. Es kann sein dass das auch mit der simplen FW2 config möglich ist - aber ich denke es ist leichter step by step die fehlenden Regeln in die customconfig aufzunehmen.

Deshalb mein Vorschlag: Gib mal die beiden o.g. iptables Rules erst einmal zum Testen manuell per root ein (später landen die in der custom config) und teste den Zugriff erneut und beobachte das Log. So kommt man eigentlich ziemlich schnell zum Ergebnis ;-)

UPDATE: Habe eben noch
Code:
FW_FORWARD_MASQ="0/0,192.168.11.107,tcp,443,443 0/0,192.168.11.112,tcp,1194,1194"
gesehen - und das sollte eigentlich das allowen, was die o.g. 2 iptable Befehle allowen.
SFW2-FWDext-ACC-REVMASQ
... Das ist neu. Vorher stand da
SFW2-INext-DROP-DEFLT
Ich habe 11.4 bei mir nur unter einer VM am Laufen - ich muss mir mal den Code von der SuSEFW2 da ansehen wann diese Meldung erstellt wird ...
 
Wenn der VPN- Server nicht läuft, dann kann von aussen keine VPN- Verbindung aufgebaut werden. SPT = Source Port. Der Source Port ändert sich bei neuen Verbindungen immer.

Es wird von einem beliebigen Highport eine Verbindung aufgebaut. Das ist z.B. auch bei HTTP der Fall.
 

framp

Moderator
Teammitglied
Die Meldung kommt wenn Du criticial accepts auf yes hast (default). Mit
Code:
iptables -I FORWARD -p tcp -i eth0 -s 192.168.10.112 --sport 1194 -j ACCEPT
müßte der Logeintrag verschwinden.
Bekommst Du keine iptables DROP Messages mehr? Dann sollte es jetzt eigentlich funktionieren.
 
Die letzte iptables Einstellung brachte den Erfolg! Mit dem Bridge Interface habe ich zwar noch Probleme, da ich das LAN nicht sehe, aber eine Verbindung zum Openvpn Server funktioniert und die Pakete kommen richtig am Server an! Danke framp für die gute Hilfe.

Falls jemand ähnliche Probleme hat und dies Nachvollziehen will: die iptables Einstellungen hab ich wie von framp angegeben übernommen, mit der einzigen änderung, dass der IP-Adressbereich 192.168.11.0 ist.

Da ich mich mich nun noch einwenig über iptables schlau machen möchte hätte ich noch einige abschließende Fragen:

Wie arbeiten iptables und Firewall zusammen? Genauer gesagt:
Ändern iptables Einstellungen die der Firewall (selbst konnte ich nichts feststellen)?
Wer hat Priorität, wenn ich beispielsweise in der Firewall keine offenen Ports erlaube und per iptables Routen mache?

Gibt es für iptables eine Konfigurationsdatei?

Vielen Dank nochmals für die Hilfe!
 

framp

Moderator
Teammitglied
kinyonga schrieb:
...Da ich mich mich nun noch einwenig über iptables schlau machen möchte hätte ich noch einige abschließende Fragen:

Wie arbeiten iptables und Firewall zusammen? Genauer gesagt:
Die SuSEFirewall2 ist ein Script was anhand Deiner Konfigurationsdefinitionen in /etc/sysconfig/SuSEFirewall2 mit iptables Die Firewall aufsetzt und dabei alle Möglichkeiten von iptables benutzt. Man kann auch sagen, das SuSEFW Script ist ein iptables Befehlsgenerator und sichert damit Deinen Rechner.
Ändern iptables Einstellungen die der Firewall (selbst konnte ich nichts feststellen)?
Wie schon gesagt, die FW ist eine Sammlung von iptables Befehlen. Wenn Du weitere iptables befehle eingibst fügen die sich in der FW ein. Du musst dabei allerdings aufpassen, dass Du die iptables Regeln der SuSWFW nicht aushebelst oder andere Löcher öffnest. Ich würde Dir empfehlen, die SuSEFWConfig zu benutzen um die FW generell zu konfigurieren (Die SuSEFW macht da eine Menge ...). Und Deine 3 iptables Befehle einfach in die /etc/sysconfig/SuSEFirewall-custom reinschreiben. Dann erweiterst Du die SuSEFW mit Deinen 3 iptableBefehlen und öffnest damit noch die VPN Ports.
Wer hat Priorität, wenn ich beispielsweise in der Firewall keine offenen Ports erlaube und per iptables Routen mache?
Das hängt davon ab. Die Reihenfolge der iptable Regeln ist wichtig. Wenn der allow Befehl für einen Port vor dem reject Befehl kommt wird der request durchgelassen. Wenn es umgekehrt ist wird er geblocked. Deshalb benutzt Du auch -I (insert) und nicht -A (append), denn nur so kannst Du Ports, die von der SuSEFW geblocked werden, freigeben.
Gibt es für iptables eine Konfigurationsdatei?
Für die SuSEFW ist es /etc/sysconfig/SUSEFirewall2

Abschliessend noch ein Hinweis: Setzte das loggen von allen dropped Verbindungen wieder auf no. Ansonsten bekommst Du ziemlich grosse Logdateien. Ausserdem schlage ich vor, Du postest noch mal die iptables Regeln, die Du nun in die /etc/sysconfig/SuSEFirewall2-custom reingestellt hast und ich sehe noch mal nach ob sie so OK sind. Nur zur SIcherheit, denn wie gesagt - wenn Du was falsch machst kannst Du Löcher in Deiner FW öffnen :roll:
 
He, danke für die top Infos! Jetzt versteh ich langsam wie das ganze läuft. Allerdings sind iptables im Gegensatz zum Kofigurationsskript etwas undurchsichtig. Werde mich wohl in nächster Zeit mehr auf iptables konzentrieren um diese besser zu verstehen. Im laufenden System werde ich aber wie du gesagt hast wenn möglich mich an das Konfigurationsskript halten!

iptables liefert mir aktuell folgendes:
Code:
Chain INPUT (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere            ctstate ESTABLISHED
ACCEPT     icmp --  anywhere             anywhere            ctstate RELATED
input_int  all  --  anywhere             anywhere
input_ext  all  --  anywhere             anywhere
input_ext  all  --  anywhere             anywhere
LOG        all  --  anywhere             anywhere            limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-IN-ILL-TARGET '
DROP       all  --  anywhere             anywhere

Chain FORWARD (policy DROP)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             srv-z12.olymp.dom   tcp dpt:openvpn
ACCEPT     tcp  --  anywhere             srv-z12.olymp.dom   tcp dpt:openvpn
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:openvpn
TCPMSS     tcp  --  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
ACCEPT     all  --  anywhere             anywhere            PHYSDEV match --physdev-is-bridged
forward_int  all  --  anywhere             anywhere
forward_ext  all  --  anywhere             anywhere
LOG        all  --  anywhere             anywhere            limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-FWD-ILL-ROUTING '
DROP       all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere

Chain forward_ext (1 references)
target     prot opt source               destination
ACCEPT     icmp --  anywhere             anywhere            ctstate RELATED,ESTABLISHED icmp echo-reply
ACCEPT     icmp --  anywhere             anywhere            ctstate RELATED,ESTABLISHED icmp destination-unreachable
ACCEPT     icmp --  anywhere             anywhere            ctstate RELATED,ESTABLISHED icmp time-exceeded
ACCEPT     icmp --  anywhere             anywhere            ctstate RELATED,ESTABLISHED icmp parameter-problem
ACCEPT     icmp --  anywhere             anywhere            ctstate RELATED,ESTABLISHED icmp timestamp-reply
ACCEPT     icmp --  anywhere             anywhere            ctstate RELATED,ESTABLISHED icmp address-mask-reply
ACCEPT     icmp --  anywhere             anywhere            ctstate RELATED,ESTABLISHED icmp protocol-unreachable
ACCEPT     icmp --  anywhere             anywhere            ctstate RELATED,ESTABLISHED icmp redirect
ACCEPT     all  --  anywhere             anywhere
LOG        udp  --  192.168.11.0/24      anywhere            limit: avg 3/min burst 5 udp dpt:domain ctstate NEW LOG level warning tcp-options ip-options prefix `SFW2-FWDext-ACC-FORW '
ACCEPT     udp  --  192.168.11.0/24      anywhere            ctstate NEW,RELATED,ESTABLISHED udp dpt:domain
ACCEPT     udp  --  192.168.11.0/24      anywhere            ctstate RELATED,ESTABLISHED udp spt:domain
LOG        tcp  --  192.168.11.0/24      anywhere            limit: avg 3/min burst 5 tcp dpt:smtp ctstate NEW LOG level warning tcp-options ip-options prefix `SFW2-FWDext-ACC-FORW '
ACCEPT     tcp  --  192.168.11.0/24      anywhere            ctstate NEW,RELATED,ESTABLISHED tcp dpt:smtp
ACCEPT     tcp  --  192.168.11.0/24      anywhere            ctstate RELATED,ESTABLISHED tcp spt:smtp
LOG        tcp  --  192.168.11.0/24      anywhere            limit: avg 3/min burst 5 tcp dpt:pop3s ctstate NEW LOG level warning tcp-options ip-options prefix `SFW2-FWDext-ACC-FORW '
ACCEPT     tcp  --  192.168.11.0/24      anywhere            ctstate NEW,RELATED,ESTABLISHED tcp dpt:pop3s
ACCEPT     tcp  --  192.168.11.0/24      anywhere            ctstate RELATED,ESTABLISHED tcp spt:pop3s
LOG        tcp  --  192.168.11.0/24      anywhere            limit: avg 3/min burst 5 tcp dpt:imaps ctstate NEW LOG level warning tcp-options ip-options prefix `SFW2-FWDext-ACC-FORW '
ACCEPT     tcp  --  192.168.11.0/24      anywhere            ctstate NEW,RELATED,ESTABLISHED tcp dpt:imaps
ACCEPT     tcp  --  192.168.11.0/24      anywhere            ctstate RELATED,ESTABLISHED tcp spt:imaps
LOG        udp  --  192.168.11.0/24      anywhere            limit: avg 3/min burst 5 udp dpt:ntp ctstate NEW LOG level warning tcp-options ip-options prefix `SFW2-FWDext-ACC-FORW '
ACCEPT     udp  --  192.168.11.0/24      anywhere            ctstate NEW,RELATED,ESTABLISHED udp dpt:ntp
ACCEPT     udp  --  192.168.11.0/24      anywhere            ctstate RELATED,ESTABLISHED udp spt:ntp
ACCEPT     udp  --  anywhere             192.168.11.0/24     udp spt:domain ctstate RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             192.168.11.0/24     tcp spt:smtp ctstate RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             192.168.11.0/24     tcp spt:pop3s ctstate RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             192.168.11.0/24     tcp spt:imaps ctstate RELATED,ESTABLISHED
ACCEPT     udp  --  anywhere             192.168.11.0/24     udp spt:ntp ctstate RELATED,ESTABLISHED
LOG        tcp  --  anywhere             srv-z12.olymp.dom   limit: avg 3/min burst 5 tcp dpt:openvpn ctstate NEW LOG level warning tcp-options ip-options prefix `SFW2-FWDext-ACC-REVMASQ '
ACCEPT     tcp  --  anywhere             srv-z12.olymp.dom   tcp dpt:openvpn
ACCEPT     tcp  --  srv-z12.olymp.dom    anywhere            ctstate RELATED,ESTABLISHED
LOG        tcp  --  anywhere             srv-z07.olymp.dom   limit: avg 3/min burst 5 tcp dpt:https ctstate NEW LOG level warning tcp-options ip-options prefix `SFW2-FWDext-ACC-REVMASQ '
ACCEPT     tcp  --  anywhere             srv-z07.olymp.dom   tcp dpt:https
ACCEPT     tcp  --  srv-z07.olymp.dom    anywhere            ctstate RELATED,ESTABLISHED
LOG        all  --  anywhere             anywhere            limit: avg 3/min burst 5 PKTTYPE = multicast LOG level warning tcp-options ip-options prefix `SFW2-FWDext-DROP-DEFLT '
DROP       all  --  anywhere             anywhere            PKTTYPE = multicast
LOG        all  --  anywhere             anywhere            limit: avg 3/min burst 5 PKTTYPE = broadcast LOG level warning tcp-options ip-options prefix `SFW2-FWDext-DROP-DEFLT '
DROP       all  --  anywhere             anywhere            PKTTYPE = broadcast
LOG        all  --  anywhere             anywhere            limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-FWDext-DROP-DEFLT '
DROP       all  --  anywhere             anywhere

Chain forward_int (1 references)
target     prot opt source               destination
ACCEPT     icmp --  anywhere             anywhere            ctstate RELATED,ESTABLISHED icmp echo-reply
ACCEPT     icmp --  anywhere             anywhere            ctstate RELATED,ESTABLISHED icmp destination-unreachable
ACCEPT     icmp --  anywhere             anywhere            ctstate RELATED,ESTABLISHED icmp time-exceeded
ACCEPT     icmp --  anywhere             anywhere            ctstate RELATED,ESTABLISHED icmp parameter-problem
ACCEPT     icmp --  anywhere             anywhere            ctstate RELATED,ESTABLISHED icmp timestamp-reply
ACCEPT     icmp --  anywhere             anywhere            ctstate RELATED,ESTABLISHED icmp address-mask-reply
ACCEPT     icmp --  anywhere             anywhere            ctstate RELATED,ESTABLISHED icmp protocol-unreachable
ACCEPT     icmp --  anywhere             anywhere            ctstate RELATED,ESTABLISHED icmp redirect
ACCEPT     all  --  anywhere             anywhere
LOG        udp  --  192.168.11.0/24      anywhere            limit: avg 3/min burst 5 udp dpt:domain ctstate NEW LOG level warning tcp-options ip-options prefix `SFW2-FWDint-ACC-FORW '
ACCEPT     udp  --  192.168.11.0/24      anywhere            ctstate NEW,RELATED,ESTABLISHED udp dpt:domain
ACCEPT     udp  --  192.168.11.0/24      anywhere            ctstate RELATED,ESTABLISHED udp spt:domain
LOG        tcp  --  192.168.11.0/24      anywhere            limit: avg 3/min burst 5 tcp dpt:smtp ctstate NEW LOG level warning tcp-options ip-options prefix `SFW2-FWDint-ACC-FORW '
ACCEPT     tcp  --  192.168.11.0/24      anywhere            ctstate NEW,RELATED,ESTABLISHED tcp dpt:smtp
ACCEPT     tcp  --  192.168.11.0/24      anywhere            ctstate RELATED,ESTABLISHED tcp spt:smtp
LOG        tcp  --  192.168.11.0/24      anywhere            limit: avg 3/min burst 5 tcp dpt:pop3s ctstate NEW LOG level warning tcp-options ip-options prefix `SFW2-FWDint-ACC-FORW '
ACCEPT     tcp  --  192.168.11.0/24      anywhere            ctstate NEW,RELATED,ESTABLISHED tcp dpt:pop3s
ACCEPT     tcp  --  192.168.11.0/24      anywhere            ctstate RELATED,ESTABLISHED tcp spt:pop3s
LOG        tcp  --  192.168.11.0/24      anywhere            limit: avg 3/min burst 5 tcp dpt:imaps ctstate NEW LOG level warning tcp-options ip-options prefix `SFW2-FWDint-ACC-FORW '
ACCEPT     tcp  --  192.168.11.0/24      anywhere            ctstate NEW,RELATED,ESTABLISHED tcp dpt:imaps
ACCEPT     tcp  --  192.168.11.0/24      anywhere            ctstate RELATED,ESTABLISHED tcp spt:imaps
LOG        udp  --  192.168.11.0/24      anywhere            limit: avg 3/min burst 5 udp dpt:ntp ctstate NEW LOG level warning tcp-options ip-options prefix `SFW2-FWDint-ACC-FORW '
ACCEPT     udp  --  192.168.11.0/24      anywhere            ctstate NEW,RELATED,ESTABLISHED udp dpt:ntp
ACCEPT     udp  --  192.168.11.0/24      anywhere            ctstate RELATED,ESTABLISHED udp spt:ntp
ACCEPT     udp  --  192.168.11.0/24      anywhere            ctstate NEW,RELATED,ESTABLISHED udp dpt:domain
ACCEPT     tcp  --  192.168.11.0/24      anywhere            ctstate NEW,RELATED,ESTABLISHED tcp dpt:smtp
ACCEPT     tcp  --  192.168.11.0/24      anywhere            ctstate NEW,RELATED,ESTABLISHED tcp dpt:pop3s
ACCEPT     tcp  --  192.168.11.0/24      anywhere            ctstate NEW,RELATED,ESTABLISHED tcp dpt:imaps
ACCEPT     udp  --  192.168.11.0/24      anywhere            ctstate NEW,RELATED,ESTABLISHED udp dpt:ntp
LOG        tcp  --  anywhere             srv-z12.olymp.dom   limit: avg 3/min burst 5 tcp dpt:openvpn ctstate NEW LOG level warning tcp-options ip-options prefix `SFW2-FWDint-ACC-REVMASQ '
ACCEPT     tcp  --  anywhere             srv-z12.olymp.dom   tcp dpt:openvpn
ACCEPT     tcp  --  srv-z12.olymp.dom    anywhere            ctstate RELATED,ESTABLISHED
LOG        tcp  --  anywhere             srv-z07.olymp.dom   limit: avg 3/min burst 5 tcp dpt:20815 ctstate NEW LOG level warning tcp-options ip-options prefix `SFW2-FWDint-ACC-REVMASQ '
ACCEPT     tcp  --  anywhere             srv-z07.olymp.dom   tcp dpt:20815
ACCEPT     tcp  --  srv-z07.olymp.dom    anywhere            ctstate RELATED,ESTABLISHED
LOG        tcp  --  anywhere             192.168.11.106      limit: avg 3/min burst 5 tcp dpt:ssh ctstate NEW LOG level warning tcp-options ip-options prefix `SFW2-FWDint-ACC-REVMASQ '
ACCEPT     tcp  --  anywhere             192.168.11.106      tcp dpt:ssh
ACCEPT     tcp  --  192.168.11.106       anywhere            ctstate RELATED,ESTABLISHED
LOG        tcp  --  anywhere             srv-z14.olymp.dom   limit: avg 3/min burst 5 tcp dpt:ssh ctstate NEW LOG level warning tcp-options ip-options prefix `SFW2-FWDint-ACC-REVMASQ '
ACCEPT     tcp  --  anywhere             srv-z14.olymp.dom   tcp dpt:ssh
ACCEPT     tcp  --  srv-z14.olymp.dom    anywhere            ctstate RELATED,ESTABLISHED
LOG        tcp  --  anywhere             srv-z07.olymp.dom   limit: avg 3/min burst 5 tcp dpt:https ctstate NEW LOG level warning tcp-options ip-options prefix `SFW2-FWDint-ACC-REVMASQ '
ACCEPT     tcp  --  anywhere             srv-z07.olymp.dom   tcp dpt:https
ACCEPT     tcp  --  srv-z07.olymp.dom    anywhere            ctstate RELATED,ESTABLISHED
LOG        all  --  anywhere             anywhere            limit: avg 3/min burst 5 PKTTYPE = multicast LOG level warning tcp-options ip-options prefix `SFW2-FWDint-DROP-DEFLT '
DROP       all  --  anywhere             anywhere            PKTTYPE = multicast
LOG        all  --  anywhere             anywhere            limit: avg 3/min burst 5 PKTTYPE = broadcast LOG level warning tcp-options ip-options prefix `SFW2-FWDint-DROP-DEFLT '
DROP       all  --  anywhere             anywhere            PKTTYPE = broadcast
LOG        all  --  anywhere             anywhere            limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-FWDint-DROP-DEFLT '
reject_func  all  --  anywhere             anywhere

Chain input_ext (2 references)
target     prot opt source               destination
LOG        all  --  anywhere             anywhere            PKTTYPE = broadcast limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-DROP-BCASTe '
DROP       all  --  anywhere             anywhere            PKTTYPE = broadcast
ACCEPT     icmp --  anywhere             anywhere            icmp source-quench
ACCEPT     icmp --  anywhere             anywhere            icmp echo-request
LOG        tcp  --  anywhere             anywhere            limit: avg 3/min burst 5 tcp dpt:openvpn flags:FIN,SYN,RST,ACK/SYN LOG level warning tcp-options ip-options prefix `SFW2-INext-ACC-TCP '
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:openvpn
LOG        all  --  anywhere             anywhere            limit: avg 3/min burst 5 PKTTYPE = multicast LOG level warning tcp-options ip-options prefix `SFW2-INext-DROP-DEFLT '
DROP       all  --  anywhere             anywhere            PKTTYPE = multicast
LOG        all  --  anywhere             anywhere            limit: avg 3/min burst 5 PKTTYPE = broadcast LOG level warning tcp-options ip-options prefix `SFW2-INext-DROP-DEFLT '
DROP       all  --  anywhere             anywhere            PKTTYPE = broadcast
LOG        all  --  anywhere             anywhere            limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-INext-DROP-DEFLT '
DROP       all  --  anywhere             anywhere

Chain input_int (1 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere

Chain reject_func (1 references)
target     prot opt source               destination
REJECT     tcp  --  anywhere             anywhere            reject-with tcp-reset
REJECT     udp  --  anywhere             anywhere            reject-with icmp-port-unreachable
REJECT     all  --  anywhere             anywhere            reject-with icmp-proto-unreachable

Falls ich nicht nur im Inet nach Infos zu Firewall, Iptables, Proxy und Netzwerk suchen möchte.. gibt es empfehlenswerte Literatur?
 

framp

Moderator
Teammitglied
Das was Du erreichen willst sollte glaube ich auch nur mit der SuSE Config hinzubekommen sein. Poste mal die SuSEFWConfig und die SuSEFW-custom.
 
Erst mal Danke für die Links, gerade das Iptables Tut sieht recht gut aus!

Scheint bei den Firewalleinstellungen etwas nicht zu passen?? Bzw. Iptables..

SuSEfwconfig
Code:
FW_DEV_EXT="eth1"

FW_DEV_INT="eth0"

FW_DEV_DMZ=""

FW_ROUTE="yes"

FW_MASQUERADE="yes"

FW_MASQ_DEV="eth1"

FW_MASQ_NETS="192.168.11.111/24,0/0,udp,53 192.168.11.0/24,0/0,tcp,25 192.168.11.0/24,0/0,tcp,995 192.168.11.0/24,0/0,tcp,993 192.168.11.0/24,0/0,udp,123"

FW_NOMASQ_NETS=""

FW_PROTECT_FROM_INT="no"

FW_SERVICES_EXT_TCP="1194"

FW_SERVICES_EXT_UDP=""

FW_SERVICES_EXT_IP=""

FW_SERVICES_EXT_RPC=""

FW_CONFIGURATIONS_EXT=""

FW_SERVICES_DMZ_TCP=""

FW_SERVICES_DMZ_UDP=""

FW_SERVICES_DMZ_IP=""

FW_SERVICES_DMZ_RPC=""

FW_CONFIGURATIONS_DMZ=""

FW_SERVICES_INT_TCP=""

FW_SERVICES_INT_UDP=""

FW_SERVICES_INT_IP=""

FW_SERVICES_INT_RPC=""

FW_CONFIGURATIONS_INT="sshd"

FW_SERVICES_DROP_EXT=""

FW_SERVICES_DROP_DMZ=""

FW_SERVICES_DROP_INT=""

FW_SERVICES_REJECT_EXT=""

FW_SERVICES_REJECT_DMZ=""

FW_SERVICES_REJECT_INT=""

FW_SERVICES_ACCEPT_EXT=""

FW_SERVICES_ACCEPT_DMZ=""

FW_SERVICES_ACCEPT_INT=""

FW_SERVICES_ACCEPT_RELATED_EXT=""

FW_SERVICES_ACCEPT_RELATED_DMZ=""

FW_SERVICES_ACCEPT_RELATED_INT=""

FW_TRUSTED_NETS=""

FW_FORWARD="192.168.11.111/24,0/0,udp,53 192.168.11.0/24,0/0,tcp,25 192.168.11.0/24,0/0,tcp,995 192.168.11.0/24,0/0,tcp,993 192.168.11.0/24,0/0,udp,123"

FW_FORWARD_REJECT=""

FW_FORWARD_DROP=""

FW_FORWARD_MASQ="0/0,192.168.11.112,tcp,1194,1194 0/0,192.168.11.107,tcp,443,443"

FW_REDIRECT=""

FW_LOG_DROP_CRIT="yes"

FW_LOG_DROP_ALL="no"

FW_LOG_ACCEPT_CRIT="yes"

FW_LOG_ACCEPT_ALL="no"

FW_LOG_LIMIT=""

FW_LOG=""

FW_KERNEL_SECURITY=""

FW_STOP_KEEP_ROUTING_STATE=""

FW_ALLOW_PING_FW=""

FW_ALLOW_PING_DMZ=""

FW_ALLOW_PING_EXT=""

FW_ALLOW_FW_SOURCEQUENCH=""

FW_ALLOW_FW_BROADCAST_EXT="no"

FW_ALLOW_FW_BROADCAST_INT="no"

FW_ALLOW_FW_BROADCAST_DMZ="no"

FW_IGNORE_FW_BROADCAST_EXT="no"

FW_IGNORE_FW_BROADCAST_INT="no"

FW_IGNORE_FW_BROADCAST_DMZ="no"

FW_ALLOW_CLASS_ROUTING="yes"

FW_CUSTOMRULES=""

FW_REJECT=""

FW_REJECT_INT=""

FW_HTB_TUNE_DEV=""

FW_IPv6=""

FW_IPv6_REJECT_OUTGOING=""

FW_IPSEC_TRUST="no"

FW_ZONES=""

FW_ZONE_DEFAULT=""

FW_USE_IPTABLES_BATCH=""

FW_LOAD_MODULES="nf_conntrack_netbios_ns"

FW_FORWARD_ALWAYS_INOUT_DEV=""

FW_FORWARD_ALLOW_BRIDGING="yes"

FW_WRITE_STATUS=""

FW_RUNTIME_OVERRIDE=""

FW_LO_NOTRACK=""

FW_BOOT_FULL_INIT=""


SuSEfw-custom

Code:
fw_custom_after_chain_creation() {
    true
}

fw_custom_before_port_handling() {
    true
}

fw_custom_before_masq() { # could also be named "after_port_handling()"
    true
}

fw_custom_before_denyall() { # could also be named "after_forwardmasq()"
    true
}
 

framp

Moderator
Teammitglied
...FW_FORWARD_MASQ="0/0,192.168.11.112,tcp,1194,1194 0/0,192.168.11.107,tcp,443,443"...
Hm ... mir sieht es so aus als würde alles nur mit der SuSE Config funktionieren. Die iptables Befehle, die ich Dir genannt habe hast Du ja nicht in die CustomRules reingeschrieben. Das ist doch perfekt!
 

framp

Moderator
Teammitglied
kinyonga schrieb:
Dann scheint die Config soweit auch in Ordnung zu sein. Super!
Jupp. Du hast es zwar anders gemacht als ich vorgeschlagen habe - aber letztendlich hast Du meine Hinweise aufgenommen und es sogar ohne Config iptables konfiguriert. ;)

Setzt Du den Thread noch auf gelöst?
 
Oben