Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Macros: define common values, so they can be referenced and changed easily.
- ext_if="em0" # The external interface
- int_if="em1" # The internal interface
- external_addr="192.168.42.5" # Your public IP address
- internal_net="192.168.69.0/24" # Your internal subnet
- # Translation: specify how addresses are to be mapped or redirected.
- # nat: packets going out through $ext_if with source address $internal_net will
- # get translated as coming from the address of $ext_if, a state is created for
- # such packets, and incoming packets will be redirected to the internal address.
- nat on $ext_if from $internal_net to any -> ($ext_if)
- # rdr: packets coming in on $ext_if with destination $external_addr:1234 will
- # be redirected to 10.1.1.1:5678. A state is created for such packets, and
- # outgoing packets will be translated as coming from the external address.
- rdr on $ext_if proto tcp from any to $external_addr/32 port 80 -> 192.168.69.11 port 8080
- rdr on $ext_if proto tcp from any to $external_addr/32 port 443 -> 192.168.69.11 port 8443
- # Make sure we don't block any traffic
- pass in all
- pass out all
Add Comment
Please, Sign In to add comment