postrouting 链 是将本地ip地址伪装成公网ip地址 要让局域网的机器上网要允许带有内部 IP 地址的 LAN 节点和外部的公共网络通信,需要配置防火墙的 IP 伪装(IP masquerading)。这会把来自 LAN 节点的请求都伪装成防火墙的外部设备(在这个例子中是 eth0)的 IP 地址。该规则使用 NAT 分组匹配表(-t nat),并在防火墙的外部联网设备(-o eth0)上为 NAT 指定内建的 postrouting 链(-A postrouting)。postrouting 允许分组在离...
by crastyl - Linux文档专区 - 2008-10-06 13:02:43 阅读(3012) 回复(0)
我有一个网络环境,有一台电信的ADSL线路连接到我的IDC机房,ADSL的IP地址为 221.10.12.22,所有访问ADSL这台机器80端口的流量都被转到了一台linux机器上这台机器的IP地址为172.16.1.11,但返回的包我想走IDC机房的网通线路,我在linux服务器上配置了如下的规则 iptables -t nat -A postrouting -p tcp -o eth0 -s 172.16.1.11 --sport 80 -j SNAT --to-source 221.10.12.22 以上的这条规则,为什么不能生效呢? 当有外网访问172...
iptables: No chain/target/match by that name iptables: No chain/target/match by that name 可是这两项还是照常用 为什么呢? [ 本帖最后由 lovegqin 于 2006-9-29 16:36 编辑 ]
iptables: No chain/target/match by that name iptables: No chain/target/match by that name 可是这两项还是照常用 为什么呢? [ 本帖最后由 lovegqin 于 2006-9-29 16:36 编辑 ]
iptables -t nat -L postrouting [root@mailgateway etc]# iptables -t nat -L postrouting Chain postrouting (policy ACCEPT) target prot opt source destination SNAT all -- 192.168.0.0/24 anywhere to:218.247.50.18 iptables -t nat -A postrouting -o ppp0 -j MASQUERADE iptables -I FORWARD -s 192.168.0.0/24 -p tcp --dport 21 -j DROP iptables -t filter -L FOR...
我大概清楚一点就是从内网出去的时候用postrouting进来的时候用PREROUTING,可是做透明代理的时候确是用PREROUTING。这是为什么呢?
我大概清楚一点就是从内网出去的时候用postrouting进来的时候用PREROUTING,可是做透明代理的时候确是用PREROUTING。这是为什么呢?
我的防火墙有三快网卡,一块对外连接internet eth0,一块接内网 eth1,一块接DMZ区域eth2。DMZ区域有公网地址。 在防火墙的iptables中有这样一条语句 /sbin/iptables -t nat -A postrouting -o eth0 -j SNAT --to-source $INET_IP 正常使用。 我现在想,DMZ区域不要做SNAT,因为他们本身都有公网ip地址,没有什么意义。防火墙本身因为也有公网地址,他本身上网也不做SNAT动作,只有办公室内部机器,也就是连接eth1的机器进行SNAT...
我的防火墙有三快网卡,一块对外连接internet eth0,一块接内网 eth1,一块接DMZ区域eth2。DMZ区域有公网地址。 在防火墙的iptables中有这样一条语句 /sbin/iptables -t nat -A postrouting -o eth0 -j SNAT --to-source $INET_IP 正常使用。 我现在想,DMZ区域不要做SNAT,因为他们本身都有公网ip地址,没有什么意义。防火墙本身因为也有公网地址,他本身上网也不做SNAT动作,只有办公室内部机器,也就是连接eth1的机器进行SNAT...
#iptables -t nat -A postrouting -s 192.168.0.0/24 -o ppp0
-j MASQUERADE
iptables: No chain/target/match by that name
#iptables -t nat -A postrouting -s 192.168.0.0/24 -o ppp0
-j MASQUERADE --help
MASQUERADE v1.3.1 options:
--to-ports
#iptables -t nat -A postrouting -s 192.168.0.0/24 -o ppp0
-j MASQUERADE
iptables: No chain/target/match by that name
#iptables -t nat -A postrouting -s 192.168.0.0/24 -o ppp0
-j MASQUERADE --help
MASQUERADE v1.3.1 options:
--to-ports