User login

Poll

Window manager/desktop favorit?
KDE
10%
Gnome
45%
XFCE
30%
Enlightenment
0%
Blackbox, Fluxbox
15%
Windowmaker
0%
Altceva
0%
Total votes: 20

Partners

[banner]

[banner]

[banner]

DC++ redirectare port

Am pf pe un server (firewall cu nat si blocare de porturi).

Am un calculator secundar de lucru cu windows. IP 192.168.0.10

vreau sa folosesc strong dc++ in mod activ pe acest calculator.
am pus in strong conectare prin tcp 4444 si udp 5555 dar nu stiu cum sa scriu regula in PF pt redirectare port.

serverul face NAT pt reteaua interna catre exterior.

DC++ redirectare port

ext_if  = "fxp0"   # interfata externa (vezi ifconfig -a)

#Porturi StrongDC
rdr on $ext_if proto tcp from any to $ext_if port 4444 -> 192.168.0.10 port 4444
rdr on $ext_if proto udp from any to $ext_if port 5555 -> 192.168.0.10 port 5555

Dupa ce ai editat fisierul, tasteaza:

pfctl -F all
pfctl -f /etc/pf.conf

Deschide porturile si in Windows firewall daca folosesti XP cu Service Pack 2.

DC++ redirectare port

rdr on $ext_if inet proto {tcp,udp} from any to any port 9176 -> 192.168.0.10 port 9176
nat on $ext_if from $internal_net to any -> ($ext_if)

############
# LAN SIDE #
############
block on $int_if inet proto udp from any to any port {137,138,139}
pass in log on $int_if proto {tcp,udp} from $internal_net to any
pass out log on $int_if proto {tcp,udp} from $ext_if to $internal_net

deci nu merge nici sa il tai. Pe masina windows am scos preventiv zone alarm.
In windows arata la netstat -na ca porturile tcp/udp 9176 sunt LISTEN MODE.

tcpdump pe interfata interna nu arata NICI UN FEL de comunicatie pe 9176! Arata cele uzuale pt dc++:411

DC++ redirectare port

Vezi daca circula pachetele pe porturile redirectionate :

pfctl -s all -vv | less

Scrie asa:

rdr on $ext_if inet proto {tcp udp} from any to $ext_if port 9176 -> 192.168.0.10 port 9176

DC++ redirectare port

@0 rdr on rl1 inet proto tcp from any to any port = 9176 -> 192.168.0.10 port 9176
[ Evaluations: 943727 Packets: 0 Bytes: 0 States: 0 ]
@1 rdr on rl1 inet proto udp from any to any port = 9176 -> 192.168.0.10 port 9176
[ Evaluations: 39318 Packets: 0 Bytes: 0 States: 0 ]

Din pacate nu, si nu inteleg de ce.

Nici o regula nu blocheaza acest port 9176.

La $ext_if am:
pass in on $ext_if proto {tcp, udp} from any to $ext_if port 9176

Deci nu vad vreo problema!

Iar ODC sau STRONG l-am pus pe manual 9176. Am incercat toate combinatiile posibile.

DC++ redirectare port

StrongDC:
Selecteaza din Connections Settings => Firewall with manual port forwarding.
In campul External/WAN IP pune adresa rutabila de la ISP, la TCP: 4444 si la UDP: 5555

Inchide ZoneAlarm sau orice firewall din windows.

Daca nu merge ataseaza pf.conf si ma uit la el.

DC++ redirectare port

admin wrote:
StrongDC:
Selecteaza din Connections Settings => Firewall with manual port forwarding.
In campul External/WAN IP pune adresa rutabila de la ISP, la TCP: 4444 si la UDP: 5555

Inchide ZoneAlarm sau orice firewall din windows.

Daca nu merge ataseaza pf.conf si ma uit la el.

@0 rdr on rl1 inet proto tcp from any to any port = 9176 -> 192.168.0.10 port 9176
[ Evaluations: 1319799 Packets: 0 Bytes: 0 States: 0 ]
@1 rdr on rl1 inet proto udp from any to any port = 9176 -> 192.168.0.10 port 9176
[ Evaluations: 79157 Packets: 0 Bytes: 0 States: 0 ]

Am evaluari totusi dar trafic nema.

hai sa iti dau si pf.conf

ext_if="rl1"
int_if="rl0"
internal_net="192.168.0.0/24"

set timeout { icmp.first 20, icmp.error 10 }
set optimization normal
set block-policy drop
set state-policy if-bound

scrub in all

rdr on $ext_if inet proto {tcp,udp} from any to any port 9176 -> 192.168.0.10 port 9176
nat on $ext_if from $internal_net to any -> ($ext_if)

#LO0
pass quick on lo0 all

############
# LAN SIDE #
############
block on $int_if inet proto udp from any to any port {137,138,139}
pass in log on $int_if proto {tcp,udp} from $internal_net to any
pass out log on $int_if proto {tcp,udp} from $ext_if to $internal_net

#################
# INTERNET SIDE #
#################
block in on $ext_if all
block in on $ext_if inet proto udp from any to any
block in on $ext_if inet proto tcp from any to $ext_if port {445,1433,139,135}
block in on $ext_if inet from any to 255.255.255.255
block in on $ext_if inet from any to 0.0.0.0

pass in on $ext_if inet proto icmp from any to $ext_if icmp-type echorep
block out on $ext_if inet proto icmp from any to any icmp-type {echorep, unreach, timex}

pass in on $ext_if inet proto tcp from any port {21,22,25,53,67,68,80,110,443,465,995,5050,>49152} to $ext_if
pass in on $ext_if proto udp from any port {53,67,68} to $ext_if

#DC++
pass in on $ext_if proto tcp from any port {411, 4111, 412} to $ext_if
pass in on $ext_if proto {tcp, udp} from any to $ext_if port 9176

#FTP, XORG
pass in on $ext_if proto tcp from any to $ext_if port {21,6000}
pass in on $ext_if proto tcp from any to $ext_if port >49152

#SSH
pass in on $int_if proto tcp from 192.168.0.10 to $int_if port 666


Am folosit ODC si nu are decat un port: acelasi si la tcp si la udp. Am pus 9176.

La toate testele am scos preventiv zone alarm iar windowsul nu are activat vreun alt filtru (gen internet fw)

DC++ redirectare port

Problema vine de la urmatoarele linii:

block in on $ext_if all
block in on $ext_if inet proto udp from any to any

Incearca sa le dezactivezi fa un test si vezi daca circula pachetele.
Trebuie sa descarci macar un file list de pe DC.

DC++ redirectare port

admin wrote:
Problema vine de la urmatoarele linii:

block in on $ext_if all
block in on $ext_if inet proto udp from any to any

Incearca sa le dezactivezi fa un test si vezi daca circula pachetele.
Trebuie sa descarci macar un file list de pe DC.

Era de la udp. Tnx man! Dau o bere cu prima ocazie. Oricum am rescris toate regulile ca am refacut topologia retelei.