文档详情

防火墙补充(Firewall supplement).doc

发布:2017-08-16约9.49千字共13页下载文档
文本预览下载声明
防火墙补充(Firewall supplement) iptable F输入/前进/输出 iptables - T - F(删除的是NAT NAT表)和iptables -F(删除的是滤波器表) iptable的NAT表的输出链条是指本地发送出去的数据包 iptables -P后面加什么协议,可以加,TCP,UDP,ICMP、IP、/等/协议 iptables -向前- P!TCP TCP协议以外的其他协议除了滴------- [J]. iptables的P选项必须放在地址定义及端口定义的前面 用数字表示端口,iptables - L - N iptables -输入我的ETH + J滴------“eth +“代表所有ETH开头的网卡 iptables -输入-我!eth0 J滴------”!“代表所有非eth0网卡eth0 为什么-我在iptables -L中看不到呢???可以用V选项看得到!!! 也可以用在端口处! 参数米多,源端口22,53,80110 说明用来比对不连续的多个来源端口号,一次最多可以比对15个端口,可以使用!运算子进 行反向比对。 参数米多——目的港 范例iptables -输入-p tcp米多,目的港22,53,80110 说明用来比对不连续的多个目的地端口号,设定方式同上。 参数米多端口 范例iptables -输入- P的TCP端口22,53,80110 M多 说明这个参数比较特殊,用来比对来源端口号和目的端口号相同的封包,设定方式同上。注意: 在本范例中,如果来源端口号为80但目的地端口号为110,这种封包并不算符合条件。 J选项可以接后面的关键字选项或者是自定义链条(iptables -输入的原文: J虚线框,虚线框是自定义链条)。 G后面也可以接自定义链条 J是跳,跳到别的链之后还回来 G是goto,一去不复返 如果数据包不匹配,J还回来,G就结束了 自定义链条: 1、命令-N,--新的链 范例iptables N允许 说明定义新的规则链。 2、命令- E -重命名链 范例iptables -允许不允许 说明修改某自订规则链的名称。 3、命令X -删除链 范例iptables X允许 说明删除某个规则链。 1、拒绝拦阻该封包,并传送封包通知对方 2、滴丢弃封包不予处理 3、重定向将封包重新导向到另一个端口(DNAT),进行完此处理动作后,将会继续比对其它规 则。这个功能可以用来实作通透式代理或用来保护Web服务器。例如:iptables NAT - T PREROUTING -p tcp - 80 - J -运动重定向端口8080 Only applies to the PREROUTING and OUTPUT chains of the NAT table, and the user-defined chains that only call them. It modifies the directorys contents Label the IP address to send the packet to the machine itself (the locally generated package is placed as address ). It contains an option: --to-ports port[port] Specifies the destination port or port range used: if not specified, the destination port will not be modified. Can only be used to specify -p, TCP, or -p UDP rules. 4, MASQUERADE rewrite packet source IP for firewall NIC IP, you can specify the scope of the port corresponding, complete this process After the action, jump directly down a regular chain (mangle:postrouting). This function is slightly different from SNAT, when IP pseudo is performed When installed, do not need to specify which disguised as IP, IP can be read directly from the card, when using a dial-up connecti
显示全部
相似文档