For faster navigation, this Iframe is preloading the Wikiwand page for Uncomplicated Firewall.

Uncomplicated Firewall

本條目存在以下問題,請協助改善本條目或在討論頁針對議題發表看法。 此條目需要編修,以確保文法、用詞、语气格式標點等使用恰当。 (2015年3月30日)請按照校對指引,幫助编辑這個條目。(幫助討論) 此條目包含指南或教學內容。 (2020年9月6日)請藉由移除或重寫指南段落來改善條目,或在討論頁提出討論。
Gufw 是 Uncomplicated Firewall图形用户界面,而 Uncomplicated Firewall 本身封装了 netfilter

Uncomplicated Firewall[1],简称UFW,是Ubuntu系统上默认的防火墙组件。UFW是为轻量化配置iptables而开发的一款工具。UFW 提供一个非常友好的界面用于创建基于IPV4IPV6的防火墙规则。UFW 在 Ubuntu 8.04 LTS 后的所有发行版中默认可用[2]。UFW 的圖形使用者界面Gufw

基本语法和例子

[编辑]

理论上来说,桌面版和服务器版的 UFW 的命令行用法是一样的。

基本语法:

ufw COMMAND

打开与关闭

[编辑]

打开防火墙:

ufw enable

关闭防火墙:

ufw disable

显示防火墙状态:

ufw status

查看防火墙详细状态:

ufw status verbose

允许与阻止

[编辑]

增加一条表示允许的规则:

ufw allow

例:允許通過 53 連接埠使用 tcp 和 udp 協定連線本機

ufw allow 53

增加一條表示阻止的規則:

ufw deny

例:阻止通過 53 連接埠使用 tcp 協定連線本機

ufw deny 53/tcp

增加一條表示拒絕的規則:

ufw reject

以服務名稱代表連接埠

[编辑]

可以使用

less /etc/services

列出所有服務的資訊,其中包括該服務使用了何連接埠及協定。

進階語法與參數

[编辑]

為規則編號

[编辑]

ufw status numbered                 show firewall status as numbered list of RULES 

其他指令參數

[编辑]

default ARG                     set default policy / 設定預設規則

logging LEVEL                   set logging to LEVEL 

limit ARGS                      add limit rule 

delete RULE|NUM                 delete RULE / 刪除規則

insert NUM RULE                 insert RULE at NUM / 插入規則

reload                          reload firewall / 重新啟動防火牆

reset                           reset firewall / 重設防火牆

show ARG                        show firewall report 

version                         display version information

Application profile commands: 

app list                        list application profiles 

app info PROFILE                show information on PROFILE 

app update PROFILE              update PROFILE 

app default ARG                 set default application policy

相似指令參數介紹

[编辑]

deny 與 reject 的區別在於:使用 deny 時,對方不會得到任何通知,而使用 reject 時則明確告訴對方被禁止了。

  1. ^ UFW wiki. [2015-03-30]. (原始内容存档于2022-04-03). 
  2. ^ UncomplicatedFirewall - Ubuntu Wiki. wiki.ubuntu.com. [2020-08-26]. (原始内容存档于2022-04-09). 
{{bottomLinkPreText}} {{bottomLinkText}}
Uncomplicated Firewall
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?