Remotely connecting to Quectel RM502Q-AE

Hello,
I have a Raspberry Pi 4 connected with Quectel RM502Q-AE module. The SIM card I am using has a fixed public IP address assigned to it. What configuration should I do so that I can remotely ssh the Raspbery Pi using the dedicated IP address that has been assigned to that SIM card?
Thank you.

Dear @userkk
Is the fixed public IP address assign by network?
Did you try to use IP address via SSH?
Please use ifconfig to check the IP address.

From the outside, could you ping the device with that IP?

Hello,
The fixed public IP is assigned by the network operator.
I tried to ssh but I get the following error: port 22: Connection refused. So how can I enable the ssh from the modem?
The address I get from ifconfig is a private address beginning with 192.168.

Yes I can ping the device from outside with the given IP address.

  1. The network operator forbid you have tcp connection via port 22.
    2.There is some settings on the RPI that forbid you do that.

I think you can test with TCP socket first.
You could check the TCP connection with tcpdump.
As we know, SSH will use TCP and port 22 to set up connection.

Thanks for the suggestion. I tested with tcpdump port 22 and I can listen on the port… also I can access the RPI via ssh from the IP address it gets when connected via ethernet. But the problem is that I want to connect directly with the IP address of the sim card on the Quectel modem, should I check for settings on RPI or the modem to enable this connection?

1 Like

I have the same issue as is reported in the thread.

The modem has an IP address which comes from the provider, but the device appears to be functioning as a NAT gateway, It is not clear how to perform a port forward to the internal IP of the RPI which is on 192.168.225.x.

The modem is in router mode.
If you would like the public IP you need to set the modem
AT+QCFG=“usbnet”,0
AT+QCFG=“usbnet”,2

But you need also set up data call with the AT command or the quectel-CM.

1 Like

That was the hint I needed. Thank you!