ip routing based on port number.
Hi all.
First I would like to explain my scenario and requirement.
I have 3 gateways in my office. I want to redirect all web traffic
(port 80 and 443) through one gateway and ssh connections through other
one. All machines have single network interface. For this what I did
is created an ip alias et0:1 and assigned ip to it. Then wrote an ip route rule to route packets from eth0:1's ip to other gateway.
All other traffic will go through default gateway. But here I am not sure how I can make web browser to use eth0:1's ip. It's using eth0 's ip. I wrote a ip table rule to change source ip of http packets to
et0:1's ip. But rule is on POSTROUTING chain. So I think it's happening after routing.
Am I on wrong way. Please give me your valuable suggestions.
|