I have two interface eth0 and eth1
My application runs on eth1
The incoming packets on eth0(10.43.16.249) are being prerouted to eth1(10.43.18.110) using
iptables -t nat -p udp -A PREROUTING -d 10.43.16.249 -j DNAT --to-destination 10.43.18.110
10:34:06.373083 IP 10.43.18.124.67 > 10.43.16.249.67: BOOTP/DHCP, Request from 00:a0:bc:00:00:02, length 259
Strangely my application's responses are seen to be going out with sourceIP of eth0(10.43.16.249), so the response packets are not able to reach the client IP(10.43.18.124) as there is no route to the client via eth0.
10:34:06.375043 IP 10.43.16.249.67 > 10.43.18.124.67: BOOTP/DHCP, Reply, length 300
Is there a way I can route these eth0 packets via eth1.
# netstat -r Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface default gateway 0.0.0.0 UG 0 0 0 eth0 10.43.16.128 0.0.0.0 255.255.255.128 U 0 0 0 eth0 10.43.18.64 0.0.0.0 255.255.255.192 U 0 0 0 eth1
I've tried POSTROUTING SNAT but guess that doesn't work as POSTROUTING happens after the routing rules are looked at(no route from eth0).
(eth1) requests are able to land on eth0 of the server as there is a Keepalived NAT Load Balancer in-between which is taking care of it.