Skip to main content
20 of 31
added 471 characters in body
Agustin
  • 146
  • 12

Accessing a hotspot raspberry pi 3B+ and accessing network devices

I have a Raspberry Pi 3B+ which is working as a hotspot using a Hologram Nova usb ppp0 device where it receives Internet from and routes the internet through WiFi and Ethernet. This Hologram usb ppp0 device does not allow port forwarding so can't play around with ports on it.

I have realized that the IP address on the hotspot-pi changes every time the hotspot-pi reboots, Given that it's a mobile SIM, the cellphone company does not assign a permanent IP address. This makes it very hard or impractical to connect through SSH or access the local network.

The hotspot-pi's local IP address is 192.168.50.1; and it uses a bridge with a range of 192.168.50.0/24 that work or route both wlan0 and eth0 interfaces. All devices connected to the hotspot via wlan0 or eth0 obtain an ip in the range of the 192.168.50.0/24.

I created a home VPN using OpenVPN and a second raspberry pi (different Pi, located at home and acting as a server), and have the hotspot-pi connect to the OpenVPN-pi (at home) using OpenVPN as a client.

The purpose of this is so that once the hotspot-pi is connected to the OpenVPN-pi, I can see the hotspot-pi and all the other devices connected to it on my local network at home (OpenVPN-pi) using either FING (phone app) or nmap (linux) or any type of ip scanner application.

Edit: I have Completed part 1, 2 and 3 of Ingo's Answer. I get OpenVPN to start and connect to the server successfully. However where my issues arise are:

  • Once connected to the OpenVPN-pi, all devices connected to the hotspot-pi loose internet access.
  • Only the hotspot-pi is able to ping the OpenVPN-pi at 10.8.0.1 or any IP's in the server's local network
  • Only the hotspot-pi retains the ability to connect to internet

What's left to do:

  • Re-allow internet access to devices connected to the Hotspot-pi while it is connected to VPN.
  • Allow devices in the server side network (OpenVPN-pi at home) to see devices attached to hotspot-pi (client VPN side on the field)
  • The ability to ping or ssh from any device on the server side to any devices on the client side.

I have done a bit more research:

I now know, that I need to do a type of bridging or layer 2 vpn. and I have found some information about it: OpenVPN bridged vpn

However with this new given information I know that if I try to simply implement it, it will definitely break something else. I am not a network engineer nor do I have the tremendous experience with networks, so I would greatly appreciate if someone experienced would be able to explain this a bit better for me.

Current settings on the client vpn hotspot-pi:

Result of ip addr:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever

2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 1000
link/ether b8:27:eb:3f:0e:89 brd ff:ff:ff:ff:ff:ff

3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 8a:ea:17:87:3f:87 brd ff:ff:ff:ff:ff:ff
inet 192.168.50.1/24 brd 192.168.50.255 scope global br0
   valid_lft forever preferred_lft forever
inet6 fe80::88ea:17ff:fe87:3f87/64 scope link 
   valid_lft forever preferred_lft forever

4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000
link/ether b8:27:eb:6a:5b:dc brd ff:ff:ff:ff:ff:ff
inet6 fe80::ba27:ebff:fe6a:5bdc/64 scope link 
   valid_lft forever preferred_lft forever

6: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 3
link/ppp 
inet xx.xxx.xxx.xx/32 scope global ppp0
   valid_lft forever preferred_lft forever

8: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
link/none 
inet 10.8.0.3/24 brd 10.8.0.255 scope global tun0
   valid_lft forever preferred_lft forever
inet6 fe80::7fd:92f0:75ae:726e/64 scope link flags 800 
   valid_lft forever preferred_lft forever

Result of ip route:

pi@RPiHotspot:~ $ ip route

0.0.0.0/1 via 10.8.0.1 dev tun0 
default via xx.xxx.xxx.xx dev ppp0 proto static 
10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.3 
10.176.0.0/16 via xx.xxx.xxx.xx dev ppp0 proto static 
10.254.0.0/16 via xx.xxx.xxx.xx dev ppp0 proto static 
xx.xxx.xx.xx via xx.xxx.xxx.xx dev ppp0 
128.0.0.0/1 via 10.8.0.1 dev tun0 
192.168.50.0/24 dev br0 proto kernel scope link src 192.168.50.1 
                                                        
                    

As always, I would greatly appreciate any and all help! I feel I'm so close to finishing this project I'm at the end of the line!

Thank you kindly!

Agustin
  • 146
  • 12