1

RPi3 is connected to internet via 3G dongle. wwan0 interface IP is in public range, is accessible from outside and hasn't changed since I got the SIM. So far so good, right?

What worries me, is that a probably NAT-ed IP is sent to noip, not the interface one, making the site served by RPi inaccessible, unless the IP is known. Is there a way to send the "correct", wwan0 interface IP to noip?

Second worry is that when RPi will be moved off-site (to measure indoor temp), the dongle will use a different mobile mast and probably the IP of the wwan0 iface will change. My fear is that I will have to do a custom script to notify noip about the interface IP when IP changes or some sort of other notification.

Any feedback is appreciated!

1 Answer 1

1

Based on your story, my guess is that your operator has a proxy in place for mobile data speed optimization (something that reduces image sizes for example). This means your HTTP traffic will go through a proxy on the operator side, which could well be NAT'ed.

One way to avoid this is sending an explicit IP to noip (from their documentation):

curl http://username:[email protected]/nic/update?hostname=mytest.example.com&myip=1.2.3.4

This could easily be integrated into a shell script:

#!/bin/bash

IP=$(/sbin/ip -4 a l wwan0 | grep 'inet ' | grep -oP '(?<=inet\s)\d+(\.\d+){3}')

curl "http://username:[email protected]/nic/update?hostname=mytest.example.com&myip=${IP}"

Make this script executable and run it from cron every 10 minutes or so:

chmod 755 /home/user/update_noip.sh
crontab -e
# Add:
*/10 * * * * /home/user/update_noip.sh >/dev/null 2>&1
1
  • Thank you, @mtak, for quick and concise reply! Makes me bit embarrassed that I didn't even think of checking the noip documentation, but hey, we're only human. Thanks for the script as well, something new to broaden my mind!
    – krg
    Commented Jan 16, 2018 at 19:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .