pf -> portweiterleitung...

hi,

nachdem ich jetzt alles mögliche ausprobiert habe, die foren-suche bemüht hab und es trotzdem nicht klappt, brauche ich jetzt hilfe von "aussen":

meine firewall-regeln sehen folgendermassen aus:


### VARIABLEN ###

Ext = "tun0" # Device an dem das Internet angeschlossen ist
Int = "rl0" # Device an dem das interne Netz haengt
IntNet = "10.0.1.0/24" # Adressraum des internen Netzes
RouterIP = "10.0.1.200" # IP Adresse des Routers
Loop = "lo0" # Loopback Device

# Adressen die auf dem externen Device nicht geroutet werden
# (Adressbereich des internen Netzes muss man wegen der Weiterleitungen zulassen)
NoRoute = "{ 127.0.0.1/8, 172.16.0.0/12, 10.0.0.0/8, 255.255.255.255/32 }"

# Ports die geoeffnet werden sollen
InServicesTCP = "{ ssh, hxd, hxdd, ard }"
#InServicesUDP = "{ hxd, hxdd, ard }"


### OPTIONS ###

# Macht Statistiken fuer die DSL-Verbindung (pfctl -s info)
set loginterface $Ext

# Beendet inaktive Verbindungen schneller - geringerer Speicherverbrauch.
set optimization aggressive

# Fragmentierte Pakete saeubern
scrub on $Ext all fragment reassemble random-id



### NAT & FORWARD ###

# NAT aktivieren (unter Linux als Masquerading bekannt)
nat on $Ext from $IntNet to any -> ($Ext)

# Active FTP - Umleitung zu unserem ftp-proxy
#rdr on $Int proto tcp from !$RouterIP to !$IntNet port 21 -> 127.0.0.1 port 8081

# Apple Remote Desktop Umleitung zu 10.0.1.2 (killamachine)
# rdr on $Ext proto TCP from any to any port 3283 -> 10.0.1.2 port 3283
rdr on $Ext proto udp from any to any port 3283 -> 10.0.1.2 port 3283

rdr-anchor redirect


### FILTER ###

# Zum Debuggen....
#pass quick all # Alles durchlassen

# Generelle Block Regel
block on $Ext

# Freiwillig machen wir keinen mucks ;)
block return log on $Ext

# Wir wollen kein IPv6.0
block quick inet6

# Loopback Device darf alles
pass on $Loop

# Erschwert scannen mit nmap und co.
block in log on $Ext inet proto tcp from any to any flags FUP/FUP
block in log on $Ext inet proto tcp from any to any flags SF/SFRA
block in log on $Ext inet proto tcp from any to any flags /SFRA

# IP Spoofing verhindern
block in log on $Ext inet from $NoRoute to any
block in log on $Ext inet from any to $NoRoute

# Active FTP erlauben
# pass in quick on $Ext inet proto tcp from any to any port > 49151 user proxy flags S/SAFR keep state

# Ping akzeptieren (ablehnen ist uebrigends wenig sinnvoll)
pass in on $Ext inet proto icmp all icmp-type 8 code 0 keep state

# Ports nach aussen oeffnen
pass in on $Ext inet proto tcp from any to any port $InServicesTCP flags S/SAFR keep state label ServicesTCP
pass in on $Ext inet proto udp from any to any port 3283

anchor passin

# Raus darf (fast) alles
pass out on $Ext keep state



prinzipiell funzt es auch, nur die portweiterleitung auf ard (apple remote desktop) 3283 klappt scheinbar nicht.

wenn man pfctl -s rules eingibt erhält man folgendes:

scrub on tun0 all random-id fragment reassemble
block drop on tun0 all
block return log on tun0 all
block drop quick inet6 all
pass on lo0 all
block drop in log on tun0 inet proto tcp all flags FPU/FPU
block drop in log on tun0 inet proto tcp all flags FS/FSRA
block drop in log on tun0 inet proto tcp all flags /FSRA
block drop in log on tun0 inet from 127.0.0.0/8 to any
block drop in log on tun0 inet from 172.16.0.0/12 to any
block drop in log on tun0 inet from 10.0.0.0/8 to any
block drop in log on tun0 inet from 255.255.255.255 to any
block drop in log on tun0 inet from any to 127.0.0.0/8
block drop in log on tun0 inet from any to 172.16.0.0/12
block drop in log on tun0 inet from any to 10.0.0.0/8
block drop in log on tun0 inet from any to 255.255.255.255
pass in on tun0 inet proto icmp all icmp-type echoreq code 0 keep state
pass in on tun0 inet proto tcp from any to any port = ssh flags S/FSRA keep state label "ServicesTCP"
pass in on tun0 inet proto tcp from any to any port = hxd flags S/FSRA keep state label "ServicesTCP"
pass in on tun0 inet proto tcp from any to any port = hxdd flags S/FSRA keep state label "ServicesTCP"
pass in on tun0 inet proto tcp from any to any port = ard flags S/FSRA keep state label "ServicesTCP"
pass in on tun0 inet proto udp from any to any port = ard
anchor passin all
pass out on tun0 all keep state

also nix mit der udp 3283 portweiterleitung, oder?

ard, hxd, hxdd sind in /etc/services definiert, sollte also auch gehen...

bitte um konstruktive hilfe... :D

merci

chris
 
Aktive redirect & nat Regeln kannst Du mit pfctl -sn (-s nat) sehen.
Interessant wäre es zu prüfen ob nicht noch mehr umgeleitet werden muss. Mit der Hilfe von tcpdump, kannst Du Dir anschauen was die Firewall blockt. Dafür musst Du bei deinem 'block' Eintrag noch 'log' hinzufügen.
Code:
tcpdump -i pflog0
 
Zuletzt bearbeitet:
nat regeln: evtl. ein prblem mit dem ard? lieber den port nehmen?

# pfctl -sn
nat on tun0 inet from 10.0.1.0/24 to any -> (tun0)
rdr on tun0 inet proto udp from any to any port = ard -> 10.0.1.2 port 3283
rdr-anchor redirect all
 
hm. tcpdump ergibt foolgendes:

15:26:56.922526 pD95902A8.dip.t-dialin.net.ard > killamachine.ard: udp 94
15:26:58.402428 pD95902A8.dip.t-dialin.net.ard > killamachine.ard: udp 94
15:27:01.730380 pD95902A8.dip.t-dialin.net.ard > killamachine.ard: udp 94
15:27:07.207047 pD95902A8.dip.t-dialin.net.ard > killamachine.ard: udp 94
15:27:12.281116 pD95902A8.dip.t-dialin.net.ard > killamachine.ard: udp 8
15:27:13.792220 pD95902A8.dip.t-dialin.net.ard > killamachine.ard: udp 8

dh. ard will auf udp 94 und 8 antworten...was natürlich nicht klappt...

das seltsame ist, dass laut apple nur eine portweiterleitung von 3283 vorhanden sein muss...

thnx a lot
 
bin langsam am verzweifeln. es funktioniert auch nicht mit einer portweiterleitung auf udp 94...

kann mir bitte jemand helfen...

danke...
 
das sagt apple:

Using Remote Desktop With Firewall and NAT Routers
If you wish to use the Apple Remote Desktop application from behind a NAT router, you will
need to set UDP port forwarding for port #3283 to your administration computer. If you
wish to access a client computer that is behind a NAT router, you will need to set the router
to forward UDP port #3283 to the client computer you wish to access.
Note:
You will be able to access only that client computer.

und genau so ist alles eingerichtet...
 
Ehm..

das 'udp 94' heisst nicht port 94, sondern das packet so gross ist :)
der port ist 'ard', nimm tcpdump -n. Zumindest mein /etc/services kennt
kein ard (say, welcher port das numerisch ist).

HTH,
 
Wie schon geschrieben.. tcpdump, mal in der folgenden Art:

tcpdump -nvvvi tun0 port 3283
tcpdump -envvvi pflog0
tcpdump -nvvvi rl0 port 3283

ciao
 
Zurück
Oben