#!/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.
------------------
/etc/sysconfig/iptables
# Firewall configuration written by redhat-config-securitylevel
# Manual customization of this file is not recommended.
*mangle
REROUTING ACCEPT [0]
:OUTPUT ACCEPT [0]
COMMIT
*nat
REROUTING ACCEPT [0]
OSTROUTING ACCEPT [0]
:OUTPUT ACCEPT [0]
[0] -A PREROUTING -s 192.192.192.0/255.255.255.0 -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
[0] -A PREROUTING -s 192.192.192.0/255.255.255.0 -i eth0 -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 3128
[0] -A POSTROUTING -s 192.192.192.0/255.255.255.0 -j MASQUERADE
#[0] -A POSTROUTING -s 192.168.20.32/255.255.255.240 -j SNAT --to 211.148.130.133
COMMIT
#
*filter
:INPUT ACCEPT [0]
:FORWARD ACCEPT [0]
:OUTPUT ACCEPT [0]
:RH-Firewall-1-INPUT - [0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
#
[0] -A INPUT -s 207.46.0.0/255.255.0.0 -j DROP
[0] -A INPUT -d 207.46.0.0/255.255.0.0 -j DROP
[0] -A INPUT -s 255.255.255.255 -i eth0 -j DROP
[0] -A INPUT -s 224.0.0.0/224.0.0.0 -i eth0 -j DROP
[0] -A INPUT -d 0.0.0.0 -i eth0 -j DROP
[0] -A INPUT -p tcp -m tcp --sport 5000 -j DROP
[0] -A INPUT -p udp -m udp --sport 5000 -j DROP
[0] -A OUTPUT -p tcp -m tcp --dport 5000 -j DROP
[0] -A OUTPUT -p udp -m udp --dport 5000 -j DROP
[0] -A INPUT -s 外网IP -i eth1 -p tcp -m tcp --dport 137:139 -j DROP
[0] -A INPUT -s 外网IP -i eth1 -p udp -m udp --dport 137:139 -j DROP
[0] -A INPUT -s 192.192.192.0/255.255.255.0 -i eth0 -p tcp -m tcp --dport 137:139 -j ACCEPT
[0] -A INPUT -s 192.192.192..0/255.255.255.0 -i eth0 -p udp -m udp --dport 137:139 -j ACCEPT
[0] -A INPUT -s 外网IP/255.255.255.240 -i eth1 -p tcp -m tcp --dport 137:139 -j ACCEPT
[0] -A INPUT -s 外网IP/255.255.255.240 -i eth1 -p udp -m udp --dport 137:139 -j ACCEPT
[0] -A INPUT -p tcp -m tcp --dport 137:139 -j DROP
[0] -A INPUT -p udp -m udp --dport 137:139 -j DROP