0

I have the problem. Some domains are blocked in my country.

So I have a cheap home router TP-Link TL-WR841ND v8.

Firmware : Firmware: DD-WRT v24-sp2 (12/22/14)

Is there any way to route all traffic for some domains through a proxy server. Or for example route all traffic from a specific computer in my network. I want to use SOCKS5 proxy servers to route my traffic through.

I have tried to google, but haven't found any related info. I would be grateful for any advice and suggestions.

Thx.

1 Answer 1

0

I have written an article on this matter. You can find it here.

I have described a process of redirecting network traffic from a specific machine through a SOCKS5 proxy using Redsocks and specific configuration of iptables rules.

Furthermore, I have the same router as you have.

In short here are the rules that you need to apply on your router to get traffic redirected to a proxifying machine.

#!/bin/sh
PROXIFYING_MACHINE=192.168.0.145
MACHINE_TO_PROXIFY=192.168.0.113

iptables -I PREROUTING 1 -t mangle -s $MACHINE_TO_PROXIFY ! -d `nvram get lan_ipaddr`/`nvram get lan_netmask` -p tcp -m multiport --dports 80,443 -j MARK --set-mark 3
iptables -I PREROUTING 2 -t mangle -s $MACHINE_TO_PROXIFY ! -d `nvram get lan_ipaddr`/`nvram get lan_netmask` -p tcp -m multiport --dports 80,443 -j CONNMARK --save-mark
iptables -I PREROUTING 3 -t mangle -s $MACHINE_TO_PROXIFY ! -d `nvram get wan_ipaddr` -p tcp -m multiport --dports 80,443 -j MARK --set-mark 3
iptables -I PREROUTING 4 -t mangle -s $MACHINE_TO_PROXIFY ! -d `nvram get wan_ipaddr` -p tcp -m multiport --dports 80,443 -j CONNMARK --save-mark

ip rule add fwmark 3 table 13
ip route add default via $PROXIFYING_MACHINE table 13

Hope this helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .