# Jail Vlan



## michandr (Apr 18, 2010)

ok I don't know what I am missing here:

my router provides DNS and works properly
router has local ip adreess 192.168.6.1/24
BSD server has dc0 interface set to 192.168.6.3/24
BSD server has vlan1 interface created with no parent device
vlan1 has the following IPs set to it:
192.168.7.1/28
192.168.7.2/28
192.168.7.3/28
192.168.7.4/28

my BSD jail is set to use address 192.168.7.3
my pf.conf is as follows:


```
ext_if="dc0"
int_if="vlan1"
external_addr="192.168.6.3"
internal_net="192.168.7.0/28"
net on $int_if from $internal_net to any -> ($ext_if)
rdr on $ext_if proto tcp from any to $external_addr/32 port 80 -> 192.168.7.3 port 80
```

ok so here is the issue I can talk to the HTTP server, but whenever I try to talk to anything from the jail it fails to communicate. The default router I set for the jail is 192.168.7.1 which I have set aside on vlan1 for the host system. any ideas?


----------



## DutchDaemon (Apr 18, 2010)

1. I'm assuming 'net on' is a typo of 'nat on'
2. You should nat on the _external_ interface, not the _internal_ interface


----------



## michandr (Apr 19, 2010)

*[SOLVED] jails vlan*

yeah sorry it was nat on


here is the thing though my router does not know, nor do I want it to know the 192.168.7.0/28 subnet.

that line tells PF to take all packets coming from the vlan to anywhere and make them appear as if they where from the host system's IP

thank you for your help though DutchDeamon

I found the fix appearently i had to enable sysctl net.ip.forwarding=1


----------

