G
G
Gleb Bogdanov2014-03-24 06:02:43
FreeBSD
Gleb Bogdanov, 2014-03-24 06:02:43

How to forward ports from the outside through a vpn tunnel to a local network?

Given:
1. internet gateway (FreeBSD8.1, PF firewall) with openvpn server (10.10.10.0/24)
2. local network behind gateway (192.168.xxx.yyy)
3. remote VPS (FreeBSD8.3) with openvpn client (10.10.10.250)
Task:
Forward ports from an external VPS address through a vpn tunnel to the local network.
For example, this scheme:
http ---> extip - VPS - 10.10.10.250 ---> 10.10.10.1 - Internet gateway - 192.168.xxx.1 ---> 192.168.xxx.yyy (webserver)
Question:
What are the rules PF needed to solve this problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-03-24
@bk0011m

What's there to be smart about? Everything is simple.
I understand that your VPS knows about the address range 192.168.xxx.1 ?? Are they pinging?
Well then, on the VPS firewall, write the rule:
rdr pass proto {tcp udp} from $EXT to $ext_ip port 80 --> 192.168.xxx.15 port 80
Accordingly, EXT is an external
ext_ip - an external ip address on the VPS
And allow it on both firewalls walking packages.
I hope the meaning is clear?
PS. You don't work for PPR by any chance? The situation is too familiar..))

G
Gleb Bogdanov, 2014-03-24
@bogdanov_go

That's right, routing is configured: VPS sees the local network 192.168.
You write:
This is probably my problem. Could you explain.
I don't work at that location, I don't even know what it is.
Thank you in advance for your participation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question