# 允许IPsudo ufw allow from 203.0.113.101
# 阻止IPsudo ufw deny from 203.0.113.100
(3)阻止/允许port
1
2
3
4
5
6
7
8
# 允许外部访问端口8080sudo ufw allow 8080# 允许某ip访问端口8080sudo ufw allow from 203.0.113.101 to any port 8080# 阻止外部访问端口8080sudo ufw disable 8080# 阻止某ip访问端口8080sudo ufw deny from 203.0.113.101 to any port 8080