v902
September 21st, 2003, 01:59
I am trying to set up an OpenBSD 3.3 -release (screw the patches just get it working right now) NAT router/gateway. I have 2 NICs' in it, dc0, and ne3. ne3 will be connected to the LAN (hub), and dc0 will be connected to the WAN (Cable modem). I have uncommented net.inet.ip.forwarding in /etc/sysctl.conf, and I have the following pf.conf:
[code:1:b900b52f3d]# I <3 variables
ext_if = "dc0"
int_if = "ne3"
interior_net="192.168.0.0/24"
external_addr="10.0.0.0"
# I <3 tables
table <rfc1918> const { 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8 }
set timeout interval 10
set timeout frag 30
set block-policy drop
set loginterface dc0
nat on $ext_if from $interior_net to any -> ($ext_if)
scrub in all
block in log all
pass in on $ext_if proto tcp from $ext_if to any port 23 keep state #allow all incoming port 23 connections
block out on $ext_if from any to <rfc1918> #don't allow any packets to from rfc 1918 adresses to make it out of $ext_if
pass out on $ext_if proto { tcp udp } <rfc1918> keep state #allow my network to connect out[/code:1:b900b52f3d]
Any problems so far? My major question is, what else should I do (do I need to modify my pf.conf?)?
My hostname.dc0 and hostname.ne3 are the same and I know they shouldn't be... They both say
"inet 192.168.0.1 255.255.255.0 NONE media 10baseT"
What should they say? Thanks for everything.
[code:1:b900b52f3d]# I <3 variables
ext_if = "dc0"
int_if = "ne3"
interior_net="192.168.0.0/24"
external_addr="10.0.0.0"
# I <3 tables
table <rfc1918> const { 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8 }
set timeout interval 10
set timeout frag 30
set block-policy drop
set loginterface dc0
nat on $ext_if from $interior_net to any -> ($ext_if)
scrub in all
block in log all
pass in on $ext_if proto tcp from $ext_if to any port 23 keep state #allow all incoming port 23 connections
block out on $ext_if from any to <rfc1918> #don't allow any packets to from rfc 1918 adresses to make it out of $ext_if
pass out on $ext_if proto { tcp udp } <rfc1918> keep state #allow my network to connect out[/code:1:b900b52f3d]
Any problems so far? My major question is, what else should I do (do I need to modify my pf.conf?)?
My hostname.dc0 and hostname.ne3 are the same and I know they shouldn't be... They both say
"inet 192.168.0.1 255.255.255.0 NONE media 10baseT"
What should they say? Thanks for everything.