Jump to content

Double DNAT on the same network


Recommended Posts

By reading this case, some might say that I'm looking for troubles, and indeed they are right. However, I'm really interested knowing where the problem lies in this kind of configuration.

So here's my setup: a modem/router, a single network, and a bunch of computers sitting on this network. One of them (Machine A) is declared as being the DMZ, so all incoming connections are forwarded to this machine (DNAT).

| Computer A (DMZ)

Internet ----- Modem/LAN (| Computer B

| Computer C (torrent client)

What I'm trying to achieve is 'forwading' all torrent traffic from Computer A to Computer C.

Computer A is running linux, and these are the iptables rules i specified for this:

iptables -t nat -A PREROUTING -p tcp --dport 51413 -j DNAT --to <ip MACHINE C>

iptables -t nat -A POSTROUTING -p tcp --dport 51413 -j SNAT --to <ip MACHINE A>

iptables -A FORWARD -p tcp --dport 51413 -j ACCEPT

I made a simple test sending packets from the internet to my public ip on port 51413 and it works fine. Computer C can receive and send data.

µtorrent has been configured to listen on the port 51413. The simple test url http://www.utorrent.com/testport.php?port=51413 proudly reports "OK! Port 51413 is open and accepting connections.". Problem is, sometimes, µtorrent has a red icon saying connections are refused and when it does, downloading speed is indeed lower.

Perhaps I'm missing something, i don't know torrent protocol inner working so...


Link to comment
Share on other sites

Hey guys,

Something weird has happened with my utorrent.

Everytime i try to download something, it says, 'No connection could be made because the target machine actively refused it.'

How do i solve this problem.

email id- ayushverma5@gmail.com

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...