简体   繁体   中英

Cannot access Raspberry Pi connected to 3g from home network

I have installed a 3g modem on a Raspberry Pi and managed to get access to the internet on the device (I can browse the internet and download updates from the Pi). This was accomplished using WVDIAL. I am only using the 3g connection for internet access and not the Pi's ethernet port. I want to create a ssh or Windows desktop connection into the Pi from my laptop, which is connected to the home router. I have tried using TightVNC, SSH and Windows Remote Desktop to log onto the Pi, but nothing works.

Before I set up the Pi with the 3g connection, I had it connected to the same home network my laptop is connected to and everything worked fine. Now that I have disconnected the LAN cable to the Pi and set up the 3g connection, I cannot log into it anymore. I am using the dynamically allocated IP address that the 3g service provider has allocated to the Pi to try and log in to it.

Any assistance with this problem will be appreciated!

When you were connected on your home network the IP address your PI was assigned was in the same network as your PC and hence it was able to connect and communicate.

When you are assigned an IP address on a 3G network the IP address is 'internal' to that 3G network (generally) and will not be reachable from your home network computer. The way a device on a 3G network communicates with other servers on the network is generally via NAT devices which translate the 3G 'internal' IP address to an externally valid internet IP address. See the following for some info on NAT devices:

http://en.wikipedia.org/wiki/Network_address_translation

There are some techniques to discover the mapping between 'internal' and 'external' IP addresses - see the discussion on 'STUN' about quarter way down the above linked page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM