Linux: Log Suspicious Martian Packets / Un-routable Source Addresses

Originally published at: https://www.cyberciti.biz/faq/linux-log-suspicious-martian-packets-un-routable-source-addresses/

I run a web-server and I would like to log packets with un-routable source addresses on Linux operating system. How can I log spoofed packets on Debian / Ubuntu / CentOS / RHEL / Linux based server? How can I log a Martian packet (packet from Mars) on Linux operating systems?