#!/bin/sh
### Enables IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
####### Flush-----------------------
iptables -t filter -F FORWARD
iptables -t filter -F INPUT
####### Forward-----------------------
### basically , all forward packets are dropped.
iptables -t filter -P FORWARD DROP
###Accept all trafic from intranet to internet.
iptables -t filter -A FORWARD -i eth1 -j ACCEPT
### Established connections and Related packets are accepted.
# For exsample, This will allow DNS queries from local
network.
# but not allows incoming DNS queries.
iptables -t filter -A FORWARD -m state --state ESTABLISHED,RELATED
-j ACCEPT
####### PPTP----------------------------
### Allow TCP/IP 1723 port
iptables -t filter -A INPUT -i eth0 -p tcp --dport 1723
-j ACCEPT
### Allow GRE/IP (Protocol number 47)
iptables -t filter -A INPUT -i eth0 -p 47 -j ACCEPT
### Allow all packets from PPTP interface
iptables -t filter -A INPUT -i ppp+ -j ACCEPT
iptables -t filter -A FORWARD -i ppp+ -j ACCEPT
|