This does not work beause of a bug in the L2TP server:
When a L2TP client attempts to log into the L2TP server, the L2TP server does not always send its reply packets from the correct IP address. The client sees an answer packet coming back, but it carries the wrong source IP, so it discards the packet. The tunnel does not come up if this happens.
The L2TP server actually does not specify a sender IP for its reply packets, so the router uses the IP address of the egress (outgoing) interface as the source IP. That may or may not be correct… and that’s why it works often, but not always - it depends on your routing table / default route whether L2TP works or not. Examples:
Router R1 has a single internet connection, with a default route to it. An external L2TP client with a dynamic IP connects to it. R1 receives the L2TP packets on the same interface as it sends the reply out, the reply packets from the L2TP server happen to have the correct src IP, and L2TP comes up.
However, as soon as more than one internet connection comes into play, it looks different: Example:
Router R1 has two internet connections, ETH1 with IP 123.123.123.10 and ETH2 with IP 55.55.55.20. Lets assume there is a default route via ETH2, i.e. ETH1 is mostly idle. Now an external L2TP client connects through ETH1 to 123.123.123.10… in this case, L2TP does not come up, because R1 sends reply packets via ETH2, and the reply packets end up carrying an incorrect src IP of 55.55.55.20.
once you bring BGP into the picture, i.e. if you use BGP to send traffic through both ETH1 and ETH2 in the above example, you will notice that some L2TP tunnels work, some don’t… depending on whether a particular prefix is reachable through ETH1 or ETH2. actually, if you have two L2TP’s from the client, one going to 123.123.123.10, the other going to 55.55.55.20 you’ll see that always one of them is up, the other is down, reflecting through which ETH the client is reached…
now… you could filter BGP so that you force the reachability of your L2TP client through a specific interface so that L2TP happens to work… but with dynamic IPs on the L2TP client that may require forcing large address ranges to use a specific ISP – which is contrary to the idea of BGP.
the only resort i see would be to use VRFs: the main routing table would contain a static default route to your PPPoE ISP - this is the routing table that the L2TP server uses. BGP would use a separate VRF routing table. that way the L2TP server is not influenced by BGP’s idea of reachability. this should work as long as all your L2TP server traffic should go to one specific ISP. if you want to run L2TP servers on multiple ISP links, you can not do it on a single router because of this bug.
andy
ps: the problem existed on 4.6, and i just re-verified – it exists on 4.10 as well.