Which works fine with traffic to and from 10.20.0.0/16 <> 172.16.10.0/24
I am trying to have a client in the 10.20.0.0/16 say for example 10.20.100.0/24 be routed out over the IPsec tunnel. Internet traffic should look to appear from the 2.2.2.2 address which is the other side of the IPsec tunnel. When I create a static route for 10.20.100.0/24 to be routed to the gateway 172.16.10.1 which is the pfSense side of the IPsec the route is marked as unreachable. Can ping ok via the tunnel with a src IP set to be within 10.20.0.0/16.
Have similar setups working ok Mikrotik to Mikrotik using SSTP and then routing over these as SSTP shows as an available interface to route to. IPSec does not appear to create an interface to route to.
I can see your LAN subnet to be 10.20.0.0/16 from the IPsec policy but I cannot see what addresses the L2TP clients are getting and to what interface the local address from 10.20.0.0/16 is attached. To make it possible for ppp clients which get addresses from LAN subnet to reach other addresses in that subnet, arp proxy must be active on the interface which holds the local address from LAN subnet.
Sorry - the full config is sensitive without a lot of cleanup. To answer your specific questions:
The L2TP clients are assigned addresses within the 10.20.0.0/16 subnet via RADIUS and have no problem accessing both the other clients in the 10.20.0.0/16 subnet and also the 172.16.10.0/24 subnet. I have some clients which I wish their internet access to be from the 2.2.2.2 address and not the 1.1.1.1 address. Normally i would create a routing mark to identify the traffic then add a static route to route this to a distant gateway. When doing this over IPsec it does not work.
OK, sorry, I have misunderstood a little bit what you want to achieve.
To make your local L2TP clients access internet through the uplink of the remote site, you have basically two possibilities:
to create a GRE tunnel through the IPsec tunnel (inspiration here), with a virtual interface at the local end, and give to the local L2TP clients the remote IP, in the same subnet like the local virtual interface, as a default gateway.
to add another IPsec policy which would have 0.0.0.0/0 as dst-address and a small subnet within 10.20.0.0/16 as src-address to the existing policy, but I am afraid (just afraid, not sure) that multiple policies per peer are only possible with IKEv2. The L2TP clients would get addresses from the sub-subnet of 10.20.0.0/16.
The 172.16.10.1 is pingable from 10.20.0.0/16 via the tunnel, but it cannot be used as a gateway for members of 10.20.0.0/16 because it is not a member of any local subnet, so it doesn’t resolve (not even recursively) to a MAC address. An ethernet packet for a.b.c.d (different from 172.16.10.0/24), even when a route via gateway c.d.e.f is found for it, still has destination IP a.b.c.d so your current IPsec policy doesn’t match on it.