# How to configure NAT properly.



## Ricky (Apr 24, 2012)

Hi.
I'm using FreeBSD inside VirtualBox and I would like to know how can I configure NAT to use my host internal ip (192.168.1.10) instead of 10.0.2.15

Thank you.


----------



## wblock@ (Apr 24, 2012)

That's not done with NAT at all.  In the VM properties under Network, set "Attached To" to Bridged Adapter.  There might be additional config needed on the host.


----------



## Ricky (Apr 24, 2012)

OUWUOWOU a FreeBSD Developer talked to me :O
I can configure it using Bridged Adapter that will connect the VirtualBox directly to the router and then just assign DHCP but I really want NAT using 192.168.X.X.
Can't I use gateways or routes?


----------



## bbzz (Apr 24, 2012)

I use host-only option, and use my host as a router.
Assuming you are using pf you would configure NAT just like with any other interface:


```
nat on wlan0 from vboxnet0:network to any -> wlan0
```

vboxnet0 being virtual interface connected to VM.


----------



## wblock@ (Apr 24, 2012)

Ricky said:
			
		

> I can configure it using Bridged Adapter that will connect the VirtualBox directly to the router and then just assign DHCP but I really want NAT using 192.168.X.X.
> Can't I use gateways or routes?



Sorry, I don't understand what you're trying to do.  Do you want to change the network address range used by NAT in the VM?


----------

