0

I currently have a setup where I got a raspberry pi connected WIRELESSLY to a router and a WIRED desktop connected to the raspberry pi (via Ethernet) and receiving internet from the pi. On the Desktop I want to run a Minecraft server on port 2000, however, I believe that because of my setup this port can only be seen by the PI alone and any not the router and anything else connected to the router. I currently have the PI ITSELF port-forwarded on the router for port 4300, I just need some way to link the pi's wireless connection of port 192.168.1.55:4300 to the shared Ethernet connection of port 192.168.220.78:2000.

I've looked into messing around with the IPTABLES in Rasbian Linux but I don't fully understand them.

My ultimate goal is to let this server be accessible to anyone outside of my home.

  • can you issue: iptables -L if do you have any rules active. Also I found a useful documentation from the oficial page: https://www.raspberrypi.org/documentation/configuration/security.md go to "Install a firewall" section over there explains the "ufw" command rather than "iptables" by other ei you can take a look to KristFR replied from: https://serverfault.com/questions/586486/how-to-do-the-port-forwarding-from-one-ip-to-another-ip-in-same-network – J.Rojas Jan 02 '20 at 16:00
  • Thanks for the quick response. I looked through the links you sent and they seem to point to the issue I'm experiencing yet when I tried it, none of them solve it. For the iptables i've tried using these command $sudo iptables -t nat -A PREROUTING -p tcp -i wlan0 --dport 4300 -j DNAT --to 192.168.220.78 or this other command $sudo iptables -t nat -A POSTROUTING -i eth0 -p tcp -d 192.168.220.78 --dport 43120 -j SNAT --to-source 192.168.1.55:4300 – Terence Cox Jan 04 '20 at 01:38

1 Answers1

1

I found the problem, apparently, I needed to accept the incoming connections on the server's computer. So on the same computer as the minecraft server I ran: sudo iptables -A INPUT -p tcp --dport 2000 -j ACCEPT