Linux firewall settings, prohibit access to certain ip

service iptables status to view the status of the firewall

Turn on the firewall service iptables start

service iptables stop turn off the firewall

service iptables restart restart firewall

 

Firewall open specific ports

File / etc / sysconfig / iptables 

Add Port

Restart the firewall

 

Prohibit access to certain IP

iptables -A INPUT -p tcp -s 192.168.1.2 -j DROP

-s parameter is the source (ie 192.168.1.2)

Later he refused or DROP

 

https://www.cnblogs.com/jdhu/p/4239343.html

Guess you like

Origin www.cnblogs.com/bill89/p/11077388.html