Update iptables.md

This commit is contained in:
小弟调调™ 2017-07-19 03:02:40 +08:00 committed by GitHub
parent 318c3e54f6
commit 60af6fb4aa
1 changed files with 22 additions and 21 deletions

View File

@ -68,31 +68,32 @@ iptables -t 表名 <-A/I/D/R> 规则链名 [规则号] <-i/o 网卡名> -p 协
```bash ```bash
┎╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍┓ ┎╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍┓
┌───────────────┐ ┃ Network ┃ ┌───────────────┐ ┃ Network ┃
│ table: filter │ ┖━━━━━━━━━━━━━━┛ │ table: filter │ ┖━━━━━━━━━━━━━━┛
│ chain: INPUT ◀────┐ │ chain: INPUT ◀────┐ │
└───────┬───────┘ │ │ └───────┬───────┘ │ ▼
│ ┌─────────▼─────────┐ │ ┌───────────────────┐
┌ ▼ ┐ │ table: nat │ ┌ ▼ ┐ │ table: nat │
│local process│ │ chain: PREROUTING │ │local process│ │ chain: PREROUTING │
└ ┘ └─────────┬─────────┘ └ ┘ └─────────┬─────────┘
▼ ┌─────────────────┐ ▼ ┌─────────────────┐
┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅ ┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅ │table: nat │ ┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅ ┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅ │table: nat │
Routing decision └───── outing decision ─────▶│chain: PREROUTING│ Routing decision └───── outing decision ─────▶│chain: PREROUTING│
┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅ ┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅ └────────┬────────┘ ┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅ ┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅ └────────┬────────┘
│ │ │ │
┌──────────────┐ │ ┌──────────────┐ │
│ table: nat │ ┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅ │ │ table: nat │ ┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅ │
│ chain: OUTPUT │ ┌─────▶ outing decision ◀──────────────┘ │ chain: OUTPUT │ ┌─────▶ outing decision ◀──────────────┘
└───────┬───────┘ │ ┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅ └───────┬───────┘ │ ┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
│ │ │ │ │ │
┌───────▼───────┐ │ ┌──────────▼─────────┐ ▼ │ ▼
│ table: filter │ │ │ table: nat │ ┌───────────────┐ │ ┌────────────────────┐
│ chain: OUTPUT ├────┘ │ chain: POSTROUTING │ │ table: filter │ │ │ chain: POSTROUTING │
└───────────────┘ └──────────┬─────────┘ │ chain: OUTPUT ├────┘ └──────────┬─────────┘
└───────────────┘ │
┎╍╍╍╍╍╍╍▼╍╍╍╍╍╍╍┓
┎╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍┓
┃ Network ┃ ┃ Network ┃
┖━━━━━━━━━━━━━━━┛ ┖━━━━━━━━━━━━━━━┛
``` ```