pierredugland
Occasional Visitor
Hi everyone,
First post here. Hope you guys can help me.
I have followed the instructions here (https://github.com/RMerl/asuswrt-merlin/wiki/Policy-based-routing-(manual-method)) to redirect some traffic through my VPN.
The trick is I want to redirect a port and not all traffic that comes from an internal IP address.
I though I could use the -sport parameter (https://www.cyberciti.biz/tips/linux-iptables-how-to-specify-a-range-of-ip-addresses-or-ports.html) to supplement the script above but no luck.
I used that line in the script instead of the recommended one :
iptables -t mangle -A PREROUTING -i br0 -m iprange --src-range 192.168.1.23 -j MARK --set-mark 0 -p tcp -sport 8112
Here is how I'm setup. You can maybe tell me how I should proceed...
1. AC88U router @ 192.168.1.1. running latest merlin (jffs enabled and I have verified that my vpn client works and that the scritps in the jffs folder get taken into account)
2. NAS sitting on an internal IP address (for the sake of this question let's say 192.168.1.50)
3. On the NAS itself I am running some docker containers, for which I have allowed passthrough access to WAN. Let's use my deluge image as an example : 192.168.1.50:8112 is the address of it and I have forwarded that port through my router to give it access to the internet.
My end goal is to redirect all Deluge traffic through the VPN but not all traffic from the NAS.
I also would like to keep remote access to the target of the redirected traffic (the deluge container in that case).
Is there a way to do it ? What have I missed ?
First post here. Hope you guys can help me.
I have followed the instructions here (https://github.com/RMerl/asuswrt-merlin/wiki/Policy-based-routing-(manual-method)) to redirect some traffic through my VPN.
The trick is I want to redirect a port and not all traffic that comes from an internal IP address.
I though I could use the -sport parameter (https://www.cyberciti.biz/tips/linux-iptables-how-to-specify-a-range-of-ip-addresses-or-ports.html) to supplement the script above but no luck.
I used that line in the script instead of the recommended one :
iptables -t mangle -A PREROUTING -i br0 -m iprange --src-range 192.168.1.23 -j MARK --set-mark 0 -p tcp -sport 8112
Here is how I'm setup. You can maybe tell me how I should proceed...
1. AC88U router @ 192.168.1.1. running latest merlin (jffs enabled and I have verified that my vpn client works and that the scritps in the jffs folder get taken into account)
2. NAS sitting on an internal IP address (for the sake of this question let's say 192.168.1.50)
3. On the NAS itself I am running some docker containers, for which I have allowed passthrough access to WAN. Let's use my deluge image as an example : 192.168.1.50:8112 is the address of it and I have forwarded that port through my router to give it access to the internet.
My end goal is to redirect all Deluge traffic through the VPN but not all traffic from the NAS.
I also would like to keep remote access to the target of the redirected traffic (the deluge container in that case).
Is there a way to do it ? What have I missed ?