NAT FreeBSD

From Teknologisk videncenter
Revision as of 13:10, 22 March 2009 by Heth (talk | contribs)
Jump to: navigation, search

FreeBSD NAT

ipnat

# Filename: /etc/ipnat.rules
#172.16.4.0/24 Internal backbone network on Mercantec
map em1 from 192.168.22.0/24 to 172.16.4.0/24 -> 172.16.4.7/32
#172.16.67.0/24 Printers on Mercantec
map em1 from 192.168.22.0/24 to 172.16.67.0/24 -> 172.16.4.7/32
#192.168.128.0/17 TEKKOM classes
map em1 from 192.168.22.0/24 to 192.168.128.0/17 -> 172.16.4.7/32
map vr1 192.168.22.0/24 -> 0/32
map vr1 172.21.0.0/16 -> 0/32
rdr vr1 83.90.239.186/32 -> 192.168.22.221  #sun
rdr vr1 83.90.239.187/32 -> 192.168.22.178  #Cisco
rdr vr1 83.90.239.188/32 -> 192.168.22.223  #bsd

Add the following to /etc/rc.conf

route_tekkom="-net 192.168.128.0/17 172.16.4.1"
route_backbone="-net 172.16.4.0/24 172.16.4.1"
route_printers="-net 172.16.67.0/24 172.16.4.1"