emule und directplay funktionieren nicht

angelfreund

lernwillig
Hallo zusammen,
ich habe die Tage einen DSL-Router mit OpenBSD4.1 aufgesetzt. Verwende in-kernel PPPoE. Funktioniert auch alles recht ordentlich.
Ich habe allerdings folgendes Problem bei welchem ich mittlerweile nicht mehr weiter weis und für etwas Hilfe dankbar wäre.
Ein Teilnehmer im LAN(sehr jung an Jahren und verwandt ;-) ) benötigt emule und directplay. Ich habe bisher folgende Konfigurationen vorgenommen:
(angelehnt an <http://wiki.bsdforen.de/howto/dsl-router#erweiterung_fuer_emule> )

/etc/emule.redirect
Code:
Ext = "rl0"                 # Device an dem das Internet angeschlossen ist
MuleIP = "192.168.1.15"     # IP Adresse des Emule Clients
IntNet = "192.168.1.11/20"  # Adressraum des internen Netzes

rdr on $Ext proto tcp from !$IntNet to any port 4661:4662 -> $MuleIP port 4661:4662
rdr on $Ext proto udp from !$IntNet to any port 4665 -> $MuleIP port 4665
rdr on $Ext proto udp from !$IntNet to any port 4672 -> $MuleIP port 4672
rdr on $Ext proto udp from !$IntNet to any port 8566 -> $MuleIP port 8566
rdr on $Ext proto tcp from !$IntNet to any port 4711 -> $MuleIP port 4711
rdr on $Ext proto tcp from !$IntNet to any port 8539 -> $MuleIP port 8539

/etc/emule.passin
Code:
Ext = "rl0"            # Device an dem das Internet angeschlossen ist
InMuleTCP = "{ 4661, 4662, 4711, 8539 }"
InMuleUDP = "{ 4665, 4672, 8566 }"

pass in quick on $Ext inet proto tcp from any to any port $InMuleTCP flags S/SAFR keep state label eMuleTCP
pass in quick on $Ext inet proto udp from any to any port $InMuleUDP keep state label eMuleUDP

/etc/directplay.redirect
Code:
Ext = "rl0"                  # Device an dem das Internet angeschlossen ist
GameIP = "192.168.1.15"      # IP Adresse des DirectPlay Clients
IntNet = "192.168.1.11/20"   # Adressraum des internen Netzes

rdr on $Ext proto tcp from !$IntNet to any port 2300:2400 -> $GameIP port 2300:*
rdr on $Ext proto tcp from !$IntNet to any port 47624 -> $GameIP port 47624
rdr on $Ext proto tcp from !$IntNet to any port 6073 -> $GameIP port 6073
rdr on $Ext proto udp from !$IntNet to any port 2300:2400 -> $GameIP port 2300:*
rdr on $Ext proto udp from !$IntNet to any port 9110 -> $GameIP port 9110

/etc/directplay.passin
Code:
Ext = "rl0"            # Device an dem das Internet angeschlossen ist
InDirectPlayTCP = "{ 2299><2401, 6073, 47624 }"
InDirectPlayUDP = "{ 2299><2401, 9110 }"

pass in quick on $Ext inet proto tcp from any to any port $InDirectPlayTCP flags S/SAFR keep state label DirectPlayTCP
pass in quick on $Ext inet proto udp from any to any port $InDirectPlayUDP keep state label DirectPlayUDP

/etc/pf.conf
Code:
#       $OpenBSD: pf.conf,v 1.34 2007/02/24 19:30:59 millert Exp $
#
# See pf.conf(5) and /usr/share/pf for syntax and examples.
# Remember to set net.inet.ip.forwarding=1 and/or net.inet6.ip6.forwarding=1
# in /etc/sysctl.conf if packets are to be forwarded between interfaces.

Ext = "rl0"
ext_if="rl0"
int_if="rl1"

InServicesTCP = "{ ssh, ftp, auth }"
#table <spamd-white> persist

set skip on lo

scrub in

#nat-anchor "ftp-proxy/*"
#rdr-anchor "ftp-proxy/*"

rdr-anchor "redirect/emule"
rdr-anchor "redirect/directplay"

#nat on $ext_if from !($ext_if) -> ($ext_if:0)

nat on pppoe inet proto { tcp, udp, icmp } from { 192.168.1.11/20 } to any -> (pppoe)

#rdr pass on $int_if proto tcp to port ftp -> 127.0.0.1 port 8021
#no rdr on $ext_if proto tcp from <spamd-white> to any port smtp
#rdr pass on $ext_if proto tcp from any to any port smtp \
#       -> 127.0.0.1 port spamd

#anchor "ftp-proxy/*"

anchor "passin/emule"
anchor "passin/directplay"

#block in
#pass out

#pass quick on $int_if no state
#antispoof quick for { lo $int_if }

#pass in on $ext_if proto tcp to ($ext_if) port ssh
#pass in log on $ext_if proto tcp to ($ext_if) port smtp
#pass out log on $ext_if proto tcp from ($ext_if) to port smtp

pass in all
pass out all
pass in quick on $Ext inet proto tcp from any to any port > 49151 user proxy flags S/SAFR keep state
pass in quick on $Ext inet proto icmp all icmp-type 8 code 0 keep state
pass in quick on $Ext inet proto tcp from any to any port $InServicesTCP flags S/SAFR keep state label ServicesTCP

Die Regeln wurden ohne Fehlermeldung geladen, beim booten treten ebenfalls keine Fehlermeldungen auf.
Wie gesagt, ich weis nicht was daran nun verkehrt sein soll. Vielleicht aber unvollständig...?? Die richtigen Ports sollten es eigentlich auch sein.
Leider gibt es hierzu sehr wenig Lektüre.

Wie gesagt, ich bin für Hilfe sehr dankbar.
Gruß
 
HI,


Haben sie mal geprüft ob die Rules auch geladen sind ?

pfctl -a "passin/emule" -sa

Ich vermisse in Ihrer Config das load von anchors command.
 
Hallo,

ich weis langsam echt nicht mehr weiter...
habe die pf.conf nochmal wie folgt überarbeitet:

Code:
Ext="rl0"                      # Device an dem das Internet angeschlossen ist
ext_if="rl0"                   # -"-
Int="rl1"                      # Device an dem das interne Netz haengt
int_if="xl0"                   # -"-
IntNet="192.168.1.11/20"       # Adressraum des internen Netzes
RouterIP="192.168.1.10"        # IP Adresse des Routers
Loop="lo0"                     # Loopback Device

# Ports die geoeffnet werden sollen
InServicesTCP = "{ ssh, ftp, auth }"

tcp_services="{ 22 }"
# udp_services="{   }"

### Tabellen: ###

### Optionen: ###

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

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

# Filtern auf dem Loopbackinterface unterbinden
set skip on lo

### Scrub/ Normalisierung: ###

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

### NAT:###

nat on pppoe inet proto { tcp, udp, icmp } from { 192.168.1.11/20 } to any -> (pppoe)

rdr-anchor "redirect/emule"

rdr-anchor "redirect/directplay"

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

# Generelle Block Regel
pass out keep state            # den eingehenden Verkehr filtern

# Loopback Device darf alles
pass quick on $Loop

# IPv6.0 unterbinden
block quick inet6

# diverse Anker

anchor emule
load anchor emule from "/etc/emule.passin"

anchor directplay
load anchor directplay from "/etc/directplay.passin"

# Schutz gegen gefälschte Adressen/ IP Spoofing verhindern
antispoof quick for { lo $int_if }

block in log quick on $Ext inet from <NoRoute> to any
block in log quick on $Ext inet from any to <NoRoute>

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

# Ports oeffnen, die von den Netzwerkdiensten genutzt werden,>
# die fuer das Internet verfuegbar sein sollen
pass in on $ext_if inet proto tcp from any to ($ext_if) \
    port $tcp_services flags S/SA keep state

# pass in on $ext_if inet proto udp from any to ($ext_if) \
#    port $udp_services flags S/SA keep state

block return log on $Ext

wie in der Antwort von bofh_hannibal angemerkt, habe ich die anchors mit "load"-command vesehen:
Code:
anchor emule
load anchor emule from "/etc/emule.passin"

anchor directplay
load anchor directplay from "/etc/directplay.passin"
Dasselbe wollte ich auch mit den redirect-Ankern machen:
Code:
rdr-anchor directplay
load rdr-anchor directplay from "/etc/directplay.redirect"

rdr-anchor emule
load rdr-anchor emule from "/etc/emule.redirect"

nur das leider da beim reboot ein syntax-Error angezeigt wurde.

also:

Code:
rdr-anchor "redirect/emule"

rdr-anchor "redirect/directplay"

und dann mit:
# pfctl -a "redirect/emule" -f /etc/emule.redirect
# pfctl -a "passin/emule" -f /etc/emule.passin
geladen.

Kannste voll vergessen!!! Nix emule oder gaming...

"# pfctl -a "passin/emule" -sa" sagt folgendes:
Code:
pfctl: DIOCGETRULES: Invalid argument
pfctl: DIOCGETRULES: Invalid argument
No queue in use
STATES:
all udp 84.179.209.36:41518 -> 85.10.195.19:123       MULTIPLE:MULTIPLE
all udp 84.179.209.36:35929 -> 217.7.239.199:123       MULTIPLE:MULTIPLE
all udp 84.179.209.36:1414 -> 213.239.205.46:123       MULTIPLE:MULTIPLE
all udp 84.179.209.36:20695 -> 194.97.156.5:123       MULTIPLE:MULTIPLE
all udp 84.179.209.36:29822 -> 85.214.73.35:123       MULTIPLE:MULTIPLE
all tcp 192.168.1.15:2472 -> 84.179.209.36:64863 -> 209.85.129.166:80       ESTA
BLISHED:ESTABLISHED
all tcp 192.168.1.15:2655 -> 84.179.209.36:57593 -> 209.85.135.104:80       ESTA
BLISHED:ESTABLISHED
all tcp 192.168.1.15:2668 -> 84.179.209.36:63100 -> 209.85.129.164:80       ESTA
BLISHED:ESTABLISHED
all tcp 192.168.1.15:2669 -> 84.179.209.36:55740 -> 209.85.129.164:80       ESTA
BLISHED:ESTABLISHED
all tcp 192.168.1.15:2704 -> 84.179.209.36:54218 -> 88.198.34.108:80       FIN_W
AIT_2:FIN_WAIT_2
all tcp 192.168.1.15:2705 -> 84.179.209.36:59181 -> 88.198.34.108:80       FIN_W
AIT_2:FIN_WAIT_2
all tcp 192.168.1.15:2706 -> 84.179.209.36:61878 -> 88.198.34.108:80       FIN_W
AIT_2:FIN_WAIT_2
all udp 217.237.149.225:53 -> 192.168.1.15:2708       SINGLE:NO_TRAFFIC
all tcp 192.168.1.15:2709 -> 84.179.209.36:50586 -> 88.198.7.213:80       FIN_WA
IT_2:FIN_WAIT_2
all udp 217.237.149.225:53 -> 192.168.1.15:2710       SINGLE:NO_TRAFFIC
all udp 192.168.1.11:32803 -> 84.179.209.36:50302 -> 217.237.149.225:53       MU
LTIPLE:SINGLE
all udp 217.237.149.225:53 -> 192.168.1.11:32803       SINGLE:NO_TRAFFIC
all tcp 192.168.1.15:2716 -> 84.179.209.36:53164 -> 62.241.53.16:4242       SYN_
SENT:CLOSED
all tcp 192.168.1.15:2717 -> 84.179.209.36:51090 -> 62.241.53.2:4242       SYN_S
ENT:CLOSED

INFO:
Status: Enabled for 0 days 00:51:06           Debug: Urgent

Interface Stats for rl0               IPv4             IPv6
  Bytes In                          278208                0
  Bytes Out                              0               64
  Packets In
    Passed                               0                0
    Blocked                            483                0
  Packets Out
    Passed                               0                1
    Blocked                              0                0

State Table                          Total             Rate
  current entries                       19
  searches                           80471           26.2/s
  inserts                             2034            0.7/s
  removals                            2015            0.7/s
Counters
  match                              41208           13.4/s
  bad-offset                             0            0.0/s
  fragment                               0            0.0/s
  short                                  0            0.0/s
  normalize                              0            0.0/s
  memory                                 0            0.0/s
  bad-timestamp                          0            0.0/s
  congestion                             0            0.0/s
  ip-option                              2            0.0/s
  proto-cksum                            0            0.0/s
  state-mismatch                         0            0.0/s
  state-insert                           0            0.0/s
  state-limit                            0            0.0/s
  src-limit                              0            0.0/s
  synproxy                               0            0.0/s
pfctl: DIOCGETRULES: Invalid argument

TIMEOUTS:
tcp.first                    30s
tcp.opening                   5s
tcp.established           18000s
tcp.closing                  60s
tcp.finwait                  30s
tcp.closed                   30s
tcp.tsdiff                   10s
udp.first                    60s
udp.single                   30s
udp.multiple                 60s
icmp.first                   20s
icmp.error                   10s
other.first                  60s
other.single                 30s
other.multiple               60s
frag                         30s
interval                     10s
adaptive.start             6000 states
adaptive.end              12000 states
src.track                     0s

LIMITS:
states        hard limit    10000
src-nodes     hard limit    10000
frags         hard limit     5000
tables        hard limit     1000
table-entries hard limit   100000
pfctl: Anchor or Ruleset does not exist.

OS FINGERPRINTS:
696 fingerprints loaded

Hat tatsächlich niemand eine Idee wo hier mein Fehler liegt?
Es gibt doch bestimmt Leute hier bei denen das funktioniert...
 
angelfreund:
ich sehe keinen Eintrag in dem jemand sowas behauptet. Es gibt nunmal Leute die schauen sich nur Threads an die Sie interessieren. Evtl. wissen manche einfach nicht was bei deinem Problem zu machen ist. Es ist normal, wenn ein Beitrag mal leer ausgeht. Bei mir war das auch schon öfters so.

Bei mir funktioniert das Daddeln und der eMule ohne Probleme. Wenn ich heute ausm Büro komme werde ich mal meine pf.conf anschauen. Allerdings habe ich alles in einer Datei, nicht aufgeteilt

Kann mir einer erklären was die ! vor den Variablenamen bedeuten? Finde ich im PF Manual auch nichts dazu. Nimm die doch einfach mal raus.

Versuch mal alles in eine Datei zu schreiben, dann kannst du dir erstmal die anchors und loads sparen.

PS: Informatik habe ich auch nicht studiert.
 
ok, also mir ist aufgefallen, dass du ein pass in all und ein pass out all da stehen hast. Ist halt nciht wirklich notwendig dann noch pass in regeln für die speziellen ports zu erstellen.

ich habe lediglich eine rdr regel für jeden port der geöffnet werden soll und eine pass regel für alle ports des jeweiligen progs.
 
Zurück
Oben