You are not logged in.
I have a raspberry pi running XBMC plugged into one interface over a crossover cable. Both have static IPs set up. I want to forward incoming traffic to the computer on port 8080 to the raspberry pi so I can control it from my phone. As it currently is, nothing can communicate with the pi besides the computer it is plugged into.
I tried various guides on how to forward ports but I couldn't get any of the iptables rules to work. I flushed between each attempt, but nothing did anything. The computer is plugged into the main router on enp3s0 and the pi on enp5s6.
Any help? I really have no idea what I'm doing.
Offline
Did you try setting "net.ipv4.ip_forward = 1" in sysctl?
Also you can use ssh port forwarding (if you just want to forward one port) as follows:
ssh -L yourip:8080:127.0.0.1:8080 username@ip-of-the-XBMC-machine
Then you can connect to yourip:8080 instead of connecting to XBMC's ip.
Offline
Including exactly what you've tried would help, because you've probably already tried this, but this is what should do it:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -I PREROUTING -i enp3s0 -p tcp --dport 8080 -j DNAT --to 192.0.2.1
iptables -I FORWARD -i exp3s0 -p tcp --dport 8080 -d 192.0.2.1 -j ACCEPT
Replace 192.0.2.1 with the actual IP Address of the Pi
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline