Just be sure you do not need any of the functionalities described ahead before you make the changes. If you discover later that you need them, change it back at any time.
Edit the system configuration file:
sudo nano /etc/sysctl.conf
Look for the following lines:
net.ipv4.conf.all.accept_redirects = 0 net.ipv6.conf.all.accept_redirects = 0 net.ipv4.conf.all.send_redirects = 0
Uncommenting these lines may prevent some methods of IP Spoofing and Man-In-The-Middle attacks.
In the same config file, look for the following lines:
net.ipv4.conf.all.accept_source_route = 0 net.ipv6.conf.all.accept_source_route = 0 net.ipv4.conf.all.log_martians = 1
These lines also disable router functionalities, if your server is not a router.
You can also add this line at the end to stop responding to pings:
net.ipv4.icmp_echo_ignore_all = 1
I cannot think of a technical safety reason to disable pings, but some attackers may be discouraged and move on to the next random IP that is responding.
Save, exit, and apply your changes with the following command:
sudo sysctl -p
To learn more about system configuration optimization, visit this link [Link].
See another post about installing Fail2Ban [Read It]. It is a monitor that reads the log files of running services such as SSH, FTP, HTTP, etc., and bans the originating IP after too many failed authentication attempts within a certain period, interrupting brute force attacks. This service also works with WordPress [Read It].