|
|
*****已解决******
debian 3.1 内核升级到2.6.8
外网 eth0 192.168.16.2
内网 eht1 192.168.0.1
客户机 win2k3 192.168.0.16
这样做的nat
- yaoxin:~# cat /etc/rc.local
- echo 1 > /proc/sys/net/ipv4/ip_forward
- /sbin/modprobe ip_tables
- /sbin/modprobe iptable_filter
- /sbin/modprobe iptable_nat
- /sbin/modprobe ip_conntrack
- /sbin/modprobe ip_conntrack_ftp
- /sbin/modprboe ip_nat_ftp
- /sbin/iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j MASQUERADE
复制代码
nat正常可用了。。。。
然后安装squid,打算配置成透明代理。。。
squid.conf内容
- yaoxin:~# cat /etc/squid/squid.conf
- http_port 3128
- visible_hostname yaoxin
- cache_dir ufs /usr/spool/squid 500 16 256
- cache_mem 20 MB
- cache_swap_low 90
- cache_swap_high 95
- httpd_accel_host virtual
- httpd_accel_port 80
- httpd_accel_with_proxy on
- httpd_accel_uses_host_header on
- acl all src 0.0.0.0/0.0.0.0
- http_access allow all
复制代码
然后
- #iptables -t nat -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
- #iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
复制代码
执行上面命令后就出问题了。。
在客户机上测试 可以访问DNS服务器,可以访问FTP服务器(也就是说可以访问53和21端口),但是不能访问80端口。。。
好像是nat可以正常用。。 squid出了问题。。
在日志里发现了这个
- May 4 09:34:44 yaoxin squid[1772]: Squid Parent: child process 1774 started
- May 4 09:34:44 yaoxin squid[1772]: Squid Parent: child process 1774 exited due to signal 6
- May 4 09:34:47 yaoxin squid[1772]: Squid Parent: child process 1865 started
- May 4 09:34:48 yaoxin squid[1772]: Squid Parent: child process 1865 exited due to signal 6
- May 4 09:34:51 yaoxin squid[1772]: Squid Parent: child process 1868 started
- May 4 09:34:51 yaoxin squid[1772]: Squid Parent: child process 1868 exited due to signal 6
- May 4 09:34:54 yaoxin squid[1772]: Squid Parent: child process 1871 started
- May 4 09:34:54 yaoxin squid[1772]: Squid Parent: child process 1871 exited due to signal 6
- May 4 09:34:57 yaoxin squid[1772]: Squid Parent: child process 1874 started
- May 4 09:34:57 yaoxin squid[1772]: Squid Parent: child process 1874 exited due to signal 6
复制代码
搞定了。。 |
|