Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

ReadDatagram gives wrong ip address and port



  • I have a gsm modem with the following ip address: 10.122.91.216.

    I use readDatagram of QUdpSocket because it's a udp socket:

    qint64 QUdpSocket::readDatagram ( char * data, qint64 maxSize, QHostAddress * address = 0, quint16 * port = 0 )

    The problem is it told me the ip address was 74.205.127.225 even though that is wrong. The actual ip address is 10.122.91.216. Any idea why it gives me the wrong ip address?



  • Hi johnmerlino. It gives you a actual IP for www. The ip address 10.122.xx.xx is a internal ip from gsm operator.
    If you need connect two devices which use one GSM operator you can use 10.122.xx.xx but for communicating across WWW you need to use 74.205.127.225.



  • what about through a vpn?



  • VPN from GSM opertor?



  • I use openvpn on fedora



  • Only in case if GSM operator gives you an internal VPN and you connected via GSM modem you can directly connect with 10.122.xx.xx address because your PC also will have internal 10.122.xx.xx ip. In other cases(as i know) you need use actual WWW address.



  • " if GSM operator gives you an internal VPN". I know that a gsm modem supports an apn setting. But I don't recall a vpn setting on the "at command set" of a gsm modem. Do you have an example?



  • I don't know how GSM operators works in your country, but here where i live VPN ( i mean closed vpn inside operators network and not connected to www ) is a additional service, and you can't just turn it on. This service usualy used for telemetry.
    But in your case, as i understand you have a server and modem sends to it some messages. Does it matter what exactly ip have modem? If you want answer, just send message to detected IP and modem will get it.


Log in to reply