I have a ubuntu server that receives many ping requests from various other servers in the network. I would like to be able to proxy these requests. Using iptable rules I can see how to DROP or ACCEPT the requests but is there a way to redirect them? More specifically I'm looking for a way to conditionally respond to them. Maybe a little psudo code will help explain...
if [ "$SourceIP" == "192.168.1.5" ]; then #send response elif [ "$SourceIP" == "192.168.1.6" ]; then #drop elif [ "$SourceIP == "192.168.1.7" ]; then sleep 20 #send response fi
I know I can use iptable rules to drop and accept for specific ip addresses (the first two scenarios). But I need more control than that. I need to be able to put logic into when and if a response is given.
Is this possible?
Thanks for any ideas you can offer!