ipfw- und natd-Problem

From: Karsten Rothemund <karsten.rothemund(at)etechnik.uni-rostock.de>
Date: Thu, 17 Jan 2002 21:48:16 +0100

Hallo Liste,

ich habe hier folgende Situation:

Linux-Rechner ---- FreeBSD-Rechner ---- Modem ---- ISP
 192.168.1.1 192.168.1.100

Vom ISP kommt eine dyn IP. Deshalb muss(?) ich wohl natd einsetzen.
Die relevanten Stellen im /etc/rc.conf:

# -- Firewall mit ipfw -- #
firewall_enable="YES"
firewall_type="/etc/ipfw.rules"
# -- Rechner arbeitet als Gateway -- #
gateway_enable="YES"
# -- NATD nicht vergessen -- #
natd_enable="YES"
natd_program="/sbin/natd"
natd_interface="tun0"
natd_flags="-f /etc/natd.conf"

und in /etc/natd.conf:

dynamic yes
use_sockets yes
same_ports yes

Ich habe versucht die Firewallregeln statefull zu machen (aus diversen
HowTos versucht zusammengebastelt): /etc/ipfw.rules:

# Loopback-Device (damit auch noch nach einem Reload der Regeln da)
add 100 pass all from any to any via lo0
add 200 deny all from any to 127.0.0.0/8
add 300 deny ip from 127.0.0.0/8 to any
# ping
add 1000 deny icmp from any to 192.168.1.0/24 in via tun0 icmptypes 8
add 1010 check-state
add 1020 allow icmp from 192.168.1.0/24 to any out via tun0 icmptypes
8 keep-state
add 1030 allow icmp from 192.168.1.0/24 to 192.168.1.0/24
add 1040 deny log icmp from any to any
#
# ssh, ftp, smtp und dns
add 2000 allow tcp from any to any established
add 3000 allow tcp from any to 192.168.1.0/24 ftp,ssh,smtp setup
#add 3010 allow tcp from 192.168.1.0/24 ftp,ssh,smtp to any setup
add 4000 allow udp from 192.168.1.0/24 to any domain
add 4100 allow udp from any domain to 192.168.1.0/24
#
# default: alles dicht!
add 65000 deny log all from any to any

Nachdem ich die Modemverbindung aufgebaut habe, habe ich vom
Linux-Rechner aus ein Ping und ein slogin auf einen externen Rechner
versucht. Beides schlug fehl. Ein ipfw show zeigt folgendes:

00100 0 0 allow ip from any to any via lo0
00200 0 0 deny ip from any to 127.0.0.0/8
00300 0 0 deny ip from 127.0.0.0/8 to any
00500 1 78 divert 8668 ip from any to any via tun0
01000 0 0 deny icmp from any to 192.168.1.0/24 in recv tun0 icmptype 8
01010 0 0 check-state
01020 0 0 allow icmp from 192.168.1.0/24 to any keep-state out xmit
tun0 icmptype 8
01030 0 0 allow icmp from 192.168.1.0/24 to 192.168.1.0/24
01040 4 336 deny log logamount 10 icmp from any to any
02000 0 0 allow tcp from any to any established
03000 0 0 allow tcp from any to 192.168.1.0/24 21,22,25 setup
03010 0 0 allow tcp from 192.168.1.0/24 21,22,25 to any setup
04000 1 78 allow udp from 192.168.1.0/24 to any 53
04100 0 0 allow udp from any 53 to 192.168.1.0/24
65000 1 78 deny log logamount 10 ip from any to any
65535 0 0 allow ip from any to any

Offensichtlich sind die Regeln zu restriktiv (lasse ich 65000 weg,
gehts - natuerlich, default is offen). Koennt ihr mir einen Tipp
geben, wo.

Dankbar fuer jede Hilfe,

-- 
ciao,
        Karsten 
Karsten Rothemund, mailto:karsten.rothemund(at)etechnik.uni-rostock.de,
http://www.e-technik1.uni-rostock.de/ae/home/karo/
PGP-Key: finger kr123(at)cks1.uni-rostock.de  (Please use it!)
-------------------------------------------------------------------------------
This mail address must not be used for advertising or offers of any kind. 
This address must not be included in mailing lists without my permission. 
Contraventions will be charged by a fee of 5000 US $.

To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Thu 17 Jan 2002 - 21:51:50 CET

search this site