金鳞

目标->软件测试架构师

Question1:
oracle-sun(290935297)  10:49:17
有人知道吗我想往 防火墙里面加入一个新的端口8081但是按着网上的加不进去。
None_N苇不航<flowdragon@qq.com>  10:51:37
iptables -I INPUT1 -p tcp --dport 80 -j ACCEPT
None_N苇不航<flowdragon@qq.com>  10:51:57
dport要指名协议
oracle-sun(290935297)  10:56:27
在问一下,用命令加入了怎么保存?
None_N苇不航<flowdragon@qq.com>  10:56:54
service iptables save

None_N苇不航<flowdragon@qq.com>  11:04:18
jump 下一个运作
as3-木头人(445498529)  11:04:32
--insert  -I chain [rulenum]
None_N苇不航<flowdragon@qq.com>  11:04:33
INPUT 是进入链,1是规则1
as3-木头人(445498529)  11:04:55
INPUT1是这次的规则名称
as3-木头人(445498529)  11:05:39
-j ACCEPT 是jump to ACCEPT
as3-木头人(445498529)  11:05:57
也就是说如果INPUT1 通过了, 就逃至ACCEPT的规则校验

as3-木头人(445498529)  11:06:55
iptables v1.2.11

Usage: iptables -[AD] chain rule-specification [options]
       iptables -[RI] chain rulenum rule-specification [options]
       iptables -D chain rulenum [options]
       iptables -[LFZ] [chain] [options]
       iptables -[NX] chain
       iptables -E old-chain-name new-chain-name
       iptables -P chain target [options]
       iptables -h (print this help information)

Commands:
Either long or short options are allowed.
  --append  -A chain            Append to chain
  --delete  -D chain            Delete matching rule from chain
  --delete  -D chain rulenum
                                Delete rule rulenum (1 = first) from chain
  --insert  -I chain [rulenum]
                                Insert in chain as rulenum (default 1=first)
  --replace -R chain rulenum
                                Replace rule rulenum (1 = first) in chain
  --list    -L [chain]          List the rules in a chain or all chains
  --flush   -F [chain]          Delete all rules in  chain or all chains
  --zero    -Z [chain]          Zero counters in chain or all chains
  --new     -N chain            Create a new user-defined chain
  --delete-chain
            -X [chain]          Delete a user-defined chain
  --policy  -P chain target
                                Change policy on chain to target
  --rename-chain
            -E old-chain new-chain
                                Change chain name, (moving any references)
Options:
  --proto       -p [!] proto    protocol: by number or name, eg. `tcp'
  --source      -s [!] address[/mask]
                                source specification
  --destination -d [!] address[/mask]
                                destination specification
  --in-interface -i [!] input name[+]
                                network interface name ([+] for wildcard)
  --jump        -j target
                                target for rule (may load target extension)
  --match       -m match
                                extended match (may load extension)
  --numeric     -n              numeric output of addresses and ports
  --out-interface -o [!] output name[+]
                                network interface name ([+] for wildcard)
  --table       -t table        table to manipulate (default: `filter')
  --verbose     -v              verbose mode
  --line-numbers                print line numbers when listing
  --exact       -x              expand numbers (display exact values)
[!] --fragment  -f              match second or further fragments only
  --modprobe=<command>          try to insert modules using this command
  --set-counters PKTS BYTES     set the counter during insert/append
[!] --version   -V              print package version.


perl_小新(147551562)  11:07:54
介意我把你们的QQ号写到我blog里吗
perl_小新(147551562)  11:07:59
默认表示不介意

---as3-木头人(445498529)  11:08:26
不介意
---None_N苇不航<flowdragon@qq.com>  11:13:29
完全介意


Question2:

 oracle-sun(290935297)  11:17:50
为什么我在命令行里面删除了在保存从新启动了,还是在这里能看见
perl_小新(147551562)  11:18:12
咋删的?- -
perl_小新(147551562)  11:18:18
没听说你要删除
oracle-sun(290935297)  11:18:23

oracle-sun(290935297)  11:18:38
iptables -D RH-Firewall-1-INPUT -m state --state NEW  -p tcp --dport 8081 -j ACCEPT
oracle-sun(290935297)  11:18:53
然后service iptables save
oracle-sun(290935297)  11:19:00
service iptables restart
perl_小新(147551562)  11:19:10
为啥你不直接用右侧的添加和删除呢
oracle-sun(290935297)  11:19:30
因为要远程一个
None_N苇不航<flowdragon@qq.com>  11:19:12
iptables -L 看一下
oracle-sun(290935297)  11:19:48
iptables -L的看不见了
oracle-sun(290935297)  11:20:02
但是图形下看得见
 None_N苇不航<flowdragon@qq.com>  11:20:52
。。。。
oracle-sun(290935297)  11:21:21

oracle-sun(290935297)  11:21:38

oracle-sun(290935297)  11:21:49
怎么都不同步
oracle-sun(290935297)  11:22:06
还是我的命令有问题?
None_N苇不航<flowdragon@qq.com>  11:22:31
你是不是把那窗口关了再开次啊
oracle-sun(290935297)  11:22:46
是的
oracle-sun(290935297)  11:24:46
而且我加入的在上面
oracle-sun(290935297)  11:25:08
就是那个 tcp dpt:tproxy
oracle-sun(290935297)  11:24:57

oracle-sun(290935297)  11:25:12
那行
oracle-sun(290935297)  11:25:22
他加入的在倒数第二行
oracle-sun(290935297)  11:25:35
就是上面
None_N苇不航<flowdragon@qq.com>  11:33:41
你是说你删除了,图形下还有对么
oracle-sun(290935297)  11:33:52
对的
oracle-sun(290935297)  11:34:18
刚才无意中发现的。另外一个机房在300多公里以外。现在不知道怎么弄了
None_N苇不航<flowdragon@qq.com>  11:34:46
图形下的关了再开呢
oracle-sun(290935297)  11:34:55
一样的
oracle-sun(290935297)  11:35:22
我已经弄过了。图形的配置可以同步过来。命令行的配置同步不过去

oracle-sun(290935297)  11:35:34
iptables -I RH-Firewall-1-INPUT -m state --state NEW  -p tcp --dport 8081 -j ACCEPT 
oracle-sun(290935297)  11:35:42
我是用这个命令加的
None_N苇不航<flowdragon@qq.com>  11:36:09
。。。I的位置在哪
None_N苇不航<flowdragon@qq.com>  11:36:14
默认加在最后哦
Shell_un(38un.com)(270777526)  11:37:48
把iptable写在一个脚本文件  然后在开机启动脚本里 加入这个脚本
oracle-sun(290935297)  11:38:32
好的

posted on 2009-09-24 11:13 金鳞 阅读(610) 评论(0)  编辑 收藏 引用 所属分类: *nix
只有注册用户登录后才能发表评论。