4

I have a Raspberry Pi device where I use a 4G modem (D-Link DWM-222) to connect it to the internet.

The interface PPP0 gets an IP and everything works great. I was thinking that I would get a public IP and be able to connect to this device over the internet. But when I try to ssh into it I just get “Connection timed out.”

I have another SIM-card from the same ISP that I use for my home network with a router. And there I’m able to forward a port to a device on my home network to enable SSH into it from the internet, and it just works. The router I use for my home network is a Huawei B535-333 hotspot and it takes a SIM card and connects to the 4G network.

So this led me to believe that I should be able to access my 4G connected Raspberry Pi device directly.

The IP I see when I type ifconfig is different from the one I see when I visit ifconfig.me However in the 4G Router settings page it shows the same IP under "WAN-IP-adress" that I see when I visit ifconfig.me

What am I missing? How can I make this work?

1 Answers1

1

Having a public IP on a 3G/4G modem is a very bad idea, unless you have an unlimited data account. All the bot and IP seekers of the Internet will come PING your IP adress, try to make GET request, and it will consume your data account: providers counts ALL packets, not only the packets you emit, but also the packets you receive, even if it is on a close port. If you want to access to your raspberry from Internet with private IP, use a 'go-between' server like Teamviewer or a mosquitto broker to retreive sensors from your rasp.