0

I am struggling to set up a VPN on my Pi. I keep getting pretty generic failure messages, following multiple walkthroughs. I am heading back to basics, and realize that I may be having problems with something as simple as my IP addresses. Commands that are supposed to generate the same result generate different results for me.

ifconfig, and ip addr show eth0 give what I expect (my internal IP address).

inet 192.168.0.20.

However: host myip.opendns.com resolver1.opendns.com, gives something different. www.whatismyip.com gives something different again; and dig TXT +short o-o.myaddr.l.google.com @ns1.google.com, also gives something different - a string of numbers in a totally different form this time.

I am getting these commands from this page: https://www.cyberciti.biz/faq/how-to-install-and-configure-an-openvpn-server-on-debian-9-in-5-minutes/ where it seems host... and dig... commands should give the same thing as ip addr.... I have seen others point me to ifconfig and whatismyip.

Can someone tell me: 1. Why these commands are all giving me something different?

  1. What is my public IP address? (i know my internal IP is right as i ssh through it)

Thanks.

MorrisseyJ
  • 113
  • 1
  • 1
  • 7
  • 1
    This is not a Pi question. Normally IP is allocated by your ISP, and your router uses NAT to map internal addresses. – Milliways Mar 25 '18 at 02:32
  • 192.168.0.20 is an internal IP address on your local lan .... the outside world sees the IP address of your router which has been assigned by your ISP .... https://www.whatismyip.com/ will show that address – jsotola Mar 25 '18 at 02:57
  • Google "my ip" and they will tell you your public IP at the top of the results page. – Brick Mar 25 '18 at 03:04
  • There are many possibilities for ip addresses on a virtual private network: the outside ips of the VPN tunnel ends, the ips within the tunnel (private network), the public ip of your internet router outside to the internet, the NATed ips within your local network (maybe the same as your tunneld private network?). But nothing specific to raspberry pi. Please ask at superuser. – Ingo Mar 25 '18 at 10:42

1 Answers1

0

When I want to know my public-facing IP, whether or not I have my VPN on or off, I use this URL:

https://bearsmyip.com/

It is very clear in showing what it finds.


FYI: I use Tunnelbear VPN as a Chrome extension, so it works on anything that runs Chrome or Chromium. Switching the VPN on or off shows completely different addresses.

SDsolar
  • 2,348
  • 8
  • 25
  • 43