FreeBSD nat & port forward
This explain how-to configure your FreeBSD to make a portforward and router to a local intranet
-[ Fist you need to recompile your kernel adding this lines /usr/src/sys/i386/conf/YOUR_KERNEL ]-
options IPFIREWALL # Firewall
options IPDIVERT # Nat
options IPFIREWALL_DEFAULT_TO_ACCEPT # Nat
options IPFIREWALL_VERBOSE # Nat
COMPILE YOUR KERNEL 6.x
/usr/sbin/config NEWKERN
cd ../compile/NET4801
make clean && make cleandepend && make depend && make
make install
-[ than add this lines at: /etc/rc.conf ]-
gateway_enable="YES"
natd_enable="YES"
natd_interface="xl0" # interface connected to internet, not local network
natd_flags="-l -f /etc/ipnat.rules"
-[ and finally edit your nat rules ]-
/etc/ipnat.rules
interface xl0
dynamic yes
same_ports yes
use_sockets yes
redirect_port tcp 192.168.0.30:80 80 # redirect you 80 to local machine with IP 192.168.0.30

0 Comments:
Post a Comment
<< Home