I could use some help with the iptables. As in can it do the routing I described on the first post on this thread.
I don’t know much about iptables, but I have some spare time so tinkering around with iptables is an option to pass the time…
Please point out the faults why this wouldn’t work:
– I type http://www.google.com:1235 on a web browser
– ZS receives the request (random source port, destination port 1235)
– Using above packet flow diagram, I’d suspect that first the packet is checked against mangle table’s prerouting chain.
– Prerouting chain jumps to NetBalancer chain
– NetBalancer chain marks the connection (source: LAN IP address, destination anywhere, protocol tcp, destination port 1235) to go out of specified gateway
– Next the packet is matched against nat table’s prerouting chain, which has a rule in the vein of:
iptables -t nat -A PREROUTING -p tcp -i ETH00 -s [lan ip address] –dport 1235 -j REDIRECT –to-ports 80
The HTTP request now should leave out as “www.google.com:80”
The above iptables command doesn’t work though… but why doesn’t it?