Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 02-12-2015, 02:49 AM   #1
LQ Newbie
Registered: Aug 2008
Distribution: CentOS
Posts: 8

Rep: Reputation: 0
Iptables Rules For Tor On Alternative Ports

I am trying to run Tor on ports 443 and 80 not on the standed 9001 and 9030. I have manager to work out that I need to use iptables to redirect the ports to ones Tor can use so as not to run it as root. Trouble is I cannot figure out why the rules I have are not working.

This is what I have added so far on the machine running Tor...

iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 9001
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 9030

I have also changed the torrc file settings to as follows...

ORPort 443 NoListen
ORPort NoAdvertise

DirPort 80 NoListen
DirPort NoAdvertise

Tor loads but it never but says the ports are not accecible from the outside. What am I doing wrong?
Old 02-14-2015, 05:53 PM   #2
LQ Newbie
Registered: Feb 2015
Posts: 6

Rep: Reputation: Disabled
did you try to telnet to the ip of your tor to check if port is open ?
you need a second pc to run check from.
IF tor has IP : then run on second pc cmd
telnet 443

if something is listeninig on port 443 you'll get a
Connected to
Escape character is '^]'.
Connection closed by foreign host.
if port is not setup (listening) it will show
then try on second port
telnet 80

I do not have tor, so this is general port troubleshooting
Old 02-16-2015, 02:29 AM   #3
LQ Newbie
Registered: Aug 2008
Distribution: CentOS
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks will give this a shot and see what I get.


iptables, relay, tor

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need an alternative to Tor CoolDude100 Linux - Newbie 3 10-15-2014 03:11 PM
tor listener ports mlmack Linux - Software 4 04-03-2012 07:55 PM
open ports for utorrent using iptables n close smpt to that ports shtorrent00 Linux - Networking 2 09-30-2008 03:34 PM
how? redirect apache2 outbound ports to specific ports w/iptables? nowshining Linux - Security 5 05-27-2008 02:46 AM
All UDP ports of my firewall are closed even without iptables rules, any clue? mfeoli Linux - Networking 2 01-05-2006 10:07 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:51 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration