I have a NAT problems on my VPN server. My network like on this image:
The problem is - I need to translate source address from all OpenVPN clients to 192.168.37.5 (my IPSec policy imply that 192.168.0.0/22 network is on the remote side and 192.168.37.0/24 network is on my side).
I try to use next PF rule:
And it does not work - in IPSec tunnel packets have 172.16.0.6 source address.
I got no ideas what the problem is. Can you help me?
Thanks!
Code:
| |
| WAN (1.2.3.4) +--------------------- OpenVPN client (172.16.0.6)
| |
| |
| IPSec (192.168.0.0/22) | OpenVPN (172.16.0.0/24)
| igb0 ($ext_if) | tun0 (172.16.0.1)
+-------+----------------------------+------+
| |
| My VPN server |
| |
+--------------------+----------------------+
| LAN (192.168.37.0/24)
| igb1 ($int_if)
| 192.168.37.5
|
|
|
|
The problem is - I need to translate source address from all OpenVPN clients to 192.168.37.5 (my IPSec policy imply that 192.168.0.0/22 network is on the remote side and 192.168.37.0/24 network is on my side).
I try to use next PF rule:
Code:
nat log on tun0 from { 172.16.0.0/24 } to { 192.168.0.0/22 } -> 192.168.37.5
And it does not work - in IPSec tunnel packets have 172.16.0.6 source address.
Code:
root@vpn:/usr/home/slavka # tcpdump -i igb0 src net 172.16.0.0/24
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on igb0, link-type EN10MB (Ethernet), capture size 262144 bytes
10:54:49.618289 IP 172.16.0.6.44296 > 192.168.1.2.ftp: Flags [ S ], seq 2171435695, win 8192, options [mss 1358,nop,wscale 8,nop,nop,sackOK], length 0
10:54:52.619358 IP 172.16.0.6.44296 > 192.168.1.2.ftp: Flags [ S ], seq 2171435695, win 8192, options [mss 1358,nop,wscale 8,nop,nop,sackOK], length 0
I got no ideas what the problem is. Can you help me?
Thanks!