Hi, I've been using this script that I wrote myself for a while but all of a sudden it's stopped working
The box refuses to talk to the internet when this is applied.
Code:
#!/bin/sh
#
# rtt's firewall script using IPTABLES
#
# Open ports: 3874, 80, 21
#
IPTABLES="/usr/sbin/iptables"
UPPORTS="1024:65535"
PPORTS="0:1023"
#
# Clear...
$IPTABLES --policy INPUT ACCEPT
$IPTABLES --policy OUTPUT ACCEPT
$IPTABLES --policy FORWARD ACCEPT
$IPTABLES --flush
#
# Start...
$IPTABLES -A INPUT -i lo -j ACCEPT
$IPTABLES -A OUTPUT -o lo -j ACCEPT
$IPTABLES --policy INPUT DROP
$IPTABLES --policy OUTPUT ACCEPT
#
#
# Allow from local network:
$IPTABLES -A INPUT -s 192.168.0.0/24 -i eth0 -j ACCEPT
#
# Open port 80
$IPTABLES -A INPUT -s ! 192.168.0.0/24 -i eth0 -p tcp -m state --state NEW --sport $UPPORTS --dport 80 -j ACCEPT
# Open port 21
$IPTABLES -A INPUT -s ! 192.168.0.0/24 -i eth0 -p tcp -m state --state NEW --sport $UPPORTS --dport 21 -j ACCEPT
# Open 3784
$IPTABLES -A INPUT -s ! 192.168.0.0/24 -i eth0 -p tcp -m state --state NEW --sport $UPPORTS --dport 3784 -j ACCEPT
# Open 6667
$IPTABLES -A INPUT -s 0/0 -i eth0 -p tcp -m state --state NEW --sport $UPPORTS --dport 6667 -j ACCEPT
# EOF
All it does is allow any traffic on the local network, and then opens up ports 80, 21 and 3784 to anyone.
Any ideas why this locks the box from the internet?
Any help much appreciated!