- 论坛徽章:
- 0
|
# Generated by iptables-save v1.2.11 on Tue Sep 5 10:19:04 2006
*filter
:INPUT DROP [170116:13325405]
:FORWARD DROP [733792:429318152]
:OUTPUT ACCEPT [10254:2192484]
-A INPUT -s 192.168.10.46 -i eth0 -j ACCEPT
-A INPUT -s 192.168.10.251 -i eth0 -j ACCEPT
-A INPUT -s 192.168.10.241 -i eth0 -j ACCEPT
-A INPUT -s 192.168.10.3 -i eth0 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A FORWARD -s 192.168.10.15 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.46 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.9 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.10 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.11 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.12 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.13 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.17 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.19 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.20 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.22 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.23 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.24 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -d 192.168.10.24 -m limit --limit 96/sec --limit-burst 192 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -s 192.168.10.26 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.27 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.28 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.29 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.30 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.31 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.32 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.33 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.35 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.37 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.38 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.39 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.40 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.41 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.42 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.43 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.45 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.49 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.62 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.70 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.74 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.75 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.76 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.77 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.78 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.79 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.80 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.82 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.83 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.87 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.88 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.92 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.99 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.101 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.113 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.114 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.119 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.121 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.125 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -d 192.168.10.125 -m limit --limit 128/sec --limit-burst 192 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -s 192.168.10.131 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.134 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.151 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.163 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.166 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.167 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.173 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.178 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.183 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.193 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.195 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.199 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.200 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.209 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.216 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.233 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.239 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.240 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.241 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.246 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.251 -m limit --limit 96/sec --limit-burst 192 -j ACCEPT
-A FORWARD -s 192.168.10.160 -j ACCEPT
-A FORWARD -s 192.168.10.205 -j ACCEPT
-A FORWARD -s 192.168.10.234 -j ACCEPT
-A FORWARD -s 192.168.10.238 -j ACCEPT
-A FORWARD -s 192.168.10.247 -j ACCEPT
-A FORWARD -d 192.168.10.0/255.255.255.0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -d 169.254.0.0/255.255.0.0 -j DROP
-A OUTPUT -s 169.254.0.0/255.255.0.0 -j DROP
COMMIT
# Completed on Tue Sep 5 10:19:04 2006
# Generated by iptables-save v1.2.11 on Tue Sep 5 10:19:04 2006
*nat
REROUTING ACCEPT [441089:37705425]
OSTROUTING ACCEPT [8:528]
:OUTPUT ACCEPT [8:528]
-A POSTROUTING -s 192.168.10.0/255.255.255.0 -o eth1 -j MASQUERADE
COMMIT
# Completed on Tue Sep 5 10:19:04 2006
需求就是把内网的10.241的某些端口映射到外部某个ip,比如2xx.xxx.xxx.59。我试过多次总是有问题:
iptables -t nat -I PREROUTING -d 2*.*.*.59 -p tcp --dport 80 -j DNAT --to 192.168.10.241:80
iptables -t nat -I POSTROUTING -d 192.168.*.241 -p tcp --dport 80 -j SNAT --to 2*.*.*.59:80
iptables -I FORWARD -d 192.168.10.241 -j ACCEPT
iptables -I FORWARD -d 2*.*.*.59 -j ACCEPT
结果不行……后来怕是因为80服务有其他因素影响,改用3389端口做实验还是没成功……
另外还有个奇怪的事情,我的路由表老是有169.254.0.0/16段的地址,可以看到我已经禁止这个地址的转发了,但是我从交换机的ip表里面还是可以看到169.254.*.*的ip从连接nat服务器的端口出来,怪异! |
|