Limit Droplet traffic to DO Load Balancer
I have a DO load balancer in front of two droplets. I want to be able to restrict traffic using ufw on the droplets to only allow traffic from the load balancer.
My app listens for HTTP on port 8001 so I’ve tried using the following:
sudo ufw allow from <publicIpOfLB> to any port 8001
Where <publicIpOfLB> is the public IP address shown on the load balancer config page
However, I assume the load balancer traffic isn’t seen to be coming from the public IP address and so this rule doesn’t allow the traffic through but I can’t see any other address to use. Any ideas how to achieve this?
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.×