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

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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