gjt211
Posts: 1
Joined: Fri May 18, 2018 7:39 am

4G/LTE Private network to Ethernet WAN help

Fri May 18, 2018 8:03 am

I have been searching for what I want to do for some time without success. I believe what I want to do is not very common, but a network guru could hopefully point me in the right direction. Sorry if I am not too good at explaining what I want.

I have a Raspberry Pi connected to the internet using ethernet via my WAN router.
I have a USB 4G/LTE modem with a SIM card that connects to the cellular network connected to the Raspberry Pi.
I also have some 4G/LTE sensors that connect to the cellular network.

I pay additional money to my cellular provider and they give my SIM cards a private static IP address that is not accessible via the internet or anyone else. They call this their IPX network.
Each of my SIM cards on this private network can communicate with each other via their individual static IP addresses (and my desired port).

First problem I need to solve... I don't know how to configure the network on the raspberry Pi to do the following.
Prevent the raspberry Pi from trying to access the internet using the USB 4G/LTE modem, i.e. Only use the ethernet port for internet access.

I will run an MQTT client that will subscribe to a topic on my server (located elsewhere) that is connected to the internet.
I plan to use python as the MQTT client.
When a message is published to the subscribed topic, my Python code will get the destination IP (one of the 4G/LTE sensors) from the published message and send other parts of the same message directly to the 4G/LTE sensor. The code in my sensor will handle the received message.

I think I can also have python create a TCP socket server that listens for any messages from my sensors on it's static IP address. If a message comes in on that TCP socket, I can then use python to forward that over MQTT back to my server over the internet using the ethernet port.

Can anyone help me configure the network setting for the ethernet port and the USB 4G/LTE modem so the Raspberry Pi only uses the ethernet for internet access and the USB 4G/LTE modem is only used for it's private IPX addresses?

Thanks in advance, and again I am sorry if I don't explain myself very well.

epoch1970
Posts: 1944
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: 4G/LTE Private network to Ethernet WAN help

Tue May 22, 2018 7:24 am

I understand you'll be using ethernet to update/access the Pi from your LAN and the USB adapter only to access the sensors.

If so, and long story short, there is nothing special to do on the Pi.
With Raspbian's default config your LAN (or the Internet) will not have access to the sensors network, only the Pi will.
This is due to the fact that routing is disabled on the Pi by default, so packets cannot hop from a network to another via the Pi.

There is no firewalling on the Pi by default. This means that a "sensor" could, say, login via ssh on your Pi and from there possibly alter its configuration or observe what's happening on the LAN.
You can setup iptables rules or install a firewall package to setup an internal layer of protection on the Pi.

I suggest you use the support of your network provider. They should give you all the information required for you to understand i. how to use their service and ii. the security implications of using their service.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “Networking and servers”

Who is online

Users browsing this forum: No registered users and 12 guests