- May 31, 2001
- 10,027
- 1
- 81
I'm trying to do port forwarding from my freebsd gateway to an internal freebsd box.
Port I'm trying to port forward is 3000
Here is my current rules
#!/bin/sh
/sbin/ipfw -q -f flush
# Set defaults
cmd="ipfw -q add " # build rule prefix
ks="keep-state" # just too lazy to key this each time
$cmd 00500 check-state
/sbin/natd -interface fxp0
$cmd 00505 divert natd all from any to any via fxp0
$cmd 00510 pass all from any to any
$cmd 00530 accept all from any any to <external ip> 3000 in via fxp0
$cmd 00535 accept all from any any to <internal ip> 3000 out via fxp0
$cmd 00540 divert natd all from any to <external ip> 3000 in via fxp1
$cmd 00541 divert natd all from <internal ip> 3000 to any out via fxp1
$cmd 00542 allow log tcp from any to <internal ip> 3000 via fxp0
/sbin/natd -n fxp0 redirect_port tcp <internal ip>:3000 3000
I'm still learning about ipfw so I probably have some mistakes somewhere.
Anyone see anything glaring wrong with my current rules set?
Port I'm trying to port forward is 3000
Here is my current rules
#!/bin/sh
/sbin/ipfw -q -f flush
# Set defaults
cmd="ipfw -q add " # build rule prefix
ks="keep-state" # just too lazy to key this each time
$cmd 00500 check-state
/sbin/natd -interface fxp0
$cmd 00505 divert natd all from any to any via fxp0
$cmd 00510 pass all from any to any
$cmd 00530 accept all from any any to <external ip> 3000 in via fxp0
$cmd 00535 accept all from any any to <internal ip> 3000 out via fxp0
$cmd 00540 divert natd all from any to <external ip> 3000 in via fxp1
$cmd 00541 divert natd all from <internal ip> 3000 to any out via fxp1
$cmd 00542 allow log tcp from any to <internal ip> 3000 via fxp0
/sbin/natd -n fxp0 redirect_port tcp <internal ip>:3000 3000
I'm still learning about ipfw so I probably have some mistakes somewhere.
Anyone see anything glaring wrong with my current rules set?