Im not an expert but i think this is what you need:
To connect your Raspberry Pi running OpenWRT to your Synology NAS VPN server using L2TP protocol, you can follow these steps:
- Install the
xl2tpd
package on your Raspberry Pi running OpenWRT by using the command:
opkg update
opkg install xl2tpd
- Configure the
/etc/xl2tpd/xl2tpd.conf
file on your Raspberry Pi by adding the following lines:
[lac myvpn]
lnswan ip <Synology_NAS_IP_Address>
lnsauth = yes
eap = no
ppp debug = yes
pppoptfile = /etc/ppp/options.l2tpd.client
length bit = yes
redial = yes
redial timeout = 5
refuse pap = yes
refuse chap = yes
require authentication = yes
name = <Your_VPN_Username>
password = <Your_VPN_Password>
Replace <Synology_NAS_IP_Address>
, <Your_VPN_Username>
, and <Your_VPN_Password>
with your actual Synology NAS IP address, VPN username, and VPN password.
- Create the
/etc/ppp/options.l2tpd.client
file on your Raspberry Pi by adding the following lines:
require-mschap-v2
require-chap
refuse-eap
refuse-pap
refuse-chap-md5
auth
mtu 1200
mru 1200
crtscts
hide-password
defaultroute
usepeerdns
debug
- Restart the
xl2tpd
service on your Raspberry Pi using the command:
/etc/init.d/xl2tpd restart
- Verify that the L2TP tunnel is up by checking the output of the
ipsec status
and xl2tpd-control status
commands.
Regarding the issue with your internet connection and DNS, it is possible that the VPN client configuration has caused a misconfiguration of the network settings. You can try the following steps to troubleshoot the issue:
-
Verify that your Raspberry Pi is still connected to the network and has a valid IP address assigned.
-
Check the DNS settings on your Raspberry Pi by running the command:
cat /tmp/resolv.conf.auto
It should contain the IP address of your DNS server. If it is not set correctly, you can try manually setting the DNS server by editing the /etc/config/network
file and adding the following lines:
config interface 'wan'
option dns '<Your_DNS_Server_IP_Address>'
Replace <Your_DNS_Server_IP_Address>
with the IP address of your DNS server.
- Check the routing table on your Raspberry Pi by running the command:
ip route
It should contain the default route to your internet gateway. If it is missing or incorrect, you can try manually setting the default route by running the command:
ip route add default via <Your_Internet_Gateway_IP_Address>
Replace <Your_Internet_Gateway_IP_Address>
with the IP address of your internet gateway.
- Finally, you can try restarting the network services on your Raspberry Pi by running the commands:
/etc/init.d/network restart
/etc/init.d/firewall restart
This should reapply the network settings and restart the firewall service.