PF + IPsec

Artem Viklenko artem at viklenko.net
Tue Mar 17 12:54:03 UTC 2020


You don't need rdr

nat on enc0 inet from 10.0.0.0/8 to 10.31.32.0/24 -> 10.19.12.251


On 17.03.20 14:35, Cristian Cardoso wrote:
> I tried as follows without success:
> 
> rdr on xn0 inet proto icmp from 10.31.32.67 to 10.0.0.0/8 -> 10.19.12.251
> nat on xn0 inet proto icmp from 10.0.0.0/8 to 10.31.32.67/32 -> 10.19.12.251
> rdr on enc0 inet proto icmp from 10.31.32.67 to 10.0.0.0/8 -> 10.19.12.251
> nat on enc0 inet proto icmp from 10.0.0.0/8 to 10.31.32.67 -> 10.19.12.251
> 
> xn0 is my interface that goes to the internal network that is beyond
> the freebsd and enc0 of the vpn, I just put the icmp protocol for
> testing
> I checked on tcpdump on the enc0 interface, which occurs echo request
> and echo reply, but does not return to the PC that ran icmp on another
> network within 10.0.0.0/8
> 
> Any suggestion?
> 
> Em ter., 17 de mar. de 2020 às 02:48, Artem Viklenko
> <artem at viklenko.net> escreveu:
>>
>> Hi!
>>
>> PF do NAT on outbound and RDR on inbound.
>> You can try to do NAT on enc0 interface instead of lan.
>>
>>
>> On 17.03.20 04:28, Cristian Cardoso wrote:
>>> Hello
>>> I'm setting up a Freebsd server for ipsec vpn communication with
>>> strongswan and I'm having some difficulties in the operation
>>>
>>> The freebsd server's local network is 10.19.12.0/24 and can connect
>>> correctly to the network on the other side of the tunnel.
>>>
>>> I would like another network behind my server to connect to the tunnel as well.
>>>
>>> In linux I would nat the network that is arriving as follows:
>>> iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -d 10.31.32.0/24 -j
>>> --SNAT --to 10.19.12.251
>>>
>>> In FreeBSD I tried to run the rule as follows, but to no avail
>>> nat on $ LAN inet from 10.0.0.0/8 to 10.31.32.0/24 -> 10.19.12.251
>>>
>>> Is there any other way to generate the equivalent of FreeBSD postrouting?
>>>
>>> Best Regards
>>> _______________________________________________
>>> freebsd-pf at freebsd.org mailing list
>>> https://lists.freebsd.org/mailman/listinfo/freebsd-pf
>>> To unsubscribe, send any mail to "freebsd-pf-unsubscribe at freebsd.org"
>>>
>>
>> --
>> Regards!
> 

-- 
Regards!


More information about the freebsd-pf mailing list