1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

LAN Clients to External SOCKS5 Proxy

Discussion in 'Asuswrt-Merlin' started by vertigo888, Apr 10, 2020.

  1. vertigo888

    vertigo888 Occasional Visitor

    Joined:
    Oct 16, 2017
    Messages:
    32
    Hi - Is it possible to re-direct LAN clients/ports to an external authenticated socks5 proxy? I can't find any posts about this.
     
    StefanP likes this.
  2. Zastoff

    Zastoff Senior Member

    Joined:
    Nov 21, 2017
    Messages:
    493
    I have seen settings on socks5 proxy in DNSCrypt-proxy v2 (never tested it)
    From settings file:
    Code:
    ## SOCKS proxy
    ## Uncomment the following line to route all TCP connections to a local Tor node
    ## Tor doesn't support UDP, so set `force_tcp` to `true` as well.
    
    # proxy = 'socks5://127.0.0.1:9050'
    
    
    ## HTTP/HTTPS proxy
    ## Only for DoH servers
    
    # http_proxy = 'http://127.0.0.1:8888'
    DNSCrypt-proxy v2 can be installed via amtm or dnscrypt installer thread
     
  3. vertigo888

    vertigo888 Occasional Visitor

    Joined:
    Oct 16, 2017
    Messages:
    32

    Thanks - doesn't look like what I'm looking for. I have 1 single LAN client that I want to push through an external hosted SOCKS5 proxy with username and password. Any ideas anyone?
     
    Last edited: Apr 10, 2020
  4. Martineau

    Martineau Part of the Furniture

    Joined:
    Jul 8, 2012
    Messages:
    3,392
    Location:
    UK
    Would a simple rule such as this work?
    Code:
    iptables -t nat -A PREROUTING -s xxx.xxx.xxx.xxx -i br0 ! -d $(nvram get lan_ipaddr_rt)/24 -p tcp --dport 80 -j DNAT --to socks5proxyIP:port 
     
    Last edited: Apr 10, 2020
  5. vertigo888

    vertigo888 Occasional Visitor

    Joined:
    Oct 16, 2017
    Messages:
    32

    Thank Martineau - this external hosted proxy requires username and password for authentication. Otherwise this'd work, or am I missing something here?
     
  6. Martineau

    Martineau Part of the Furniture

    Joined:
    Jul 8, 2012
    Messages:
    3,392
    Location:
    UK
    You would manually enter your login credentials when presented with a GUI or why not simply issue a curl/wget with the UserID/Password in the URL to automate it?
     
  7. vertigo888

    vertigo888 Occasional Visitor

    Joined:
    Oct 16, 2017
    Messages:
    32
    Ok so I solved this issue, what I was trying to do is to use a socks5 proxy with authentication details with my Transmission client.

    In the end curl was the clue to the answer, added the following to my Transmission service under init.d folder

    Code:
    export http_proxy=socks5h://username:[email protected]:someport
    (if username contains @, replace with %40 instead)
     
  8. Martineau

    Martineau Part of the Furniture

    Joined:
    Jul 8, 2012
    Messages:
    3,392
    Location:
    UK
    Again, classic case of not disclosing the actual FULL requirements (with a misleading thread title), i.e. it's not actually a LAN device, but the use of a specific app (Transmission) that needs the proxy. :rolleyes:
     
    L&LD likes this.