#! /Bin/bash
/Sbin/iptables-F INPUT
/Sbin/iptables-Z INPUT
/Sbin/iptables-P INPUT ACCEPT
/Sbin/iptables-a input-m state -- state INVALID-j DROP
/Sbin/iptables-a input-p icmp-j ACCEPT
/Sbin/iptables-a input-I lo-j ACCEPT
/Sbin/iptables-a input-p tcp-m state -- state NEW, RELATED, ESTABLISHED-m tcp -- dport 22-j ACCEPT
/Sbin/iptables-a input-p tcp-m state -- state NEW, RELATED, ESTABLISHED-m tcp -- dport 80-j ACCEPT
/Sbin/iptables-a input-p tcp-m state -- state NEW, RELATED, ESTABLISHED-m tcp -- dport 1723-j ACCEPT
/Sbin/iptables-a input-p gre-m state -- state NEW, RELATED, ESTABLISHED-j ACCEPT
/Sbin/iptables-a input-p udp-m policy -- dir in -- pol ipsec-m udp -- dport 1701-j ACCEPT
/Sbin/iptables-a input-p udp-m udp -- dport 1701-j ACCEPT
/Sbin/iptables-a input-p udp-m udp -- dport 500-j ACCEPT
/Sbin/iptables-a input-p udp-m udp -- dport 4500-j ACCEPT
/Sbin/iptables-a input-p esp-j ACCEPT
/Sbin/iptables-a input-m policy -- dir in -- pol ipsec-j ACCEPT
/Sbin/iptables-a input-m state -- state RELATED, ESTABLISHED-j ACCEPT
/Sbin/iptables-a input-j REJECT -- reject-with icmp-host-prohibited
/Sbin/iptables-F FORWARD
/Sbin/iptables-Z FORWARD
/Sbin/iptables-P FORWARD ACCEPT
/Sbin/iptables-a forward-m state -- state INVALID-j DROP
#/Sbin/iptables-a forward-m policy -- dir in -- pol ipsec-j ACCEPT
/Sbin/iptables-a forward-d 10.0.10.0/24-j ACCEPT
/Sbin/iptables-a forward-s 10.0.10.0/24-j ACCEPT
/Sbin/iptables-a forward-I ppp +-m state -- state NEW, RELATED, ESTABLISHED-j ACCEPT
/Sbin/iptables-a forward-m state -- state RELATED, ESTABLISHED-j ACCEPT
/Sbin/iptables-a forward-j REJECT -- reject-with icmp-host-prohibited
/Sbin/iptables-F OUTPUT
/Sbin/iptables-Z OUTPUT
/Sbin/iptables-P OUTPUT ACCEPT
/Sbin/iptables-a output-m state -- state INVALID-j DROP
/Sbin/iptables-F-t nat
/Sbin/iptables-Z-t nat
/Sbin/iptables-t nat-a postrouting-s 10.0.10.0/24-o eth0-j MASQUERADE