How to only allow Internet access to my Floating IP and block Internet access to the other droplet IP's

I am using a Floating IP to access one droplet in a group of droplets. Now I need to block public Internet access to the other droplets in the group and only allow access to the droplet assigned the Floating IP. I am running Ubuntu 18.04 LTS. How can I achieve this with UFW?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

With UFW I believe that you could deny the traffic for a specific interface.

To do so, you would need to first find out the interface for your static IP, you can do that with the ip a or the ifconfig commands.

After that to deny the inbound traffic you could use the following:

ufw deny in on eth0123

Note that you would need to change the eth0123 part with the interface that you want to deny access to.

Hope that this helps. Regards, Bobby