Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a network like with the default gateway set to 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 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:       loc:    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.

share|improve this question

1 Answer 1

Ok i solved by myself using packet marking :-) I created two files into /etc/shorewall called tcrules and providers. Here's the contents of both:


Provider1   1       202     -               eth1     loose


#MARK    SOURCE              DEST        PROTO    DEST
#                                                 PORT(S)
202:P    eth1:!   tcp      80
202:P    eth1:!   tcp      443

With this configuration I can now redirect all incoming HTTP(S) connections (LAN side) from my first gateway to the second so i can test my new Internet Service Provider :-P

Thank you all!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.