I have to write two simply C program: the first, running on client behind nat,send ICMP echo request to server. The second, running on server, should receive the echo request and send a custom echo reply with data. So, I should be able to send custom echo reply, but when I run first program kernel receive normal reply, not customed. so I disabled incoming echo reply on client with iptables rule iptables -A INPUT -p icmp --icmp-type 0 -j DROP.
I set the socket in server program in this way: sock = socket(AF_INET, SOCK_RAW , IPPROTO_ICMP); I would ask: if I set IP and ICMP header in right way in server program to send echo reply, the client would be able to receive echo reply or also this reply will be dropped by firewall rules?
And what about if the client is connected to server by SSH connection?
Aucun commentaire:
Enregistrer un commentaire