[Linux] ufw 방화벽 설정

2021. 12. 20. 15:27·LINUX/Linux

 

`Connection Timeout` 의 주범
방화벽 설정을 조지고가자.

실행 환경

Linux - Ubuntu

ubuntu 18.0.4

 

방화벽 허용 및 설정 현황 확인

# 방화벽 활성화
$ sudo ufw enable

# 방화벽 비활성화
$ sudo ufw disable

# 방화벽 설정 목록
$ sudo ufw status verbose

 

주요 명령어

방화벽 허용/차단

# 방화벽 허용
# $ ufw allow [PORT-Number]/[POROTOCOL]

$ ufw allow 2222/tcp


# 방화벽 차단
$ ufw deny [PORT-NUMBER]/[PROTOCOL]

$ ufw deny 7000/tcp

 

 

방화벽 정책 삭제

# ufw [allow / deny] [PORT-NUMBER]/[PROTOCL]

$ ufw deny 7000/tcp

 

 

 

고급 정책

특정 IP 와 포트번호만 허용

# ufw allow from [IP-ADDRESS] to any port [START_PORT:END_PORT] proto [PROTOCOL]

# 192.168.0.14 로부터 오는 IP 에 3000~4000 포트를 'tcp' 프로토콜로 허용한다.
$ ufw allow from 192.168.0.14 to any port 3000:4000 proto tcp

# 차단은 allow 를 deny 로만 바꿔주면 된다.

 

 


🔗 Reference

 

 

How to work with your firewall (UFW - Uncomplicated Firewall)

In this article we show how UFW - or Uncomplicated Firewall - works along with common commands and usage examples.

webdock.io

 

 

UFW - Community Help Wiki

Introduction For an introduction to firewalls, please see Firewall. UFW - Uncomplicated Firewall The default firewall configuration tool for Ubuntu is ufw. Developed to ease iptables firewall configuration, ufw provides a user friendly way to create an IPv

help.ubuntu.com

 

저작자표시 (새창열림)

'LINUX > Linux' 카테고리의 다른 글

[Linux] 중복 파일 제거 솔루션 'fdupes'  (0) 2024.04.28
[Linux] AppImage 파일  (0) 2021.12.02
[Linux] node.js 최신버전 설치  (0) 2021.05.20
rpm package with command  (0) 2020.11.10
Out Of Memory & OverCommit  (0) 2020.02.10
'LINUX/Linux' 카테고리의 다른 글
  • [Linux] 중복 파일 제거 솔루션 'fdupes'
  • [Linux] AppImage 파일
  • [Linux] node.js 최신버전 설치
  • rpm package with command
M_Falcon
M_Falcon
  • M_Falcon
    Falcon
    M_Falcon
  • 전체
    오늘
    어제
    • 분류 전체보기 (432)
      • Web (16)
        • Nodejs (14)
        • Javascript (23)
        • FrontEnd (4)
      • DataBase (39)
        • Fundamental (1)
        • Redis (4)
        • PostgreSQL (10)
        • NoSQL (4)
        • MySQL (9)
        • MSSQL (3)
        • Error (4)
      • Algorithm (79)
        • Algorithm (문제풀이) (56)
        • Algorithm (이론) (23)
      • JVM (65)
        • Spring (13)
        • JPA (5)
        • Kotlin (13)
        • Java (24)
        • Error (7)
      • 기타 (70)
        • Kafka (3)
        • Kubernetes (3)
        • Docker (13)
        • git (19)
        • 잡동사니 (27)
      • 재테크 (11)
        • 세무 (4)
        • 투자 (3)
        • 보험 (0)
      • BlockChain (2)
        • BitCoin (0)
      • C (32)
        • C (10)
        • C++ (17)
        • Error (3)
      • Low Level (8)
        • OS (3)
        • 시스템 보안 (5)
      • 네트워크 (3)
      • LINUX (30)
        • Linux (26)
        • Error (4)
      • 저작권과 스마트폰의 이해 (0)
      • 생각 뭉치 (6)
      • 궁금증 (2)
      • Private (4)
        • 이직 경험 (0)
        • 꿈을 찾아서 (1)
      • Android (21)
        • OS (4)
  • 블로그 메뉴

    • 홈
    • WEB
    • 알고리즘
    • DataBase
    • Linux
    • Mobile
    • C
    • 방명록
  • 링크

    • github
  • 공지사항

  • 인기 글

  • 태그

    android
    algorithm
    프로그래머스
    C++
    알고리즘
    Git
    Spring
    database
    Programmers
    JPA
    docker
    java
    PostgreSQL
    백준
    linux
    kafka
    javascript
    Kotlin
    ubuntu
    Bitcoin
  • hELLO· Designed By정상우.v4.10.3
M_Falcon
[Linux] ufw 방화벽 설정
상단으로

티스토리툴바