1
19.1 Legacy Series / Re: IPsec packets not routing to tunnel in host to site configuration
« on: June 21, 2019, 09:58:24 am »
Some additional information which may be helpful.
The network:
The tunnel:
The SPD:
What happens to a packet (roughly):
What I would like to happen to a packet:
Forgive my lack of BSD knowledge in the above. I know routing is based on the SPD so the SNAT probably has to happen earlier. I have no idea how that happens though. I know under Linux the routing would happen based on the destination and the SNAT happens in the pre-route chain, but this doesn't seem to be BSD's way.
Any help would be greatly appreciated.
The network:
Code: [Select]
192.168.44.0/24 --- 1.1.1.1 ... 2.2.2.2 --- 192.168.200.0/24
The tunnel:
Code: [Select]
172.18.5.1/32 === 192.168.200.0/24
The SPD:
Code: [Select]
Source Destination Dir Tunnel
192.168.200.0/24 172.18.5.1 in 1.1.1.1 -> 2.2.2.2
172.18.5.1 192.168.200.0/24 out 1.1.1.1 -> 2.2.2.2
What happens to a packet (roughly):
Code: [Select]
Source Destination Interface Next Hop Note
192.168.44.1 192.168.200.1 client 192.168.44.254 Packet leaves PC
192.168.44.1 192.168.200.1 gw LAN 1.1.1.1 Packet hits OPNsense, doesn't match SPD, goes to default route
1.1.1.1 192.168.200.1 gw WAN the internet Packet hits WAN interface, SNATs to public IP, goes out internet
What I would like to happen to a packet:
Code: [Select]
Source Destination Interface Next Hop Note
192.168.44.1 192.168.200.1 client 192.168.44.254 Packet leaves PC
192.168.44.1 192.168.200.1 gw LAN gw ipsec Packet hits OPNsense, routed to tunnel based on destination
172.18.5.1 192.168.200.1 gw ipsec far tunnel Packet SNATs to tunnel address, goes out tunnel
Forgive my lack of BSD knowledge in the above. I know routing is based on the SPD so the SNAT probably has to happen earlier. I have no idea how that happens though. I know under Linux the routing would happen based on the destination and the SNAT happens in the pre-route chain, but this doesn't seem to be BSD's way.
Any help would be greatly appreciated.