How to block incoming ping ?

I connect to the Internet directly without a router.

How to block incoming ping ? but still allow outgoing ping ?

I would use

net.ipv4.icmp_echo_ignore_all = 1

in /etc/sysctl.conf

Execute

sysctl -p

to have it take effect immediately.

It worked. Thanks.