IPFW fun

zhuravlev alexander zaa at ulstu.ru
Fri Jul 11 08:54:17 PDT 2003


On Fri, Jul 11, 2003 at 11:07:55AM -0400, Tom Servo wrote:
> Hey-
> I have a freebsd gateway machine that runs ipfw and nat for my home network
> and I want to add a rule that redirects VNC packets through the gateway to
> my windows machine so that I can VNC to my home machine to do some stuff.
> How should I phrase the rule correctly without screwing up the natd service?
> I am guessing it should go something like this: ipfw add 1000 divert 8888 ip
> from any to 192.168.0.253:5800 via ep1 Is this correct?  I need it to only
> redirect packets for the VNC port. Thanks -ts

[ Cc'ed to freebsd-questions ... ]

in case of inbound nat ....  

in rc.firewall

ipfw add 1000 divert natd tcp from any to 192.168.0.253 5800 in recv ep1
ipfw add 1000 divert natd tcp from <internal_ip> 5800 to any 


/etc/natd.conf
interfase ep1
use_sockets yes
same_ports yes
redirect_port tcp <internal_ip>:5800 192.168.0.253:5800  

/sbin/natd -f /etc/natd 
sh /etc/rc.firewall 

	                             -- zhuravlev alexander
				             (zaa at ulstu.ru)


More information about the freebsd-questions mailing list