By anujitmarty
Hi all,
Is it possible to disable the public IP address on a Droplet?
Thanks
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!
Hi @anujitmarty,
There is a way but this would mean it won’t be accessible from outside. You’ll only be able to login from your console, are you sure this is what you want?
If yes, then the way to do is
ssh root@YourDropletIp
As soon as you are in, you’ll need to rename the file /etc/network/interfaces. To do so you can do the following
mv /etc/network/interfaces /etc/network/interfaces-old
Then you’ll need to restart your network service
/etc/init.d/networking restart
As soon as you do this, you’ll be able to access the droplet only via the console.
Alternatively, I believe what you are aiming to do is cut off access to your droplet but to your self via SSH, is that correct?
If it is, you’ll just need to close your ports 80 and 443 to do so.
Regards, KDSys
Most likely, you are looking to remove the public-facing interface, but preserve the interface that hosts your private ip address. This is a common configuration for database servers. You want your web servers connecting to the databases over a private IP and your database servers only answering requests on the private network. In such a scenario you would likely be using ssh over the private network to access the database servers as well.
If that is the case, do not move the entire /etc/networking/interfaces file, but instead just delete the configuration lines related to the public interface. You can figure out which interface is the public one by using the ifconfig command. On my debian droplets the default public interface is eth0. So you would just delete the lines in the file related to eth0 and then restart networking.
This way you still have networking available to machines on your private network, but disable any access attempts from remote machines. FYI, I’m not sure how private the droplet private network really is, so I still install a firewall on every server in addition to disabling public networking.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.