My ISP has given me a 187.x.x.224/29 subnet. The gateway is 187.x.x.225 I have a Ubuntu server with 6 ethernet ports. The server does NAT routing and also acts as a webserver. My plan is to have eth1
and eth2
have seperate WAN ips: 187.x.x.226 and 187.x.x.227 respectively. I want the NAT trafffic to pass through 187.x.x.226 and the webserver and other local apps should listen on 187.x.x.227. But the gateway for both will be the same which is 187.x.x.225. eth0
, eth3
and eth4
face 3 different NAT networks. The NAT works fine as of now, but traffic from NAT network and webserver traffic is forwarded only via eth1
. So my question is how can I set route and defualt gateway so as to route webserver traffic through eth2
.
EDIT 1: I do heavy traffic shaping on eth1, which acts as a uplink for the NAT networks. I don't want the webserver to be affected by it. My users do heavy bittorrent downloading, and always visit dodgy sites. As the eth1
ip has a domain associated with it, I find it very risky. I am planning to move the domain attached ip to eth2
and to give a anonymous ip to eth1
(WAN link for NAT network). The solution I am looking for is, if a reqest for webserver comes through eth2
, the reply should go out of the same interface.