Firewall (4)-iptables (2) add and modify rules -A -R

(1) Prohibit a host to ping:
First prepare two hosts:
Insert picture description here
Insert picture description here

At this point, first clear all iptables rules
Insert picture description here
and then add our rules: prohibit our 192.168.19.131 host from connecting to 192.168.19.129:
Insert picture description here

This is what we found unable to pingInsert picture description here

We can see that a message has been received, num has become 1Insert picture description here

ps: Modify the host name:
Insert picture description here
Insert picture description here
(2) Modify the rules.
At this point, we add another host: 192.168.19.134.
Insert picture description here
We will change the prohibition of 192.168.19.131 above to prohibit 192.168.19.134:
Insert picture description here
At this time, I use my 192.168.19.134 host to ping192 .168.19.129:
Insert picture description here

It is found that it cannot be pinged.
Then use 192.168.19.131 to ping: it is
Insert picture description here
found that it can be pinged.

Guess you like

Origin blog.csdn.net/weixin_48445640/article/details/109220582