[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: iptables & ipsec - Schwääre Kost...?



Matthias Houdek wrote:
Interessanterweise ja. Allerdings dauert es ca. 2,5 Minuten bis das
"hostname login:" erscheint.

Da würde mich dann doch mal ein Sniffer-Mitschnitt interessieren. Das ist ja doch zu drollig.

Folgt bald.

Aber irgendwann werden wir uns sicher mit der Hand an die Stirn klatschen und sagen: "Klar, logisch - man sind wir blöd." ;-)

:)

Ich poste hier mal meine Configs, in der Hoffnung dass jemand das Problem
(ssh geht gar nicht, telnet login kommt erst nach 2,5 Minuten) nachvollziehen
und lösen kann:

IPsec-Setup-Howto
==================

Im Kernel das hier aktivieren:

Networking support (NET) [Y/n/?] y
  *
  * Networking options
  *
  PF_KEY sockets (NET_KEY) [Y/n/m/?] y
  IP: AH transformation (INET_AH) [Y/n/m/?] y
  IP: ESP transformation (INET_ESP) [Y/n/m/?] y
  IP: IPsec user configuration interface (XFRM_USER) [Y/n/m/?] y

Cryptographic API (CRYPTO) [Y/n/?] y
  HMAC support (CRYPTO_HMAC) [Y/n/?] y
  Null algorithms (CRYPTO_NULL) [Y/n/m/?] y
  MD5 digest algorithm (CRYPTO_MD5) [Y/n/m/?] y
  SHA1 digest algorithm (CRYPTO_SHA1) [Y/n/m/?] y
  DES and Triple DES EDE cipher algorithms (CRYPTO_DES) [Y/n/m/?] y
  AES cipher algorithms (CRYPTO_AES) [Y/n/m/?] y

==================

racoon installieren.

==================

root@skyron:/var/log# cat /etc/ipsec.conf
#!/usr/sbin/setkey -f

flush;
spdflush;

spdadd 192.168.1.0/24 192.168.1.0/24 any -P in  ipsec esp/transport//require;
spdadd 192.168.1.0/24 192.168.1.0/24 any -P out ipsec esp/transport//require;

root@skyron:/var/log# cat /etc/racoon/racoon.conf
path    certificate "/etc/racoon/certs";

listen {
        isakmp 192.168.1.1 [500];
}

remote anonymous {
        exchange_mode                   main;
        certificate_type                x509 "ipsec.crt" "ipsec.key";
        verify_cert                     on;
        my_identifier                   asn1dn;
        peers_identifier                asn1dn;

        proposal {
                authentication_method   rsasig;
                dh_group                modp1024;
                encryption_algorithm    3des;
                hash_algorithm          md5;
        }
}

sainfo anonymous {
        authentication_algorithm        hmac_md5,hmac_sha1;
        compression_algorithm           deflate;
        encryption_algorithm            3des;
        pfs_group                       modp1024;
}

================

Zertifikate erstellen und nach /etc/racoon/certs/ kopieren:
https://kilobyte.dyndns.info/howtos/index.html

================

Im gleichen Verzeichnis einen SymLink gegen das RootCA erstellen:
ln -s rootCA.crt `openssl x509 -noout -hash < rootCA.crt`.0

Fertig. Nach einem Neustart von Racoon und einem setkey -f /etc/ipsec.conf
sollte alles funktionieren, wäre da nicht die -->

FIREWALL:
================
root@skyron:/var/log# cat /root/bin/einfacheFirewall
#!/bin/sh

iptables -P INPUT DROP
iptables  -P OUTPUT DROP
iptables  -P FORWARD DROP

iptables -A INPUT -m state --state ESTABLISHED,RELATED,NEW -j ACCEPT
iptables  -A OUTPUT   -m state --state ESTABLISHED,RELATED,NEW -j ACCEPT
iptables  -A FORWARD   -m state --state ESTABLISHED,RELATED,NEW -j ACCEPT



=================

Mit dieser Firewall funtioniert es einwandfrei:
root@skyron:/var/log# cat /root/bin/einfacheFirewall
#!/bin/sh

iptables -P INPUT DROP
iptables  -P OUTPUT DROP
iptables  -P FORWARD DROP

iptables -A INPUT -m state --state ESTABLISHED,RELATED,NEW,INVALID -j ACCEPT
iptables  -A OUTPUT   -m state --state ESTABLISHED,RELATED,NEW,INVALID-j ACCEPT
iptables  -A FORWARD   -m state --state ESTABLISHED,RELATED,NEW, INVALID -j ACCEPT

--
Mit freundlichen Gruessen
Bjoern Schmidt



Reply to: