Results 1 to 1 of 1
I've consulted a number of guides, switched a number of rules about, everything else works fine, I just cannot get the ports to forward.
Here be my current script:
Code:
...
- 10-11-2006 #1Linux Newbie
- Join Date
- Jun 2005
- Location
- Whitstable, Kent, England
- Posts
- 136
Port forwarding still not working
I've consulted a number of guides, switched a number of rules about, everything else works fine, I just cannot get the ports to forward.
Here be my current script:
Thanks in advance.Code:#! /bin/sh echo 0 > /proc/sys/net/ipv4/ip_forward export LAN=eth0 export WAN=eth1 iptables -t nat -F POSTROUTING iptables -t nat -F PREROUTING iptables -t nat -F OUTPUT iptables -F iptables -P INPUT DROP iptables -P FORWARD DROP iptables -P OUTPUT ACCEPT iptables -A FORWARD -j ACCEPT -p tcp --dport 59927 iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 59927 -j DNAT --to 10.1.2.100:59927 iptables -A FORWARD -j ACCEPT -p udp --dport 59927 iptables -t nat -A PREROUTING -i eth1 -p udp --dport 59927 -j DNAT --to 10.1.2.100:59927 iptables -t nat -A POSTROUTING -s 10.1.2.0/24 -j MASQUERADE iptables -A FORWARD -j ACCEPT -i ${LAN} -s 10.1.2.0/24 iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -I INPUT 1 -i ${LAN} -j ACCEPT iptables -I INPUT 1 -i lo -j ACCEPT iptables -A INPUT -p UDP --dport bootps -i ! ${LAN} -j REJECT iptables -A INPUT -p UDP --dport domain -i ! ${LAN} -j REJECT iptables -A INPUT -p TCP -i ! ${LAN} -d 0/0 --dport 0:1023 -j DROP iptables -A INPUT -p UDP -i ! ${LAN} -d 0/0 --dport 0:1023 -j DROP iptables -I FORWARD -i ${LAN} -d 10.1.2.0/255.255.255.0 -j DROP iptables -A FORWARD -i ${LAN} -s 10.1.2.0/255.255.255.0 -j ACCEPT iptables -A FORWARD -i ${WAN} -d 10.1.2.0/255.255.255.0 -j ACCEPT iptables -t nat -A POSTROUTING -o ${WAN} -j MASQUERADE echo 1 > /proc/sys/net/ipv4/ip_forwardThe biggest security threat is the user.


Reply With Quote