我有一个充当路由器,DHCP服务器和代理的Linux机器。 在我的LAN端,我需要两个子网有足够的IP:192.168.100.0 – 192.168.101.255 – 是我需要的范围。 这两个子网必须能够通过我的Linux机箱到达互联网,
在eth1(em1)我有我的互联网调制解调器与静态IP连接。
在eth2(em2)上,我的局域网连接了以下设置:
我的路由表如下:
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 56343ffe.rev.st 0.0.0.0 UG 0 0 0 em1 86.52.0.0 * 255.255.192.0 U 1 0 0 em1 192.168.100.0 * 255.255.254.0 U 1 0 0 em2 192.168.101.0 * 255.255.255.0 U 0 0 0 em2
所有来自80端口的stream量都被redirect到shorewall的代理服务器上,而且工作正常 – 所有主机都可以访问网站,YouTube等(端口80)。 所有其他stream量都被伪装 – 但是到其他端口的stream量是一个问题 – 例如,微软的DRM许可证服务器AVG更新服务器 – 无法访问! 但是我相信路由表中有些东西是错误configuration的? redirect端口80通信后,我的防火墙接受所有出站通信。
编辑 – 从我的防火墙输出(我用xxx.xxx替代了互联网地址中的数字):
Chain PREROUTING (policy ACCEPT) target prot opt source destination dnat all -- anywhere anywhere Chain INPUT (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination em1_masq all -- anywhere anywhere Chain dnat (1 references) target prot opt source destination loc_dnat all -- anywhere anywhere Chain em1_masq (1 references) target prot opt source destination SNAT all -- 192.168.100.0/24 anywhere to:86.52.xxx.xxx SNAT all -- 192.168.101.0/24 anywhere to:86.52.xxx.xxx Chain loc_dnat (1 references) target prot opt source destination REDIRECT tcp -- 192.168.100.0/24 anywhere multiport dports http,squid redir ports 8080 REDIRECT tcp -- 192.168.101.0/24 anywhere multiport dports http,squid redir ports 8080
你将不得不NAT(伪装)他们。
那你失败了
你说这是伪装的,但显然这是行不通的。
(80端口的工作,因为它被代理。)
NAT或防火墙上有一些configuration(可能是两个)不正确。
PS你不需要最后的路由线路。 它已经被上面的那个覆盖了。