软件部访问外网时使用squid代理 [root@localhost ~]# iptables -t nat -A PREROUTING -m iprange --src-range 192.168.20.21-192.168.20.30 -p tcp --dport 80 -j REDIRECT --to-port 3128 编辑squid配置文件 允许流量通过squid端口进入防火墙查看缓存 [root@localhost ~]# iptables -t filter -A INPUT -p tcp --dport 3128 -j ACCEPT [root@localhost ~]# iptables -t filter -A INPUT -m state --state ESTABLISHED -j ACCEPT 允许squid使用自己的地址去访问外部网络 [root@localhost ~]# iptables -t filter -A OUTPUT -p tcp --dport 80 -j ACCEPT [root@localhost ~]# iptables -t filter -A OUTPUT -m state --state ESTABLISHED -j ACCEPT 允许软件部和经理办通过eth2的流量能够使用外部dns [root@localhost ~]# iptables -t filter -A FORWARD -m iprange --src-range 192.168.20.21-192.168.20.40 -p udp --dport 53 -o eth2 -j ACCEPT [root@localhost ~]# vim /etc/resolv.conf [root@localhost ~]# vim /etc/squid/squid.conf [root@localhost ~]# iptables -t filter -A OUTPUT -p udp --dport 53 -j ACCEPT [root@localhost ~]# vim /etc/squid/squid.conf [root@localhost ~]# vim /etc/squid/squid.conf [root@localhost ~]# vim /etc/squid/squid.conf 经理办上班时间不受限制 [root@localhost ~]# iptables -t filter -A FORWARD -m iprange --src-range 192.168.20.31-192.168.20.40 -m time --timestart 08:00 --timestop 20:00 --weekdays Mon,Tue,Wed,Thu,Fri -p tcp --dport 80 -o eth2 -j ACCEPT DMZ 允许来自eth2端口的访问能够访问到dmz区域的192.168.3.200的3389端口 [root@localhost ~]# iptables -t nat -A PREROUTING -i eth2 -d 192.168.102.200 -p tcp --dport 3389 -j DNAT --to 192.168.3.200 [root@localhost ~]# iptables -t filter -A FORWARD -d 192.168.3.200 -p tcp --dport 3389 -j ACCEPT
|
|