Skip to content

Commit 80ca9b7

Browse files
authored
Update iptables.md
1 parent 4dd9b04 commit 80ca9b7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

command/iptables.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,24 @@ iptables(选项)(参数)
7171
-h:显示帮助信息;
7272
```
7373

74+
## 基本参数
75+
76+
| 参数 | 作用 |
77+
| ---- | ---- |
78+
| -P | 设置默认策略:iptables -P INPUT (DROP|ACCEPT) |
79+
| -F | 清空规则链 |
80+
| -L | 查看规则链 |
81+
| -A | 在规则链的末尾加入新规则 |
82+
| -I | num 在规则链的头部加入新规则 |
83+
| -D | num 删除某一条规则 |
84+
| -s | 匹配来源地址IP/MASK,加叹号"!"表示除这个IP外。 |
85+
| -d | 匹配目标地址 |
86+
| -i | 网卡名称 匹配从这块网卡流入的数据 |
87+
| -o | 网卡名称 匹配从这块网卡流出的数据 |
88+
| -p | 匹配协议,如tcp,udp,icmp |
89+
| --dport num | 匹配目标端口号 |
90+
| --sport num | 匹配来源端口号 |
91+
7492
#### 命令选项输入顺序
7593

7694
```

0 commit comments

Comments
 (0)