129
141

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ufwを使って簡単にファイアウォールを設定する

Last updated at Posted at 2014-04-11

ufw(uncomplicated firewall)のインストール

$ sudo apt-get install ufw

CentOSにインストール

ufwの使い方

$ sudo ufw allow 22
$ sudo ufw allow 25
$ sudo ufw allow 80
$ sudo ufw deny 22
$ sudo ufw deny 25
$ sudo ufw deny 80
$ sudo ufw allow 22/tcp
$ sudo ufw allow 25/tcp
$ sudo ufw allow 80/tcp
$ sudo ufw deny 22/tcp
$ sudo ufw deny 25/tcp
$ sudo ufw deny 80/tcp
$ sudo ufw reload

ファイアウォールを無効にする

$ sudo ufw disable

ファイアウォールを有効にする

$ sudo ufw enable

全ての通信を許可する

$ sudo ufw default ALLOW

全ての通信遮断する

$ sudo ufw default DENY

ufwの設定を確認する

$ sudo ufw status

その他

sudo ufw limit 22

sudo ufw from 192.168.XXX.XXX/24 to any port 3128
sudo ufw from 192.168.XXX.XXX/24 to any port 53/udp
129
141
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
129
141

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?