반응형
The basic firewall in Ubuntu is UFW. So here’s how to use the basic UFW..
UFW enable/disable
sudo ufw enable
sudo ufw disable
Displays a warning that the firewall will be blocked on activation.
Allow and block UFW
- Port base, Service base:
sudo ufw allow <port>/<optional: protocol>
sudo ufw allow 80 sudo ufw allow 80/tcp sudo ufw allow http sudo ufw deny http
-
IP base:
sudo ufw allow from <ip address>
sudo ufw allow from 192.168.0.1 sudo ufw allow from 192.168.0.0/24
UFW Advanced used
sudo ufw allow from <ip address> to <protocol> port <port number> proto <protocol name>
Allow 192.168.0.100 address and tcp protocol port 80
sudo ufw allow from 192.168.0.1 to any port 80
Delete UFW rule
When deleting a rule in UFW, insert the delete classification and the same rule as the Allow rule. At this time, you can check the rule through state and numbered.
sudo ufw allow from 192.168.0.1
sudo ufw delete from 192.168.0.1
UFW numbered rules
You can see the UFW rules with numbers attached. Rules are applied sequentially from top to bottom. You can use this to modify, delete, or add rules.
sudo ufw status numbered
delete
sudo ufw delete 1
insert
sudo ufw insert 1 allow http
반응형
'Linux' 카테고리의 다른 글
ElasticSearch Size Management – Shards, logstash (0) | 2020.11.05 |
---|---|
PART 1 INSTALL ELASTICSEARCH 6 CLUSTER FOR CENTRALIZED SYSLOG (0) | 2020.11.04 |
Log Analysis -tr, awk, uniq, sort (0) | 2020.11.04 |
Apache - ErrorDocument 설정 (0) | 2020.11.03 |
Linux - Crontab How to use (0) | 2020.11.03 |