Find the answer to your Linux question:
Results 1 to 4 of 4
Hey guys iv set up my iptables like so: Code: *nat :PREROUTING ACCEPT [0:0] :INPUT ACCEPT [0:0] :OUTPUT ACCEPT [0:0] :POSTROUTING ACCEPT [0:0] -N REDSOCKS -A REDSOCKS -d 0.0.0.0/8 -j ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2013
    Posts
    2

    Question IpTables, Redsocks and SSH, Need help!


    Hey guys iv set up my iptables like so:
    Code:
    *nat
    :PREROUTING ACCEPT [0:0]
    :INPUT ACCEPT [0:0]
    :OUTPUT ACCEPT [0:0]
    :POSTROUTING ACCEPT [0:0]
    -N REDSOCKS
    -A REDSOCKS -d 0.0.0.0/8 -j RETURN
    -A REDSOCKS -d 10.0.0.0/8 -j RETURN
    -A REDSOCKS -d 127.0.0.0/8 -j RETURN
    -A REDSOCKS -d 169.254.0.0/16 -j RETURN
    -A REDSOCKS -d 172.16.0.0/12 -j RETURN
    -A REDSOCKS -d 192.168.0.0/16 -j RETURN
    -A REDSOCKS -d 224.0.0.0/4 -j RETURN
    -A REDSOCKS -d 240.0.0.0/4 -j RETURN
    
    -A REDSOCKS -p tcp -o eth0 -j DNAT --to 127.0.0.1:1081
    
    -A OUTPUT -p tcp -j REDSOCKS
    
    COMMIT
    And this is my redsocks config:

    Code:
    base{log_debug = on; log_info = on; log = "file:/tmp/reddi.log"; 
           daemon = on; redirector = iptables;}
    
           redsocks { local_ip = 127.0.0.1; local_port = 1081; ip = 127.0.0.1; 
           port = 1080; type = socks5; }
    My SSH tunnel i open with SSH putty client listening to port 1080. I have certain things working like games but some things like google chrome and web browsing aren't working. When i try to view a web page it will just time out. Any help would be great, thanks guys.

  2. #2
    Just Joined! msohail's Avatar
    Join Date
    Nov 2011
    Posts
    47
    Try adding these line at the begining of the firewall

    HTML Code:
    -A INPUT -p tcp --dport 80 -j ACCEPT
    -A INPUT -p tcp --dport 443 -j ACCEPT
    Jazak Allah
    Sohail

  3. #3
    Just Joined!
    Join Date
    Feb 2013
    Posts
    2
    Thanks for the reply. I added those 2 lines just under the RETURN's, saved and reloaded the iptables config and google chrome still hangs loading. Could it be because im using putty to open the ssh tunnel?

  4. #4
    Just Joined! msohail's Avatar
    Join Date
    Nov 2011
    Posts
    47
    Please try adding those two rules above RETURN's rules and see if it works out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •