So I have a server set up with 2 ppp interfaces.
ppp0 = fast capped at 5GB/m
ppp1 = slow uncapped
I have set up a second proxy server listening on port 8888 on the server. I am trying to route all of those requests through the slow interface and have everything else run through the fast interface.
My ideal set up is to get torrents to run through the slower one (similar to
http://www.linuxquestions.org/questi...erface-792766/) but I'll try that once I've gotten this working (as far as i know torrents use a specific port range so it shouldn't be that tricky to adapt this)
As far as I know, it involves 3 steps.
Step 1 - Mark packets in firewall
Step 2 - Create a routing rule to send all marked packets to a specific lookup table
Step 3 - Set the default route for that lookup table to the gateway + dev for the interface.
I have marked the packets in the firewall as when I access the proxy I can see the requests in the firewall logs.
Code:
iptables -t mangle -A PREROUTING -p tcp --dport 8888 -j MARK --set-mark 5
iptables -t mangle -A PREROUTING -p tcp --dport 8888 -j LOG --log-level DEBUG --log-prefix "port 8888 test: "
I don't need it on the OUTPUT table as this is only for pc's behind the NAT, not the server itself.
I have added the tables into /etc/iproute2/rt_tables:
Code:
200 telkom
201 axxess
Then the iproute2 magic:
Code:
ip rule add fwmark 5 lookup axxess
ip route add default via 41.240.0.1 dev ppp1 table axxess
tcpdump listening on ppp1 sees nothing.
I don't really know what else to do here? I've literally spent over 20 hours on this over the past few months! About to go crazy here!