tomclegg.net |
Oracle 9i server behind a firewall with NAT Posted August 21, 2003 You want to put your Oracle 9i server ("planb" at 10.10.2.9) behind a NAT router, and access it from outside the router (any client in 128.100.31.0/24). +--------+ public +--------------+ private +----------------+ | client |--------| firewall+nat |---------| oracle (planb) | +--------+ +--------------+ +----------------+ I assume your router already has:
To run #!/bin/sh killall -9 natd 2>/dev/null exec fghack natd -f ./natd.conf Create interface xl0 dynamic unregistered_only redirect_port tcp 10.10.2.9:1521 1521 Enable the service. fw# chmod +x /var/service/natd/run fw# ln -s /var/service/natd /service/ Create (or add to) -f flush add allow ip from any to any via lo0 add divert natd ip from any to any via xl0 add deny ip from 10.0.0.0/8 to any in recv xl0 add allow tcp from any to any established add allow tcp from 128.100.31.0/24 to 10.10.2.9 1521 setup add unreach port tcp from any to any add unreach port udp from any to any add deny ip from any to any Add to firewall_type=/etc/firewall Apply the new firewall rules: fw# nohup ipfw /etc/firewall |