# [PF] Forward IP:PORT to another SERVER



## JUStice (Jun 28, 2013)

Setup:

*Gateway*:
Wan IP: dynamic IP
LAN IP: 10.10.1.1/16
DMZ: to Server1 10.10.1.11/16
Firewall: disabled

*Server1*:
`uname -a` output:

```
FreeBSD xxx.domain.com 9.1-RELEASE-p4 FreeBSD 9.1-RELEASE-p4 #0: Mon Jun 17 11:42:37 UTC 2013     [email]root@amd64-builder.daemonology.net[/email]:/usr/obj/usr/src/sys/GENERIC  amd64
```
fxp0: 10.10.1.11/16, 10.10.11.1/16, 10.10.11.110-119/16
lo1: 10.11.11.110-119/16

Jails using 10.11.11.110-119/16

/etc/sf.conf:

```
binat from 10.11.11.110 to any -> 10.10.11.110
binat from 10.11.11.111 to any -> 10.10.11.111
binat from 10.11.11.112 to any -> 10.10.11.112
binat from 10.11.11.113 to any -> 10.10.11.113
binat from 10.11.11.114 to any -> 10.10.11.114
binat from 10.11.11.115 to any -> 10.10.11.115
binat from 10.11.11.116 to any -> 10.10.11.116
binat from 10.11.11.117 to any -> 10.10.11.117
binat from 10.11.11.118 to any -> 10.10.11.118
binat from 10.11.11.119 to any -> 10.10.11.119
```

*Server2*:
nic0: 10.10.12.120-129/16

Questions: How to ...:

 Forward the HTTP service of 10.10.1.11  to 10.10.11.1 (same machine/same NIC)
 Forward DNS service of 10.10.1.11  to 10.11.11.114 (same machine/different NIC)
 Forward Asterisk service of 10.10.1.11 to 10.10.12.121 (different machine/same subnet)
 Forward just one TCP port of 10.10.1.11 to a static public IP address outside the gateway (different machine/different subnet)

Thank you in advance 

[ Don't make another clown post like that, we can read --  Mod. ]


----------

