Viktor Jaep
Part of the Furniture
And I appreciate the suggestions, @Kal1975!OK. I don't think I used any interface when I tried a manual ping on the router. I think I saw it in the code but it didn't click. However, the behavior I described did happen. Browsing did not work on VPN connected devices but VPNMON showed all was OK.
It happens once in a while but it still is happening. I'll try ping over the VPN tunnel next time it happens.
As for the ipapi.co, I didn't look too much into that and wasn't clear on what it was used for. However, now that I know, I checked and I think I've figured out what the issue is. In the VPN client slot page, the address specified can also be a URL in the field:
Server Address and Port
It doesn't have to be an IP address, as is the case for my situation. That probably is done to handle the VPN provider changing server IP addresses. I looked at the nvram variables and I think the rip and not the addr variable should be used:
vpn_client$1_addr ---> vpn_client$1_rip
I think "rip" probably stands for Remote IP. This seemed to be the public IP address for the slot / active VPN when I had a look. That should solve the Undefined in my case and probably all cases.
PS: I was thinking a little more about this. Maybe this should be a configuration option. For example, you can set the description to anything like "New York - Gaming VPN" and another might be "Chicago - Netflix". It wouldn't be an Exit, though. I have "New York-JFK". This is helpful as the OpenVPN configuration file is named using the airport, JFK. I believe many VPN providers do that. In any case, just another thought...no biggie.
PPS: Another thing I noticed. Now, when using the RIP variable, it displays a city. However, it's not what I was expecting. For example, I see "Ashburn" instead of "Washington, DC". I think Ashburn is a suburb of DC but again, I was thinking it would say Washington DC. Just another observation.
Everyone has suggestions
So this is actually really interesting... I started looking into that RIP variable, and when I tried to call it, it was actually blank! The Addr variable was giving me an IP. I dove into a bit further, and found an article from 5 years ago where RMerlin mentions that the RIP variable only gets updated when you visit the actual UI in a browser. But then I found out that you can force this variable to populate in NVRAM by running this script: /usr/sbin/gettunnelip.sh.
So I'll change this logic around a bit and will start testing using this variable. It will be interesting to see how long it takes to disappear (if it even does after running this script). I'll continue to monitor the city name situation, but I'm actually in favor of getting the most accurate location of my exit IP, no matter what your vpn provider might be telling you.