Agent SkillsRightNow-AI/openfang › linux-networking

linux-networking

GitHub

Linux网络专家技能,涵盖iptables/nftables防火墙、路由策略、DNS解析及网络故障排查。提供内核包流原理、现代工具使用(如ss、tcpdump)、网络命名空间隔离及性能调优等生产级指导。

crates/openfang-skills/bundled/linux-networking/SKILL.md RightNow-AI/openfang

Trigger Scenarios

配置或调试Linux防火墙规则 排查网络连接或DNS问题 配置路由策略或MTU 设置网络命名空间隔离

Install

npx skills add RightNow-AI/openfang --skill linux-networking -g -y
More Options

Non-standard path

npx skills add https://github.com/RightNow-AI/openfang/tree/main/crates/openfang-skills/bundled/linux-networking -g -y

Use without installing

npx skills use RightNow-AI/openfang@linux-networking

指定 Agent (Claude Code)

npx skills add RightNow-AI/openfang --skill linux-networking -a claude-code -g -y

安装 repo 全部 skill

npx skills add RightNow-AI/openfang --all -g -y

预览 repo 内 skill

npx skills add RightNow-AI/openfang --list

SKILL.md

Frontmatter
{
    "name": "linux-networking",
    "description": "Linux networking expert for iptables, nftables, routing, DNS, and network troubleshooting"
}

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

Version History

  • acf2587 Current 2026-08-20 07:38

Same Skill Collection

crates/openfang-hands/bundled/browser/SKILL.md
crates/openfang-hands/bundled/clip/SKILL.md
crates/openfang-hands/bundled/collector/SKILL.md
crates/openfang-hands/bundled/infisical-sync/SKILL.md
crates/openfang-hands/bundled/lead/SKILL.md
crates/openfang-hands/bundled/predictor/SKILL.md
crates/openfang-hands/bundled/researcher/SKILL.md
crates/openfang-hands/bundled/trader/SKILL.md
crates/openfang-hands/bundled/twitter/SKILL.md
crates/openfang-skills/bundled/ansible/SKILL.md
crates/openfang-skills/bundled/api-tester/SKILL.md
crates/openfang-skills/bundled/aws/SKILL.md
crates/openfang-skills/bundled/azure/SKILL.md
crates/openfang-skills/bundled/ci-cd/SKILL.md
crates/openfang-skills/bundled/code-reviewer/SKILL.md
crates/openfang-skills/bundled/compliance/SKILL.md
crates/openfang-skills/bundled/confluence/SKILL.md
crates/openfang-skills/bundled/crypto-expert/SKILL.md
crates/openfang-skills/bundled/css-expert/SKILL.md
crates/openfang-skills/bundled/data-analyst/SKILL.md
crates/openfang-skills/bundled/data-pipeline/SKILL.md
crates/openfang-skills/bundled/docker/SKILL.md
crates/openfang-skills/bundled/elasticsearch/SKILL.md
crates/openfang-skills/bundled/email-writer/SKILL.md
crates/openfang-skills/bundled/figma-expert/SKILL.md
crates/openfang-skills/bundled/gcp/SKILL.md
crates/openfang-skills/bundled/git-expert/SKILL.md
crates/openfang-skills/bundled/github/SKILL.md
crates/openfang-skills/bundled/golang-expert/SKILL.md
crates/openfang-skills/bundled/graphql-expert/SKILL.md
crates/openfang-skills/bundled/helm/SKILL.md
crates/openfang-skills/bundled/interview-prep/SKILL.md
crates/openfang-skills/bundled/jira/SKILL.md
crates/openfang-skills/bundled/kubernetes/SKILL.md
crates/openfang-skills/bundled/linear-tools/SKILL.md
crates/openfang-skills/bundled/llm-finetuning/SKILL.md
crates/openfang-skills/bundled/ml-engineer/SKILL.md
crates/openfang-skills/bundled/mongodb/SKILL.md
crates/openfang-skills/bundled/nextjs-expert/SKILL.md
crates/openfang-skills/bundled/nginx/SKILL.md
crates/openfang-skills/bundled/notion/SKILL.md
crates/openfang-skills/bundled/oauth-expert/SKILL.md
crates/openfang-skills/bundled/openapi-expert/SKILL.md
crates/openfang-skills/bundled/postgres-expert/SKILL.md
crates/openfang-skills/bundled/presentation/SKILL.md
crates/openfang-skills/bundled/project-manager/SKILL.md
crates/openfang-skills/bundled/prometheus/SKILL.md
crates/openfang-skills/bundled/prompt-engineer/SKILL.md
crates/openfang-skills/bundled/python-expert/SKILL.md

Metadata

Files
0
Version
acf2587
Hash
bc44d96b
Indexed
2026-08-20 07:38

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-21 20:29
浙ICP备14020137号-1 $mapa de visitantes$