ipf, ipnat and Bittorrent

Fabian Anklam greatnorthern at gmail.com
Wed Feb 16 21:08:15 GMT 2005


On Wed, 16 Feb 2005 13:04:28 -0000, Paul <paul at theharbour.eclipse.co.uk> wrote:
> I am trying to forward bittorrent ports on FreeBSD 5.3 with ipf and ipnat.
> But the bittorrent indicator stays yellow which means it isn't set up
> correctly.  Also, I don't get as many connections to peers as I should and
> download speeds are very poor.  My ipnat.rules and ipf.rules files are shown
> below:

Took some toying around for me as well to get it running. For
starters, Azureus is fine with one port only (set in Tools -> Options
-> Incoming TCP listen port) i use 50505.

>[...]
> 
> #bittorrent
> 
> rdr tun0 0/32 port 6881 -> 192.168.0.3 port 6881 tcp/udp
> 
> rdr tun0 0/32 port 6882 -> 192.168.0.3 port 6882 tcp/udp
> 
> rdr tun0 0/32 port 6883 -> 192.168.0.3 port 6883 tcp/udp
> 
> rdr tun0 0/32 port 6884 -> 192.168.0.3 port 6884 tcp/udp
> 
> rdr tun0 0/32 port 6885 -> 192.168.0.3 port 6885 tcp/udp
> 
> rdr tun0 0/32 port 6886 -> 192.168.0.3 port 6886 tcp/udp
> 
> rdr tun0 0/32 port 6887 -> 192.168.0.3 port 6887 tcp/udp
> 
> rdr tun0 0/32 port 6888 -> 192.168.0.3 port 6888 tcp/udp
> 
> rdr tun0 0/32 port 6889 -> 192.168.0.3 port 6889 tcp/udp
> 
> rdr tun0 0/32 port 6890 -> 192.168.0.3 port 6890 tcp/udp

The "Any IP on interface" for ipnat seems to be 0/0 instead of 0/32
and i am not sure if the tcp/udp keyword also works with ipnat. I use:

rdr xl0 0/0 port 50505 -> 192.168.0.11 port 50505 tcp
rdr xl0 0/0 port 50505 -> 192.168.0.11 port 50505 udp

and then in ipf.rules:

pass in quick on xl0 proto tcp from any to 192.168.0.11 port = 50505
flags S keep state
pass in quick on xl0 proto udp from any to 192.168.0.11 port = 50505 keep state

Regards


More information about the freebsd-questions mailing list