# Quick NAT question?



## Desreguard (Jun 5, 2011)

Hey all, I'm learning how to build my own firewall, and I have a quick question about the Nat rules. My only question so far is what is the difference between:


```
map re0 192.168.1.0/24 -> Public IP address
map re0 192.168.1.0/24 -> 0/32
```

If I put in the public IP address won't I have to change it in my /etc/ipnat.rules whenever my ISP changes it? Or does the 0/32 do that?

Sorry if this is a newbie question but I'm still learning.


----------



## francis (Jun 5, 2011)

Hi, please read the FreeBSD handbook chapter Firewalls and especially subtitle *30.5.16 / 30.5.21.1 IPNAT Rules*, *30.5.19.1 Assigning Ports to Use* and *30.5.19.2 Using a Pool of Public Addresses*. Generally, this chapter contains many interesting/valuable informations, and in some way explains rules between Public IP address and special keyword *0/32*. Also, worth for reading is the ipnat(5) man page. 
In short, *0/32* is a signal that NAT needs to look which address of that interface, really is. The first record telling NAT to statically map sessions from a host into the pool of addresses/address. So you can write your rule, how already you did it. Let someone correct me, if I write stupid things..

I hope that I helped You in some way, and You have found the answer to your questions.


----------

