ipmasqadm portfw ..doesn't quite work right

Rusty Carruth plug-discuss@lists.PLUG.phoenix.az.us
Fri, 20 Apr 2001 10:13:27 -0700 (MST)


> 
> Hey all,
> 	Ok, I have a problem.  My objective is to forward my firewall port 26 (not 
> used) to an internal port 22 (ssh).  My problem is that it didn't work.  Here 
> is basically what I did..

> So I have some questions.
> - Did I implement ipmasqadm portfw correctly?

I'm using ipchains, so I cannot comment on that, but here's how  I'm curently
doing it with ipchains:

 ipchains -A input -v    -i $extint -p tcp    -d 0.0.0.0/0 25 -j REDIRECT 123
 ipchains -A input -v    -i $extint -p udp    -d 0.0.0.0/0 25 -j REDIRECT 123
# not sure I need this:
 ipchains -A input -v    -i $extint -p tcp      -d $extip/32 25     -j ACCEPT
 ipchains -A input -v    -i $extint -p udp      -d $extip/32 25     -j ACCEPT

> - Does the machine on 192.168.1.100 have to be configured in any particular 
> way to handle this?

You do need to make sure that port 26 is allowed to pass through.  Do a port
scan from outside the machine and see if that port is open.

Also, don't forget the really useful 'netstat -a' command when tryin to diagnose
things like this!

rusty