Finding out your OpenVPN server IP address

Fig.01: Finding out your OpenVPN server IP address

Fig.01: Finding out your OpenVPN server IP address

You can easily find out your OpenVPN server IP address. The syntax is as follows to get tun0 ip address on Unix or Linux:
ifconfig tun0
OR use Linux specific command:
ip a show tun0
Sample outputs:

40: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
    link/none 
    inet 10.8.0.1/24 brd 10.8.0.255 scope global tun0
       valid_lft forever preferred_lft forever

In this case my IP address for tun0 is 10.8.0.1/24.

A note about NAT address

If you nat connection check out your router for more info. To find public IP address from Linux or Unix shell, enter:
dig TXT +short o-o.myaddr.l.google.com @ns1.google.com

Examples and usage: How to pair Pi-hole with an OpenVPN to block ads and increase privacy on Ubuntu / Debian Linux