this is openwrt/lede problem, now have “perfect work solution”, but “little stupid”.
- of course, you need the “*.ovpn” file.
- follow “Overview - GL.iNet Docs” upload your “*.ovpn” file
- you need use ssh connect your gl-inet router.
- cd /etc/openvpn
- ls -l, you will list the porcedure (2) uploaded ovpn file
- use vi to edit your ovpn file
- insert below (3) lines to your ovpn file
7.1 *** WHY NOT MODIFY OVPN FILE BEFORE UPLOAD ? *** because the gl.inet web upload will clear below 3 line. so you need modify after upload.
–script-security 2
up /etc/openvpn/updns
down /etc/openvpn/downdns
- save & exit the vi
- use vi to create (2) scripts file (updns and downdns)
/etc/openvpn/updns: (file not include this line)
#!/bin/sh
mv /tmp/resolv.conf.auto /tmp/resolv.conf.auto.hold
echo $foreign_option_1 | sed -e ‘s/dhcp-option DOMAIN/domain/g’ -e ‘s/dhcp-option DNS/nameserver/g’ > /tmp/resolv.conf.auto
echo $foreign_option_2 | sed -e ‘s/dhcp-option DOMAIN/domain/g’ -e ‘s/dhcp-option DNS/nameserver/g’ >> /tmp/resolv.conf.auto
echo $foreign_option_3 | sed -e ‘s/dhcp-option DOMAIN/domain/g’ -e ‘s/dhcp-option DNS/nameserver/g’ >> /tmp/resolv.conf.auto
/etc/openvpn/downdns: (file not include this line)
#!/bin/sh
mv /tmp/resolv.conf.auto.hold /tmp/resolv.conf.auto
- chmod 755 updns
- chmod 755 downdns
*** FINISH! ENJOY YOUR VPN ***
reference