So i have Been Trying to achieve a scenario but i am not being able to fix that hope someone will come up with the solution
so basically what is want is
I have two server publicly accessible So what I want is
I want if any client tries to request a service lets say a udp service i want it to be redirected to server B
SO the configuration i have is
iptables -t nat -I PREROUTING -d <This pc> -p udp --dport 9987 -j DNAT --to-destination <Redirecting server>
iptables -A FORWARD -d <redirecting server> -j ACCEPT
sysctl -p
net.ipv4.ip_forward = 1
I can access the other server from outside and from my box there is no limiting policy in the redirecting server or just say destination server
The packet are being matched in the iptables rule
############ EDIT ###############
My Requirement lets say i have a http server on a location And i have another server in different location i want to just make that what ever hits my this server with a request to 80 it should be redirected to another server at port 80 ignore the ports they might be different but the scenario is same
Thank you