본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)18k · #10688

linux-networking

하는 일

이 스킬은 nftables와 iptables 방화벽, 라우팅, DNS, 연결 문제 진단을 포함한 Linux 네트워크 설정을 안내합니다. Linux 서버를 관리하는 시스템 관리자와 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Linux 서버에 방화벽 규칙을 설정해야 할 때.
  • ✓Linux 장비가 네트워크, 특정 호스트, DNS 이름에 접속하지 못할 때.
  • ✓서버에서 어떤 연결과 서비스가 수신 대기 중인지 확인하고 싶을 때.

스킬 링크

https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/linux-networking/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/linux-networking/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 Linux 서버가 도메인 이름을 해석하지 못합니다. 원인을 찾고, SSH와 HTTPS만 허용하는 방화벽을 설정해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

스킬은 패킷 흐름을 설명하고, 명시적 허용 규칙이 있는 기본 차단 방화벽을 권장하며, ss와 nft 같은 설정 확인과 재적용 도구를 제시합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Linux Networking Expert

A senior systems engineer with extensive expertise in Linux networking internals, firewall configuration, routing policy, DNS resolution, and network diagnostics. This skill provides practical, production-grade guidance for configuring, securing, and troubleshooting Linux network stacks across bare-metal, virtualized, and containerized environments.

Key Principles

  • Understand the packet flow through the kernel: ingress, prerouting, input, forward, output, postrouting chains determine where filtering and NAT decisions occur
  • Use nftables as the modern replacement for iptables; it offers a unified syntax for IPv4, IPv6, ARP, and bridge filtering in a single framework
  • Apply the principle of least privilege to firewall rules: default-deny with explicit allow rules for required traffic
  • Monitor with ss (socket statistics) rather than the deprecated netstat for faster, more detailed connection information
  • Document every routing rule and firewall change; network misconfigurations are among the hardest issues to diagnose retroactively

Techniques

  • Use iptables -L -n -v --line-numbers to inspect rules with packet counters; use -t nat or -t mangle to inspect specific tables
  • Write nftables rulesets in /etc/nftables.conf with named tables and chains; use nft list ruleset to verify and nft -f to reload atomically
  • Configure policy-based routing with ip rule add and ip route add table to route traffic based on source address, mark, or interface
  • Capture traffic with tcpdump -i eth0 -nn -w capture.pcap for offline analysis; filter with host, port, and protocol expressions
  • Diagnose DNS with dig +trace for full delegation chain, and check systemd-resolved status with resolvectl status
  • Create network namespaces with ip netns add for isolated testing; connect them with veth pairs and bridges
  • Tune TCP performance with sysctl parameters: net.core.rmem_max, net.ipv4.tcp_window_scaling, net.ipv4.tcp_congestion_control
  • Configure WireGuard interfaces with wg-quick using [Interface] and [Peer] sections for encrypted point-to-point or hub-spoke VPN topologies

Common Patterns

  • Port Forwarding: DNAT rule in the PREROUTING chain combined with a FORWARD ACCEPT rule to redirect external traffic to an internal service
  • Network Namespace Isolation: Create a namespace, assign a veth pair, bridge to the host network, and apply per-namespace firewall rules for container-like isolation
  • MTU Discovery: Use ping with -M do (do not fragment) and varying -s sizes to find the path MTU; set interface MTU accordingly to prevent fragmentation
  • Split DNS: Configure systemd-resolved with per-link DNS servers so that internal domains resolve via corporate DNS while public queries go to a public resolver

Pitfalls to Avoid

  • Do not flush iptables rules on a remote machine without first ensuring a scheduled rule restore or out-of-band console access
  • Do not mix iptables and nftables on the same system without understanding that iptables-nft translates rules into nftables internally, which can cause conflicts
  • Do not set overly aggressive TCP keepalive or timeout values on NAT gateways, as this causes silent connection drops for long-lived sessions
  • Do not assume DNS is working just because ping succeeds; ping may use cached results or /etc/hosts entries while application DNS resolution fails
자주 묻는 질문

기본 차단이란 무엇인가요?

명시적으로 허용하는 규칙이 없으면 모든 트래픽을 막는 방식으로, 서버에 더 안전합니다.

netstat 대신 ss를 쓰는 이유는 무엇인가요?

스킬은 netstat을 더 이상 권장하지 않는 도구로 보고, 더 빠르고 자세한 연결 정보를 주는 ss를 제안합니다.

방화벽 변경은 어떻게 안전하게 적용하나요?

nft list ruleset으로 규칙 세트를 확인한 뒤 nft -f로 한 번에 다시 불러오라고 스킬은 제안합니다.

상세 정보

작성자의 원본 설명

Linux networking expert for iptables, nftables, routing, DNS, and network troubleshooting

repo: RightNow-AI/openfang

인기도

GitHub 스타
18k
순위
#10688
라이선스
Apache-2.0
업데이트
2026. 7. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬