IPtables is capable of working specifically with ICMP commands such as ping. For example, this will accept ping:
Code:
-A INPUT -p icmp -m icmp --icmp-type 8 -m state --state NEW,RELATED,ESTABLISHED -j accept
You can change the rules as desired. For example you can add a -s or -d to specify the source and/or destination, or you can specify an interface with -i (your modem probably uses a pseudo interface like ppp0).
See the following for more detailed information:
http://www.cyberciti.biz/tips/linux-...icmp-ping.html