Guest User

Untitled

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