更新 '防火墙/禁止本机访问其他服务器.md'
This commit is contained in:
parent
e404af5dfe
commit
dbdb414778
1 changed files with 7 additions and 0 deletions
|
@ -7,6 +7,13 @@ service iptables restart
|
||||||
|
|
||||||
# firewalld
|
# firewalld
|
||||||
```bash
|
```bash
|
||||||
|
# 禁止访问80端口
|
||||||
firewall-cmd --permanent --direct --add-rule ipv4 filter OUTPUT 1 -p tcp --dport 80 -d 10.202.233.70/32 -j DROP
|
firewall-cmd --permanent --direct --add-rule ipv4 filter OUTPUT 1 -p tcp --dport 80 -d 10.202.233.70/32 -j DROP
|
||||||
|
# 禁止访问所有端口
|
||||||
|
firewall-cmd --permanent --direct --add-rule ipv4 filter OUTPUT 1 -p tcp -d 10.202.233.70/32 -j DROP
|
||||||
|
# 移除禁止访问80规则
|
||||||
|
firewall-cmd --permanent --direct --remove-rule ipv4 filter OUTPUT 1 -p tcp --dport 80 -d 10.202.233.70/32 -j DROP
|
||||||
|
# 查看direct规则
|
||||||
|
firewall-cmd --direct --get-all-rules
|
||||||
firewall-cmd --reload
|
firewall-cmd --reload
|
||||||
```
|
```
|
Loading…
Add table
Add a link
Reference in a new issue