[Solved] Fail to Connect IPsec/L2TP Server after Server IP Changed ( Server Has Dynamic IP)
-
Hi there,
Good day.
I'm running a pfSense box at home with IPsec/L2TP Server enabled. My ISP reassigns IP address periodicity. After the changing of WAN IP address, I can not connect my VPN with the new IP address (DynamicDNS). I have to restart the L2TP service, then my VPN works.
How to resolve this problem?
Please help. Many many thanks.
-
For those who face this problem:
I finallly solved this problem. After the ISP reassigned a new IP address, L2TP still listening on the first IP address while it started. In"/var/etc/l2tp-vpn/mpd.conf" the line "set l2tp self xxx.xxx.xxx.xxx" is always the very first IP address it gets.
I modified "/etc/inc/vpn.inc": change [ "$l2tp_listen="set l2tp self $ipaddr";" ] to [ $l2tp_listen="set l2tp self 0.0.0.0"; ]. It makes the l2tp always listen on 0.0.0.0.
Probably there are better solutions then this one. However, it fixed my problem for now.
-
BTW:
IPsec works perfectly. You can see it was connected for a while when l2tp is down.