Skip to content

Commit 4149c09

Browse files
committed
添加了iptables的一写用法,修改了ignore文件
1 parent c85c9ac commit 4149c09

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
*.swp
12
build/*
3+
_build/*

mush.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
==================================================
33
蘑菇碎碎念
44
==================================================
5+
56
vim插件及使用
67
-----------------------
78

@@ -14,3 +15,25 @@ vim插件及使用
1415
2. 使用pyflakes进行语法检查
1516

1617
:SyntasticCheck pyflakes
18+
19+
iptables
20+
-----------------------
21+
1. 列出所有规则
22+
23+
`iptables -nvL -t nat --line-number`
24+
25+
列出nat表的所有规则并显示行号
26+
27+
#. 删除
28+
29+
`iptables -t nat -D DOCKER 13`
30+
31+
删除nat表DOCKER链的第13行的规则
32+
33+
#. 用iptables给Docker添加端口映射
34+
35+
`iptables -t nat -A DOCKER --in-interface \!docker0 -p tcp --dport 6666 -j DNAT --to 172.17.0.5:6666`
36+
37+
docker会在系统中创建一个叫docker0的网卡,本例中172.17.0.5就是docker0的IP地址
38+
39+

0 commit comments

Comments
 (0)