How can I access my Raspberry PI 3 (Apache/Nextcloud) from a ZTE MF831 data stick? I use Raspbian Strecth and got a public/static IP from my provider.
EDIT: The data stick is connected directly to the Pi.
EDIT: (screenshot added)
It appears the ZTE MF831 acts much like a router+modem, assigning your Pi the LAN address of
192.168.0.182 in one instance.
I'm assuming that your 4G connection is working in at least one direction. That is, with the stick your Pi can currently access outside web pages even with no ethernet connection and WiFi disabled. The next step is to get it working in the other direction.
From webGUI (http://192.168.0.1), a first straightforward troubleshooting step could be to put your Pi in the DMZ, like in this screenshot:
(Use 192.168.0.182 or whatever your cdc_ether (USB) IP address comes out to.)
Note that this will expose all ports to the outside web, so if you happen to have activated SSH be sure to change your default password to something other than
Once configured, try accessing your Apache server on the static IP from outside. Just in case selective ports are blocked or the webGUI server conflicts on port 80, you can also troubleshoot with other ports. For example you could enable SSH (
sudo systemctl start ssh) and try to
ssh from outside, or test Apache on a different port.
After the simple DMZ approach has been verified, you should turn it off and go for the Port Forwarding tab to forward only selective traffic rather than the less secure DMZ forwarding all traffic. Forward port 80 for HTTP, port 443 for HTTPS if Nextcloud if it supports that. This may have been what @Deepesh was trying to say, just he mentioned the wrong port.
Edit (to summarize as far as we got to in the discussion comments): Although the screenshot shows there exists a full-featured firmware for MF831 from 2016 or newer, some providers use older firmware or have removed features from webGUI. If so, it still might be possible to access hidden options via explicit
curl commands. For setting the DMZ:
curl -s 'http://192.168.0.1/goform/goform_set_cmd_process' -H 'Host: 192.168.0.1' -H 'Referer: http://192.168.0.1/index.html' --compressed --data 'goformId=DMZ_SETTING&DMZEnabled=1&DMZIPAddress=192.168.0.182'
where in place of 192.168.0.182 put your local IP address as revealed by
ifconfig. If successful, the command should print out:
It may then be necessary to reset the USB modem before testing the DMZ.
For that you'll need to setup port forwarding in your router...
Go to your pi's terminal and type
route -ne and copy the first entry (usually 192.168.something.something) paste it in your browser and you'll go to your router settings, the credentials are different for different routers so you'll have to google for the default username and password. Once you're in you'll get into a web UI, navigate to port forwarding settings and once you're there you need to set up port forwarding for port 22 and enter your pi's IP (static ip), then save the settings. after that go to a browser in your pi and type "what's my IP " in google....
While logging in using ssh type the ip you got from google and port 22. and you're done