Linux refuses foreign IP access steps

  

What should I do if the Linux server is attacked? In fact, don't worry, the method of rejecting foreign ip access can reduce the number of attacks. The following small series teaches you how to shield foreign ip access, let's learn together.

1. In fact, there are many foreign IPs, and the amount of IP in so many countries is very large. There is not much IP in a country, which means that we can collect domestic IP and then only allow Domestic IP access, other IPs are rejected, so that it can also filter the way to foreign IP.

2, we can fully use iptables to filter

3, first of all talk about iptables IP approach allows a

iptables -A INPUT - s 114.114.114.114 -p TCP --dport 80 -j ACCEPT

iptables -A OUTPUT -d 114.114.114.114 -p TCP --sport 80 -j ACCEPT

This allows An IP access server port 80 port
Previous12Next page Total 2 pages

Copyright © Windows knowledge All Rights Reserved