0Pricing
Linux Command Line Mastery · 강의

방화벽 관리: `ufw`, `firewalld`, `iptables`

무단 접근으로부터 리눅스 시스템을 보호하도록 방화벽을 구성하고 관리하는 방법을 배웁니다.

방화벽 관리: `ufw`, `firewalld`, `iptables`은(는) CoddyKit의 무료 Linux Command Line Mastery 강의입니다. 이것은 4개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Linux Command Line Mastery 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Linux Command Line Mastery 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

What's a Firewall?

A firewall acts as a security guard for your computer or network. It controls incoming and outgoing network traffic by analyzing data packets and deciding whether to allow or block them based on a set of predefined rules.

Think of it as a filter that protects your system from unauthorized access and malicious threats.

Introducing UFW

UFW, which stands for "Uncomplicated Firewall," is a user-friendly front-end for iptables, the complex default firewall utility in Linux. It's designed to make firewall management much simpler, especially for users on Debian-based systems like Ubuntu.

UFW simplifies common tasks like opening or closing ports.

UFW Status & Control

Before making changes, it's good practice to check UFW's current status. You can also easily enable or disable it.

Try running these commands:

sudo ufw status
sudo ufw enable
sudo ufw disable

UFW: Allow Services

UFW allows you to open ports for common services by their name, which is very convenient. For example, to allow SSH or HTTP traffic, you just use the service name.

Let's try allowing SSH and HTTP:

sudo ufw allow ssh
sudo ufw allow http
sudo ufw status verbose

UFW: Allow Custom Ports

Sometimes you need to open a specific port that isn't a named service. You can do this by specifying the port number and the protocol (TCP or UDP).

Here's how to allow port 8080 for TCP and 53 for UDP:

sudo ufw allow 8080/tcp
sudo ufw allow 53/udp
sudo ufw status verbose

Introducing Firewalld

Firewalld is another popular firewall management tool, often found on Red Hat-based systems like CentOS and Fedora. Unlike UFW, Firewalld is a dynamic firewall manager.

It uses zones to define different trust levels for network connections, allowing you to apply rules based on where the connection originates.

Firewalld Status & Zones

With Firewalld, you can check its status and explore the various zones it uses. Zones like public, home, or internal have different default rules.

Check the status and active zones:

sudo systemctl status firewalld
sudo firewall-cmd --get-active-zones
sudo firewall-cmd --get-zones

Firewalld: Manage Services

To manage services with Firewalld, you specify the zone and the service name. Changes are temporary by default; use --permanent to make them stick after a reboot, then --reload to apply.

Let's add HTTP service to the public zone permanently:

sudo firewall-cmd --zone=public --add-service=http --permanent
sudo firewall-cmd --reload
sudo firewall-cmd --list-services --zone=public

Firewalld: Manage Ports

Similar to services, you can open or close specific port numbers in a Firewalld zone. Remember to specify the protocol (TCP or UDP) and use --permanent for lasting changes.

Here's how to open port 8080 for TCP permanently:

sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent
sudo firewall-cmd --reload
sudo firewall-cmd --list-ports --zone=public

Firewall Commands Check

Time for a quick check! Which of the following statements about firewall management in Linux are true?

Recap: Firewall Essentials

In this lesson, we explored how to manage firewalls on Linux systems to enhance security. We covered two main tools:

  • UFW (Uncomplicated Firewall): A simple interface for iptables, popular on Debian/Ubuntu, allowing easy control over services and ports.
  • Firewalld: A dynamic firewall manager used on RHEL/CentOS systems, which organizes rules into zones for flexible security policies.

Understanding these tools is crucial for securing your Linux server or workstation.

자주 묻는 질문

“방화벽 관리: `ufw`, `firewalld`, `iptables`” 강의는 무료인가요?

네 — “방화벽 관리: `ufw`, `firewalld`, `iptables`” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Linux Command Line Mastery 강의 전체를 잠금 해제할 수 있습니다. Linux Command Line Mastery 강의에는 총 4개의 강의가 포함되어 있습니다.

“방화벽 관리: `ufw`, `firewalld`, `iptables`”에서 뭘 배우나요?

무단 접근으로부터 리눅스 시스템을 보호하도록 방화벽을 구성하고 관리하는 방법을 배웁니다. 브라우저에서 직접 실행하는 실습 코드로 Linux Command Line Mastery을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Linux Command Line Mastery을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Linux Command Line Mastery은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 2번째 강의입니다.

“방화벽 관리: `ufw`, `firewalld`, `iptables`” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Linux Command Line Mastery 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Linux Command Line Mastery 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. 네트워크 진단: `traceroute`, `nslookup`, `dig`
  2. 방화벽 관리: `ufw`, `firewalld`, `iptables`
  3. 안전한 셸 키 관리
  4. tcpdump로 트래픽 캡처하고 검사하기
← Linux Command Line Mastery(으)로 돌아가기