Since i do not have access to other layers, i would like to know the most efficient way to block an ip address from connecting to a Ubuntu 18.04 server. To the box itself, they are most likely connecting to port 80. However i would like to block access across all ports to this ip address.
I am aware of adding a record in iptables. By most efficient i mean, the least amount of layers the packet goes through. Kind of like blocking using iptables happens before block using an apache config on the webserver itself.
Are there any other better ways?
Thanks
No. The most efficient way to block the host will be iptables
since it is both operating at the kernel level and acting immediately after the packet is received and before it is handed to any application.
iptables -A INPUT -s bad.host.ip.address -j DROP