Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi everyone,
I want to share big files via bitTorrent.
I've set up a tracker opentracker listening to port 6969, and a client kTorrent listening to port 6881. My network uses NAT. I create a torrent file, set the tracker as http://<external_ip>:6969/announce, the client tries to connect to it and shows "Could not connect to host localhost" message. If I use local ip (192.168.1.2) I can connect to the tracker, but other peers see my ip as 192.168.1.2.
If all clients are inside the same LAN they manage to share files this way. Port forwarding works fine, the tracker is reachable from outside.
I don't have a router that supports NAT loopback, but I'm looking for some workaround to do the same thing with software.
How to do it? I'm new to it so could you explain me step by step, which commands should I use?
I tried using these iptables rules but it doesn't work, other peers still see my ip as 192.168.1.2.
7.4.1. DMZs and iptables
iptables rules can be set to route traffic to certain machines, such as a dedicated HTTP or FTP server, in a demilitarized zone (DMZ) — a special local subnetwork dedicated to providing services on a public carrier such as the Internet. For example, to set a rule for routing incoming HTTP requests to a dedicated HTTP server at 10.0.4.2 (outside of the 192.168.1.0/24 range of the LAN), NAT calls a PREROUTING table to forward the packets to their proper destination:
With this command, all HTTP connections to port 80 from the outside of the LAN are routed to the HTTP server on a separate network from the rest of the internal network. This form of network segmentation can prove safer than allowing HTTP connections to a machine on the network. If the HTTP server is configured to accept secure connections, then port 443 must be forwarded as well.
I don't have a router with iptables. Port forwarding works fine, the tracker is reachable from outside. I can't connect to it from the client running on the same PC.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.