No Internet When VPN is Up

If you are connected to VPN server, but can’t access the Internet, it usually causes by VPN server, may your VPN server only allow site to site network, it doesn’t allow the VPN client to access the Internet.

How do you setup your VPN server? Using GL router as well?

@kyson-lok

How do you setup your VPN server? Using GL router as well?

No, it’s a VPS under Linux. The problem is that it works well if I plug an internet cable to the WAN port, but it does not work when I use the internal mode.

Meanwhile I’m trying to find a clue here /etc/config/

I found the problem.

An ip route 257.257.257.257/32 via wwan0 is missing, but not sure why, could you please execute cat /etc/config/network, and show me the result?

We deal with the ip router on /etc/vpn.user, you can attempt to debug it.

@kyson-lok sure
config interface ‘loopback’
option ifname ‘lo’
option proto ‘static’
option ipaddr ‘127.0.0.1’
option netmask ‘255.0.0.0’

config globals 'globals'
  option ula_prefix 'xxxx:xxxx:xxxx::/48'

config interface 'lan'
  option type 'bridge'
  option proto 'static'
  option netmask '255.255.255.0'
  option ip6assign '60'
  option hostname 'GL-MIFI-ebb'
  option ipaddr '192.168.94.1'
  option ifname 'eth1'

config interface 'wan'
  option proto 'dhcp'
  option hostname 'GL-MIFI-ebb'
  option ifname 'eth0'
  option metric '10'

config interface 'wan6'
  option proto 'dhcpv6'
  option ifname 'eth0'

config interface 'guest'
  option ifname 'guest'
  option type 'bridge'
  option proto 'static'
  option ipaddr '192.168.9.1'
  option netmask '255.255.255.0'
  option ip6assign '60'

config interface 'modem_1_1_2'
  option ifname 'wwan0'
  option service 'umts'
  option apn 'globaldata'
  option proto 'qmi'
  option device '/dev/cdc-wdm0'
  option username 'beeline'
  option password 'beeline'
  option metric '40'
  option disabled '0'

config interface 'ovpn'
  option ifname 'tun0'
  option proto 'none'

Meanwhile I’ll look into /etc/vpn.user

@kyson-lok, here is what I found in the script
# $INTERFACE Name of the interface which went up or down (e.g. "wan" or "wwan")
# $DEVICE Physical device name which interface went up or down (e.g. "eth0" or "wwan0")

I guess I need to set these vars, but in what script must I set them?

Is the modem connection reliable?
I had similar issues where the tun interface stays up and the routes get deleted.
I removed Persistent-tun from my config.

@leonardo yes, it’s reliable.

I removed Persistent-tun from my config.

Unfortunately I didn’t help.

You can attempt to edit both of the file /etc/hotplug.d/iface/17-vpn-user and /etc/vpn.user, please add modem_1_1_2 to them.

For example:

[ "$iface" = "unknown" ] && {
    tmpiface="wan wwan modem tethering modem_1_1_2"
    tmpinterface=`echo $INTERFACE | cut -f1 -d_`
    for inet in $tmpiface; do
        [ "$inet" = "$INTERFACE" -o "$inet" = "$tmpinterface" ] && {
            iface="$INTERFACE"
            break
        }
    done
}

@kyson-lok sorry for huge delay, just got time to test your recommendation.

Unfortunately it didn’t help. I also tested one thing:
echo modem_1_1_2_4 | cut -f1 -d_
outputs
modem, so adding modem_1_1_2 is redundant.

Does know how VPN scripts generally work, at least I will know here to dig.

Thanks, Slava

Looks like I found the problem. Removing this option from the config made it work.
redirect-gateway

I guess you also can use pull-filter ignore "redirect-gateway" option if you don’t have access to the server config.