假如现在需要通过Freebsd(:92.168.0.211)转发Oracle访问到数据库(192.168.0.21)。
1:gedit /etc/sysctl.conf
net.inet.ip.forwarding=1
或者:sysctl -w net.inet.ip.forwarding=1
2:gedit /etc/pf.conf
rdr on em0 proto tcp from any to any port 1521 -> "192.168.0.21" port 1521
rdr pass on em0 proto tcp from any to any port 1521 -> "192.168.0.21" port 1521
nat on em0 from any to "192.168.0.21" -> "192.168.0.211"
3:gedit /etc/rc.conf
pf_enable=”YES”
或者:kldload pf,然后pfctl -e,再pfctl -f /etc/pf.conf
OK!