How can I redirect HTTP(S) traffic to another gateway?

Posted by PsyStyle on Server Fault See other posts from Server Fault or by PsyStyle
Published on 2010-12-29T16:59:17Z Indexed on 2010/12/29 20:56 UTC
Read the original article Hit count: 133

Filed under:
|
|
|
|

I have a network like 192.168.0.0/15 with the default gateway set to 192.168.0.1. All the workstations of the network use this gateway for all kind of accesses to the Internet. Now I am testing a new Internet connection with another provider and for that I'm using a second gateway on the same subnet with 192.168.0.2 as IP address. I want to redirect only HTTP and HTTPS traffic to this second gateway keeping untouched the address of the default gateway set inside every workstation. How can I accomplish this task? What I have to change inside the first's gateway firewall configuration or routes? I tried with a DNAT like:

DNAT    loc:192.168.0.1       loc:192.168.0.2    tcp    80

but nothing worked. I use Shorewall for simplicity in configuration but I can understand even theorical answers which I will try to adapt to my case.

© Server Fault or respective owner

Related posts about linux

Related posts about firewall