AR750 as OpenVPN client, no DNS for far network

this is openwrt/lede problem, now have “perfect work solution”, but “little stupid”.

  1. of course, you need the “*.ovpn” file.
  2. follow “Overview - GL.iNet Docs” upload your “*.ovpn” file
  3. you need use ssh connect your gl-inet router.
  4. cd /etc/openvpn
  5. ls -l, you will list the porcedure (2) uploaded ovpn file
  6. use vi to edit your ovpn file
  7. 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

  1. save & exit the vi
  2. 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

  1. chmod 755 updns
  2. chmod 755 downdns

*** FINISH! ENJOY YOUR VPN ***

reference

2 Likes