Unifix knowledge database - The original one

Dashboard - News - Search - List - About - Admin


CoooL's router

Author:coool - Sun Mar 23 15:32:38 2003

#!/bin/sh

  # default
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

  # flush
iptables -t filter -F INPUT
iptables -t filter -F FORWARD
iptables -t filter -F OUTPUT
iptables -t nat -F PREROUTING
iptables -t nat -F POSTROUTING

  # aktivere masquerade

iptables -t nat -A POSTROUTING -j MASQUERADE -p icmp
iptables -t nat -A POSTROUTING -j MASQUERADE -p udp
iptables -t nat -A POSTROUTING -j MASQUERADE -p tcp


iptables -t nat -A PREROUTING -s ! 10.4.0.0/16 -p tcp --dport 20 -j DNAT --to-destination 10.4.0.3
iptables -t nat -A PREROUTING -s ! 10.4.0.0/16 -p tcp --dport 21 -j DNAT --to-destination 10.4.0.3
iptables -t nat -A PREROUTING -s ! 10.4.0.0/16 -p tcp --dport 22 -j DNAT --to-destination 10.4.0.3
iptables -t nat -A PREROUTING -s ! 10.4.0.0/16 -p tcp --dport 25 -j DNAT --to-destination 10.4.0.3
iptables -t nat -A PREROUTING -s ! 10.4.0.0/16 -p tcp --dport 80 -j DNAT --to-destination 10.4.0.3
iptables -t nat -A PREROUTING -s ! 10.4.0.0/16 -p tcp --dport 110 -j DNAT --to-destination 10.4.0.3
Copyright(c) Unifix.org 2002-2011


Dashboard - News - Search - List - About - Admin
 
Powered by Mikjaer Consulting Solutions - Hosted by Specialhosting.dk