# IPFW with ppp nat



## Junaid (May 22, 2011)

Hi,

I have set up a FreeBSD machine to connect to PPPoE and do NAT. I also have IPFW on the same machine. I want to ask when a packet comes from outside or leaves from inside is it NATed first then passed to IPFW or the other way around?

I think when it is coming from outside it must be NATed first but while going to outside world it must pass IPFW before NAT.

Please clarify.

Junaid Syed


----------



## aragon (May 22, 2011)

If you're doing NAT in ppp(8) (starting it with -nat argument, or enabling nat in your config), then incoming packets get NATed first (before IPFW), and outgoing packets last (after IPFW).


----------



## terminus (May 22, 2011)

It depends...
Take a look in 
	
	



```
ipfw show
```
search for *nat* or *divert* or *netgraph* keywords. One of them can provide nat functionality.


----------

