LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: xep007

请求一张IPTABLES配置

[复制链接]
 楼主| 发表于 2004-7-8 16:29:28 | 显示全部楼层
真奇怪,还是不行!
发表于 2004-7-8 16:32:25 | 显示全部楼层
最初由 xep007 发表
真奇怪,还是不行!

怎么了?详细情况!
 楼主| 发表于 2004-7-8 16:56:39 | 显示全部楼层
没有什么详细情况,就是IE显示“该页无法显示”!这是我的rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
#/sbin/firewall start
modprobe ip_tables
modprobe ip_nat_ftp
modprobe ip_conntrack
modprobe ip_conntrack_ftp
echo "1">/proc/sys/net/ipv4/ip_forward
#把80端口的包全部转向3128端口
iptables -t nat -A PREROUTING -s 192.168.10.0/24 -p tcp --dport 80 -j REDIRECT --to-ports 3128
发表于 2004-7-8 17:27:11 | 显示全部楼层
默认的squid是不能用的!要配置一下!搜索论坛squid
 楼主| 发表于 2004-7-8 17:29:07 | 显示全部楼层
最初由 smile787 发表
默认的squid是不能用的!要配置一下!搜索论坛squid

我设置过squid了,应该只是IP端口转向的问题吧。因为我只要在IE中设置代理服务器为192.168.10.100:3128(这是我的代理服务器IP和端口),那么就可以上了!
发表于 2004-7-8 17:51:48 | 显示全部楼层
那可能是nat的问题!
iptables -L看看
 楼主| 发表于 2004-7-8 17:58:19 | 显示全部楼层
[root@online root]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
这个我可是真的不懂了!请继续关心!
 楼主| 发表于 2004-7-8 18:04:44 | 显示全部楼层
还有我的lsmod显示如下:
[root@online root]# lsmod
Module                  Size  Used by    Not tainted
ipt_REDIRECT            1368   4  (autoclean)
ip_conntrack_ftp        5232   1  (autoclean)
ip_nat_ftp              3728   0  (unused)
iptable_nat            21880   2  [ipt_REDIRECT ip_nat_ftp]
ip_conntrack           27304   2  [ipt_REDIRECT ip_conntrack_ftp ip_nat_ftp iptable_nat]
iptable_filter          2412   0  (autoclean) (unused)
ip_tables              15776   5  [ipt_REDIRECT iptable_nat iptable_filter]
via-rhine              16336   2
mii                     3976   0  [via-rhine]
crc32                   3712   0  [via-rhine]
ide-scsi               12208   0
scsi_mod              108968   1  [ide-scsi]
ide-cd                 35680   0
cdrom                  33696   0  [ide-cd]
keybdev                 2976   0  (unused)
mousedev                5524   0  (unused)
hid                    22212   0  (unused)
input                   5888   0  [keybdev mousedev hid]
usb-uhci               26412   0  (unused)
usbcore                79392   1  [hid usb-uhci]
ext3                   91592   1
jbd                    52336   1  [ext3]
[root@online root]#
发表于 2004-7-8 19:31:37 | 显示全部楼层
iptables -t nat -A PREROUTING -s 192.168.10.0/24 -p tcp --dport 80 -j REDIRECT --to-ports 3128
这个不加载可以上网吗?看你前面说已经做的了nat上网,那么你单单用squid也可以上网了,那么加了这个是不会有什么影响,除了你关闭了localhost的squid的请求,其他也没可能,你先一步步来试,我们才知道那个环节出了问题!!

确认不开squid可以上网,然后确认squid可以通过本机的上网请求!
 楼主| 发表于 2004-7-8 23:08:18 | 显示全部楼层
smile787兄弟的确热心!我明天再试试!不管怎么说,除了北南南北,你是我在这个坛子上碰到的最热心的人了!太感谢您了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表