RUTX50 Raspberry Pi port forwarding

Hi folks

I’ve just moved onto a boat and setup my router, when I amended the settings on my RaspberryPi webserver for the static port 192.168.1.160 and portforwarded ports 443 and 80 on the router, my website doesn’t show. I pinged it which returned a constant 32 bytes and I can successfully ssh into it on the LAN.

I’m a bit out of my depth here, I thought that should do the trick and deliver the site.

Any help greatly appreciated!


Greetings,

For testing purposes, could you try changing the external ports in your configuration from 80 to 8080 on your website port 80 port forwarding rule and 443 to 9090 on your website port 443 rule?

There is a possibility that the port forwards that you have set up are not working, since they are in use already. By default, port 80 is used for HTTP and 443 is used for HTTPS which is the reason.

If this specific solution works out for you, but you’d still like to use the ports 80 and 443, head to System → Administration → Access Control and change the HTTP and HTTPS ports to something else just so your router doesn’t use the default ones anymore.
Remote Device Access - Teltonika Networks Wiki (teltonika-networks.com)

If the above steps do not work, another thing I would like to clarify is, are you trying to reach the website through WAN or LAN? Does your router have a Public IP address?

I would also like to request some screenshots where you’re trying to reach the website of your raspberry pi where the URL would be visible.

Note: Please make sure to blur the Public IP address that you are using, prior to posting the image.

Best regards.

Thanks for your help here, I’ll try your advice later this evening and let you know.

1 Like

Hi

I tried changing the port forwarding rules alas no good, I’ll try to look at the nano /etc/dhcpcd.conf file and see if there are anomolies there. Yes, my computer does have a public ip and I am connnecting to the pi on the lan.

Thanks

Hi
I have tried your suggestions and still cannot get it to work, when I setup a static ip interface it says ‘down’. If you could help I’d really appreciate it, thanks.

Dude, with 192.186.1.160 you get nowhere anyway :wink:
Can you correct that typo and try again?

1 Like

Doh, thanks for pointing that out, I’ve amended it but it still reads as ‘down’.


I can still SSH in and it seems to ping fine?
image
Do I need to enable the DHCP server for its interface?

Thanks for your help here!

Greetings,

I’d like to clarify and point out a couple of things:

  1. Are you trying to port forward from LAN or WAN (the internet)? In other words, are you trying to reach the Raspberry PI from the internet via the domain address or from your local network?
  2. Are you trying to make it so when you enter the domain address davidhallows.com you get redirected to the LAN of your raspberry pi?
  3. If you are trying to port forward from WAN, you would need to have a public mobile IP address. As I advised to blur or remove any sensitive data, I assume you could have changed the mobile WAN settings to a private IP, however, if you haven’t performed any changes and you need the port forwarding to work from the internet, you would need a Public IP address.
    4.You can find more information regarding it here:* Private and Public IP Addresses - Teltonika Networks Wiki
  4. There are issues with your current interface configuration.

Currently, you have created a new interface called “raspberry” and have given it an IP address 192.168.1.160. However, this is not the raspberry PI, with this configuration you have assigned the IP address 192.168.1.160 to the router itself. In addition, this could have caused a potential IP conflict as it overlaps with your default LAN network.

To rectify this, I would recommend:
4.1) Deleting this interface completely
4.2) Check the Raspberry PI settings to verify its static IP address (to make sure it is 192.168.1.160). Also, if it does have a DHCP option I recommend disabling it.
4.3) Try connecting Raspberry PI to the LAN port of the device and pinging 192.168.1.160 (or the IP address that is set on the Raspberry if you find out that there is a different IP address at step 4.2).
4.4) if step 4.3) is successful, the final step will depend on whether you are trying to port forward from WAN to LAN or within a LAN network:
5. From WAN to LAN: your port forwarding rule does not need changes, but you should make sure that a Public IP is available and also specify the port when using the domain name, for example: www.davidhallows.com:8080

Here’s a guide on port forwarding: https://wiki.teltonika-networks.com/view/RUTX50_Firewall#Port_Forwards

Also, first I would recommend trying it via the IP address, for example, let’s say your Public IP address is 88.88.88.88, so the request would look like this: 88.88.88.88:8080

  • From LAN to LAN: a less likely option, but if this would be your setup, you would need to change the Source zone to LAN. But usually, you want to avoid LAN-to-LAN port forwarding and just have a DNS resolver/Server on your LAN network.

Let me know how it goes,

Best regards.

1 Like

Hi
Thanks for all the help, I’ll doubtless sound foolish but here goes - for clarity I previously had it set up so that I could admin into my raspberry pi website server admin account from the internet, from my workplace etc. I’m not entirely sure if this answers your first question…I didn’t ever need to or try to login to the pi, just the wordpress hosted part.
2. I think so, yes, whenever anyone goes to davidhallows.com it throws up the website, from the LAN I believe.
3. I’m not sure on this, I followed a tutorial a few years back that setup a LAMP server with a DuckDNS redirect element.
4. I’ve deleted it.
4.2. ifconfig gives

eth0 inet 192.168.1.160 netmask 25.255.255.0 broadcast 192.168.1.160
io different
wLan0 inet 192.168.1.160 netmask 25.255.255.0 broadcast 192.168.1.160
4.3 Ping seemed fine
image
5. The public ip address with :8080 at the end gave me this
image

This is the type of setup
https://projects.raspberrypi.org/en/projects/lamp-web-server-with-wordpress

I’m not sure if this info helps a diagnosis?

Thanks again

Greetings Dave,

I’d like to clarify a couple of things once again:

  1. Regarding the public IP address that we have talked about previously – is the public IP that you have anything BUT like the list of these IP addresses:

10.0.x.x

172.16.x.x

192.168.x.x

As mentioned previously, please do not publicly share the Public IP address that you might have.

The IP addresses listed above are all private IP addresses, which, in essence, means that they’re all used for LAN purposes. I’m trying to clarify this, since the tutorial that you have provided is about hosting a webserver in LAN.

  1. I would also like to ask you if you could try to disable the firewall rules / port forwards that you have created and also enable remote access to the device (I will attach a link below to a wiki article). After that, try to reach your router via its static IP address, let me know if you are able to.

Here’s the wiki article as promised: Remote Device Access - Teltonika Networks Wiki

Best regards.

Hi Vinvin

Thanks again for helping to educate me here.

My Public Ip is not like those, it starts with a 31.xx.xx.xx.xxx

I went through step 2, applied/saved the configuration changes.

Then using my public IP address unfortunately gave me this, nothing as yet -

Greetings Dave,

I’d like to offer you to a remote session where we could discuss the entire configuration more in detail. We will have to transfer our conversation onto a different platform. You should receive an e-mail with the instructions on how to access the platform, the e-mail that you will receive should arrive to the e-mail that you have registered your current Teltonika Community account.

Have a nice day, I’ll be waiting to hear from you!

This topic was automatically closed after 15 days. New replies are no longer allowed.