View Single Post
  #1   (View Single Post)  
Old 19th January 2013
EverydayDiesel EverydayDiesel is offline
Shell Scout
 
Join Date: Jan 2009
Posts: 124
Default Giving Two Seperate Networks Internet With PF

Hello again.

I have two networks that I am trying to keep separate but allow internet access to each.

Code:
EXT="pppoe0"
INT1="re1"
INT2="re2"

INT_NET1= "{ 192.168.0.2, 192.168.0.3 }"
INT_NET2= "{ 10.0.0.2, 10.0.0.3 }"

block log all
set block-policy drop

match log on pppoe0 scrub (reassemble tcp max-mss 1440) 

nat on $EXT from $INT_NET1 -> ($EXT:0)
nat on $EXT from $INT_NET2 -> ($EXT:0)

pass out on $EXT inet from any to any
pass in on $INT inet from $INT_NET1 to any
pass in on $INT inet from $INT_NET2 to any
hostname.re1
Code:
inet 192.168.0.1 255.255.255.0
hostname.re2
Code:
inet 10.0.0.1 255.0.0.0

Traffic coming from INT_NET1 can get to the internet but traffic on INT_NET2 cannot.

This seems very simple and like it shoudl work, what am I doing wrong (and thanks in advance)
Reply With Quote