|
|
1、透明代理多是在iptables加两行,如下一问代码内所示,都是把80端口的访问转到3128端口,那么其他服务比如ftp、smtp、pop3的端口怎么办?要不要也写一行?
2、另外我的iptables启动出错,大侠帮我看看是什么问题,谢谢!
[root@amd root]# cat /etc/rc.d/firewall
echo 1 >/proc/sys/net/ipv4/ip_forward
echo "starting iptables rules"
modprobe ip_tables
modprobe ip_nat_ftp
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-ports 3128
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
[root@amd root]# ll /etc/rc.d/firewall
-rwxr--r-- 1 root root 252 Jan 4 19:11 /etc/rc.d/firewall
[root@amd root]#
[root@amd root]# /etc/rc.d/firewall
: No such file or directory /proc/sys/net/ipv4/ip_forward
starting iptables rules
modprobe: Can't locate module ip_tables
modprobe: Can't locate module ip_nat_ftp
'ad argument `
Try `iptables -h' or 'iptables --help' for more information.
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-ports 3128
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
这两个命令我在系统提示符后面单独执行就没有问题,放在一起执行就提示出错:
'ad argument `
Try `iptables -h' or 'iptables --help' for more information.
为什么? |
|