5654 questions

6864 answers

11066 comments

6947 members

0 votes
558 views 4 comments
by

Hi community,

I am trying to forward a port on my router (RUT500) in the LAN to a device on a specific port. Normally this would be an easy task.

I have the following configuration (and no other configuration except the default settings):

I have two PCs connected to the router via WLAN. On one PC a local PHP server runs on port 8000.

I want to access the local server now from the other pc. I can ping the other pc over the routers WLAN without problems. I can also access the PHP server if i just type in the local IP of the other pc in the browser. But i cannot access the other PCs PHP server if i type in the routers local adress with the port 12345 (192.168.1.1:12345). Normally it should then forward the request to the local IP on port 8000 and give me php servers webpage.

It always tells me that the connection was refused. What am I doing wrong? I already spent hours and hours searching for the wrong part in my configuration. Normally this should just work, right?

Thanks for every answer!

Florian

by
Leave "External IP Adress" empty = allow any IP.

2 Answers

+1 vote
by

Hi,

For port forwarding rule, try using:

After that connect to router via SSH and add following iptables rule:

iptables -t nat -A POSTROUTING -p tcp -d 192.168.1.198 --dport 8000 -j SNAT --to-source 192.168.1.1

It should allow to use port forward between devices in lan.

Best answer
by
THANKS! That solved it. You made my day!

Would you be so kind to explain, why i need to do this, so i can learn something from it?

Kind regards

Florian
0 votes
by
Make sure NAT loopback is enabled on those rules.
by

Thanks for your response! How would I do this? The configuration page looks like this:

I can't find an option "NAT loopback". Where shall I search?

by
look in the original port forward rule you made.