natd mit ipfw

From: Michael Gusek <michael.gusek(at)web.de>
Date: Thu, 14 Aug 2003 21:35:18 +0200

Hi !

Ich hab hier was merkwürdiges. Ich hab einen DSL-Router mit 5.1 aufgesetzt. Ich benutze zur
Einwahl user-ppp ohne weitere filter, den natd und ipfw als firewall. das ganze funzt aber nicht so ganz gut. Ich kann von meinem Netzwerk aus, Rechner im Internet anpingen, mit ip-adresse oder damainnamen. Wenn ich allerdings ssh, www oder was anderes machen moechte, scheinen
die Pakete nicht zurueckzukommen. Ich hab das mal geloggt, und eine ftp-session auf ftp.fu-berlin.de sieht dann so aus:
ipfw: 1100 Divert 8668 TCP 192.168.0.3:1164 130.133.1.100:21 out via tun0
ipfw: 1100 Divert 8668 TCP 130.133.1.100:21 217.231.195.206:1164 in via tun0
ipfw: 1100 Divert 8668 TCP 192.168.0.3:1164 130.133.1.100:21 out via tun0
ipfw: 1100 Divert 8668 TCP 130.133.1.100:21 217.231.195.206:1164 in via tun0
ipfw: 1100 Divert 8668 TCP 192.168.0.3:1164 130.133.1.100:21 out via tun0
ipfw: 1100 Divert 8668 TCP 130.133.1.100:21 217.231.195.206:1164 in via tun0

als laie interpretier ich das so, das die pakete rausgehen und die antwortpakete auch bei dem router auflaufen, allerdings landen sie nicht bei dem Rechner im LAN.

Hier teile meiner meine rc.conf:
firewall_enable="YES"

natd_program="/sbin/natd"
natd_enable="YES"
natd_interface="tun0"
natd_flags="-dynamic"

meine kernelconfig sieht so aus:
<snipp>
options IPFIREWALL
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIMIT=100
options IPDIVERT

options NETGRAPH
options NETGRAPH_ETHER
options NETGRAPH_SOCKET
options NETGRAPH_PPPOE
</snipp>

und zu guter letzt das ipfw-ruleset, welches auf einem ruleset von bernd basiert, was er mal veroeffentlicht hatte:
00100 0 0 deny log ip from 192.168.0.0/24 to any in via tun0
00200 0 0 deny log ip from any to 192.168.0.0/24 in via tun0
00300 0 0 deny log ip from me to any in via tun0
00400 17538 10587331 allow ip from 192.168.0.0/24 to 192.168.0.0/24
00500 0 0 allow ip from 127.0.0.1 to 127.0.0.1
00600 1 328 allow ip from any to 255.255.255.255 via xl*
00700 0 0 allow ip from 255.255.255.255 to any via xl*
00800 0 0 check-state
00900 0 0 reset tcp from any to me dst-port 113
01000 1971 543301 allow ip from me to any keep-state
01100 79 5950 divert 8668 log ip from any to any via tun0
01200 1 1492 deny log icmp from any to any in via tun0 icmptypes 8
01300 25 1500 allow icmp from any to any out via tun0 icmptypes 8
01400 20 1200 allow icmp from any to any in via tun0 icmptypes 0
01500 0 0 allow icmp from any to any via tun0 icmptypes 11
01600 1 56 allow icmp from any to any via tun0 icmptypes 3
01700 0 0 allow log icmp from any to any via tun0
01800 49 2940 allow icmp from any to any
01900 15 720 allow ip from 192.168.0.0/24 to any
02000 16 792 allow ip from me to any
02100 47 2914 deny log ip from any to any
65535 63 4554 deny ip from any to any

ich bin mir sicher, irgendwo ist der wurm drin, aber wo ? Bin fuer jede Hilfe dankbar !

Micha
__________________________________________________________________________
Die sicherste Form der Kommunikation: E-Mails verschluesseln, Spam-Filter,
Adressverifizierung, digitale Unterschrift: http://freemail.web.de

To Unsubscribe: send mail to majordomo.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Thu 14 Aug 2003 - 21:36:06 CEST

search this site