IP Traffic forwarding

Hello All

I have the following setup of a network. Client machines sends requests to the server which is (192.168.1.50) running on Ubuntu server 8.04. And this server forwards all incoming traffic from clients to another server (192.168.1.100) when it's available. The availability is checked periodically using a shell script.

The following NAT rule has been given for the forwarding task.
Rule 1: Iptables -t nat -A PREROUTING -d 192.168.1.50 -j DNAT --to-destination 192.168.1.100

In the event 192.168.1.100 is unavailable the shell script will detect the unavailability and shift the traffic to 192.168.1.200. The current iptable rules are flushed and the following rule is applied.

Rule 2: Iptables -t nat -A PREROUTING -d 192.168.1.50 -j DNAT --to-destination 192.168.1.200

In the normal scenario when 192.168.1.100 is available the forwarding rule (Rule 1) works properly. The issue is when 192.168.1.100 is unavailable and the traffic is shifted to 192.168.1.200 the traffic is not forwarded properly as required. However when 192.168.1.50 is rebooted and Rule 2 is applied the
forwarding happened as required.

ARP cache and router cache was cleared as well but that did not
solve the issue. The issue was solved only after rebooting 192.168.1.50

Any idea that I can get this sone without rebooting 192.168.1.50 ?

Thank you in advance
Anuradha :slight_smile: