I'm on PPPoE adsl which has made all ipfilter/ipnat stuff rather painful
(since i'm new to all this) and I've been having a very, very strange time
with ipfilter and ipnat. I recently added
net.inet.tcp.blackhole=2
net.inet.udp.blackhole=1
to my /etc/sysctl.conf because i'm all paranoid and prefer to have ports not
respond at all. After this I rebooted and did a port scan of myself from
grc.com and happy days all my ports show up as 'stealth'. I then tried to
connect to my favorite irc server and it sits there trying to connect to
ident but tells me I'm not responding. Which is weird. Especially since all
my other connections work.

This shouldn't be because my rules specifically pass in all connections from
my fav. irc servers:
ipnat.rules:
map xl0 192.168.1.0/24 -> 0/32
rdr tun0 0.0.0.0/0 port 21 -> 192.168.1.100 port 21
rdr tun0 0/0 port 113 -> 192.168.1.100 port 113 tcp

maps all connections from internal lan to whatever external ip and redirects
all outside connections on port 113 to this XP box. xl0 is the nic connected
to the DSL modem, fxp0 is the nic connected to my internal LAN.

ipf.rules:

#
# pass in all my favorite irc servers for ident
#
pass in quick on tun0 proto tcp from 207.45.69.69 to any keep state
pass in quick on tun0 proto tcp from 140.99.102.3 to any keep state
pass in quick on tun0 proto tcp from 195.159.0.90 to any keep state
pass in quick on tun0 proto tcp from 193.163.220.3 to any keep state
#
# allow out all data from my lan to external IP (pass out xl0 didnt work)
# and keep state on it to allow it back in
#
pass out quick on tun0 proto tcp from any to any keep state
pass out quick on tun0 proto udp from any to any keep state
pass out quick on tun0 proto icmp from any to any keep state
block out quick on tun0 all
#
# block all unwelcome unrequested data coming in
#
block return-rst in log quick on tun0 proto tcp from any to any
block return-icmp-as-dest(port-unr) in log quick on tun0 proto udp from any
to
 any
block in log quick on tun0 all
#
# all in and out all trusted internal traffic and local traffic
pass out quick on fxp0 proto tcp from any to any keep state
pass out quick on fxp0 proto udp from any to any keep state
pass out quick on fxp0 proto icmp from any to any keep state
block out quick on fxp0 all
pass in quick on fxp0 proto tcp from any to any keep state
pass in quick on fxp0 proto udp from any to any keep state
pass in quick on fxp0 proto icmp from any to any keep state
block in quick on fxp0 all
pass in quick on lo0 all
pass out quick on lo0 all

So even though data should be being passed in (like it was before) for some
reason it's not, so I tinker around with ipnat a little bit to see if maybe
some changes will help, I try out map xl0 192.168.1.0/24 -> 0/32 and flush
ipnat with ipnat -CF -f /etc/ipnat.rules .
Suddenly to my surprise, ident works (but I have an assload of connections
in ipnat -l) but when I go to portscan myself all my connections reply as
closed now (except ident which is still filtered). I change ipnat back to
the way it was originally and reflush, but ident still works and all ports
still reply as closed. This is with no change to ipf.rules
So now every time I reboot, all my ports are filtered and ident doesnt work
until I change and flush ipnat at which point it changes to all ports closed
and ident working, and no matter what wont go back to filtered.
I am at a total loss at this point, looking through helpful tips on
redirects and blocking rules I havent found any hint of what is going on. I
know this is a long problem for a monday but its really been vexing me.

Reply via email to