I have just followed the home router setup and I am EXCITED! I am replacing ClarkConnect with this and all seems to be going fine.
I have a few questions if someone does not mind taking the time to answer. But first off.. a small rant about this process. I have been using Linux now for about 5 years and the absolutely MOST confusing thing I have EVER encountered is IPTABLES! ... I have googled and googled, read and read and I still do not even begin to understand this convoluted software, but since it is SO powerful, my thought here is to get it set up like I like it and then leave it alone to do it's thing.
For scanning/testing purposes, I am using Shields UP! a great external security testing site that scans your firewall and gives straightforward information on what it finds wrong. (Click the Proceed button on their home page to see scanning options)
Here is my current rules-save ( I would LOVE to figure out how some people have these great outputs that are o-so-neat and tidy here in the forums, but I followed the guide and did iptables save and this is the file -- in all it's ugly glory. )
- ETH0 = WAN
ETH1 = LAN
Code: Select all
# Generated by iptables-save v1.3.5 on Thu Jun 22 10:15:40 2006
*raw
:PREROUTING ACCEPT [48200274:252288353099]
:OUTPUT ACCEPT [27185728:9211098411]
COMMIT
# Completed on Thu Jun 22 10:15:40 2006
# Generated by iptables-save v1.3.5 on Thu Jun 22 10:15:40 2006
*nat
:PREROUTING ACCEPT [627080:62514317]
:POSTROUTING ACCEPT [421754:36208338]
:OUTPUT ACCEPT [8185:536039]
[434:20832] -A PREROUTING -i eth0 -p tcp -m tcp --dport 49009 -j DNAT --to-destination 192.168.1.155
[0:0] -A PREROUTING -i eth0 -p udp -m udp --dport 6881 -j DNAT --to-destination 192.168.1.155
[0:0] -A PREROUTING -i eth0 -p tcp -m tcp --dport 6969 -j DNAT --to-destination 192.168.1.155
[73000:3867142] -A PREROUTING -i eth0 -p tcp -m tcp --dport 38810 -j DNAT --to-destination 192.168.1.155
[344476:32071674] -A PREROUTING -i eth0 -p udp -m udp --dport 38810 -j DNAT --to-destination 192.168.1.155
[0:0] -A PREROUTING -i eth0 -p tcp -m tcp --dport 4663 -j DNAT --to-destination 192.168.1.155
[0:0] -A PREROUTING -i eth0 -p tcp -m tcp --dport 20060 -j DNAT --to-destination 192.168.1.155
[0:0] -A PREROUTING -i eth0 -p udp -m udp --dport 4666 -j DNAT --to-destination 192.168.1.155
[23:1152] -A PREROUTING -i eth0 -p tcp -m tcp --dport 5901 -j DNAT --to-destination 192.168.1.155
[32:1580] -A PREROUTING -i eth0 -p tcp -m tcp --dport 5900 -j DNAT --to-destination 192.168.1.155
[2693:156224] -A PREROUTING -i eth0 -p tcp -m tcp --dport 22 -j DNAT --to-destination 192.168.1.155
[528806:44341268] -A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Thu Jun 22 10:15:40 2006
# Generated by iptables-save v1.3.5 on Thu Jun 22 10:15:40 2006
*mangle
:PREROUTING ACCEPT [48200282:252288354854]
:INPUT ACCEPT [27454676:241302388472]
:FORWARD ACCEPT [20743966:10985848955]
:OUTPUT ACCEPT [27185727:9211098292]
:POSTROUTING ACCEPT [47929673:20196947449]
COMMIT
# Completed on Thu Jun 22 10:15:40 2006
# Generated by iptables-save v1.3.5 on Thu Jun 22 10:15:40 2006
*filter
:INPUT ACCEPT [374751:439413692]
:FORWARD DROP [22:1228]
:OUTPUT ACCEPT [27157923:9207996179]
[35567:6751290] -A INPUT -i lo -j ACCEPT
[26990985:240841801886] -A INPUT -i eth1 -j ACCEPT
[3:990] -A INPUT -i ! eth1 -p udp -m udp --dport 67 -j REJECT --reject-with icmp-port-unreachable
[0:0] -A INPUT -i ! eth1 -p udp -m udp --dport 53 -j REJECT --reject-with icmp-port-unreachable
[7812:734960] -A INPUT -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT
[4327:173392] -A INPUT -i ! eth1 -p tcp -m tcp --dport 0:1023 -j DROP
[39247:13366500] -A INPUT -i ! eth1 -p udp -m udp --dport 0:1023 -j DROP
[0:0] -A INPUT -i eth0 -p udp -m udp --dport 123 -j ACCEPT
[0:0] -A FORWARD -d 192.168.1.0/255.255.255.0 -i eth1 -j DROP
[42:2433] -A FORWARD -s 192.168.1.0/255.255.255.0 -i eth1 -j ACCEPT
[28:2168] -A FORWARD -d 192.168.1.0/255.255.255.0 -i eth0 -j ACCEPT
[27383:3049283] -A OUTPUT -p tcp -m tcp --dport 80 -j ACCEPT
COMMIT
# Completed on Thu Jun 22 10:15:40 2006
1. Shields UP! reported that my firewall can be pinged from the outside, does anyone know the iptables rule to stop this?
2. Shields UP! reported from the "Most Common and Troublesome Internet Ports" mostly good results (most were STEALTH, which is good).. SSH was OPEN, which I programmed in so that I can connect from work. But most troublesome was that ports 1024 - 1030 were not stealthed, but were CLOSED.. that means that the firewall responded but that no service was running there. A search for 1024 - 1030 revealed that these were Microsoft specific ports thought to deal with DCOM
3. Show my ignorance on all of this time: I edited rules-save manually, but I never could get the changes to "stick". Without doing the troublesome, iptables -t xxx -L and then counting down and deleting a specific rule then putting it back in, how do you edit these rules easily?
4. If someone has a great (well commented) script that works as a firewall/DNS gateway/DHCP server/etc. I would love to see it. The example provided in the home router howto seems to leave some holes that I am not so sure I like.
Thanks for reading and thanks in advance for any answers!


