Unable to add interface and IPs on ufw allow rule for allowing host

Discussions about using Linux guests in VirtualBox.
Post Reply
Marco Sulla
Posts: 35
Joined: 14. Sep 2015, 23:48

Unable to add interface and IPs on ufw allow rule for allowing host

Post by Marco Sulla »

I run Lubuntu 18.0.4 on a Virtualbox VM hosted by Windows 10.

I added a port forwarding in Virtualbox, and I had also to add a rule for ufw. I tried:

Code: Select all

sudo ufw allow on enp0s3 proto tcp from 127.0.0.1 to 10.0.2.2 port 8080
but this rule does not work. I had to change it to:

Code: Select all

sudo ufw allow proto tcp from any to any port 8080
It works, but I would restrict the rule to the specific interface and IPs. I tried to add interface, `from` IP and `to` IP one by one, but they do not work.

Where I'm wronging?
Post Reply