Close



Results 1 to 1 of 1
  1. #1

    Port forward to Flashforge Finder via OctoPrint (RPI) (remote printing)

    #enable IP forwarding:
    sudo sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g' /etc/sysctl.conf

    #then activate the changes
    sudo sysctl -p

    #Start iptables
    sudo systemctl start iptables

    #Check iptables rules
    (check that you don't have a deny policy )

    #You can flush all rule to start in a clean env:
    sudo iptables -F
    #+For the nat sudo iptables -t nat -F

    #Add rules
    sudo iptables -t nat -A POSTROUTING --out-interface w**** -j MASQUERADE
    sudo iptables -A FORWARD --in-interface eth0 -j ACCEPT
    sudo iptables -t nat -A PREROUTING -p tcp -i eth0 -m tcp --dport 9000 -j DNAT --to-destination 10.10.100.254:8899
    sudo iptables -t nat -A PREROUTING -p tcp -i eth0 -m tcp --dport 8080 -j DNAT --to-destination 10.10.100.254:80

    #To check :
    sudo iptables -t nat -L -n

    #Save the iptables rule :
    sudo iptables-save | sudo tee /etc/iptables.up.rules

    You will reach the printer via ip number of Raspberry Pi and the port that is 9000
    You will reach the webserver of the printer via Raspberry Pi ip and the port 8080
    Enjoy!

    source: https://serverfault.com/questions/93...-two-interface
    Last edited by Rower; 02-26-2020 at 04:38 PM. Reason: All was in one row

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •