荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: newdonger@bbs.pku.edu.cn (hereIam>>), 信区: Linux
标  题: squid知识[4]
发信站: 北大未名站 (Sat Oct 19 04:20:56 2002)
转信站: SZU!news.tiaozhan.com!news.happynet.org!PKU

统启动时自动启动squid服务器。
4.iptables的设置
  在/etc/rc.d/目录下用touch命令建立firewall文件,执行chmod
u+x firewll以更改文件属性,编辑/etc/rc.d/rc.local文件,在末尾
加上/etc/rc.d/firewall以确保开机时能自动执行该脚本。
  firewall文件内容为:
  #!/bin/sh
  echo "Enabling IP Forwarding..."
  echo 1 > /proc/sys/net/ipv4/ip_forward
  echo "Starting iptables rules..."
  #Refresh all chains
  /sbin/iptables -F -t nat
  iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp
      --dport 80 -j REDIRECT --to-ports 3128
  iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o
      eth1 -j SNAT --to-source 200.200.200.200
  如果需要还可以添加一些防火墙规则以增强安全性,具体参考:
http://www.linuxaid.com.cn/engineer/bye2000/doc/iptables1.htm

http://www.linuxaid.com.cn/engineer/bye2000/doc/iptables2.htm


--
绿蚁新醅酒          □ ┏┓╔╦╧═╧╗           ╱■         water╲
   红泥小火炉       ▓ ▓┗▓╙▓  │●    │   ╱  ■      ╔══╗○╲
      晚来天欲雪    ▓ ▓  ▓  ▓  │●oil │ ╱╳▎      │●│╲║○╱
         能饮一杯无 *▲ ▓  ▓  ▓  ╰───╯   ╳▎╔╤╗│●│  ╲╱
                   fire                     ╔═╳▎╝  ●╰─╯
                             石油:是炼出来的?挖出来的?灌出来的?!!!


※ 来源:·北大未名站 bbs.pku.edu.cn·[FROM: 162.105.52.117]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店