2

Machine A has two network interfaces:

  • Network eth0: 10.10.20.0/24
  • Network wlan0: 192.168.1.145/24

Machine A has 192.168.1.145 as Default Gateway, and also a route to pass 172.16.0.0/16 to 10.10.20.1.

I want allow access from wlan0 192.168.1.145:3389 to 172.16.1.14:3389 using UFW, so I did:

  1. /etc/default/ufw:

    DEFAULT_FORWARD_POLICY="ACCEPT"

  2. /etc/ufw/sysctl.conf:

    net/ipv4/ip_forward=1

  3. /etc/ufw/before.rules:

    *nat :PREROUTING ACCEPT [0:0] -A PREROUTING -i wlan0 -p tcp -m tcp -d 192.168.1.145 --dport 3389 -j DNAT --to-destination 172.16.1.14 -A PREROUTING -i wlan0 -p udp -m udp -d 192.168.1.145 --dport 3389 -j DNAT --to-destination 172.16.1.14 COMMIT

  4. Add port 3389 to allow in UFW: ufw allow from any to any port 3389

But it's not working!

  • 1
    I came across PortFusion which makes super easy to do that like this: PortFusion 3389 ] - 172.16.1.14 3389, but still no luck with ufw. – slashsbin Oct 1 '14 at 6:25
1

I used the command sudo ufw allow 3389/tcp and then restarted using sudo /etc/init.d/xrdp restart to solve this same issue on a pi. However my /etc/ufw/before.rules file looked like this:

# START OPENVPN RULES
# NAT table rules
*nat
:POSTROUTING ACCEPT [0:0]
# Allow traffic from OpenVPN client to eth0
-A POSTROUTING -s 10.8.0.0/8 -o eth0 -j MASQUERADE
COMMIT
# END OPENVPN RULES

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.