39 lines
414 B
Markdown
39 lines
414 B
Markdown
|
### 1. 查看防火墙状态
|
||
|
|
||
|
```bash
|
||
|
sudo ufw status
|
||
|
```
|
||
|
|
||
|
### 2. 开启防火墙
|
||
|
|
||
|
```bash
|
||
|
sudo ufw enable
|
||
|
```
|
||
|
|
||
|
### 3. 关闭防火墙
|
||
|
|
||
|
```bash
|
||
|
sudo ufw disable
|
||
|
```
|
||
|
|
||
|
### 4. 放开端口
|
||
|
|
||
|
```bash
|
||
|
sudo ufw allow 8000/tcp
|
||
|
sudo ufw allow 443
|
||
|
```
|
||
|
|
||
|
### 5. 网卡+IP端
|
||
|
|
||
|
```bash
|
||
|
sudo ufw allow in on ens18 from 192.168.0.0/24
|
||
|
sudo ufw allow out on ens18 from 192.168.0.0/24
|
||
|
```
|
||
|
|
||
|
### 6. 更多用法
|
||
|
|
||
|
```bash
|
||
|
man ufw
|
||
|
```
|
||
|
|