1

I'm trying to transfer a domain name to a new IP address, and am following this tutorial to enable IPv6 for my Digital Ocean droplet. I was on the step "Making the IPv6 Configuration Persistent," and I was supposed to create a new section for my IPv6 address, but instead I edited the existing one.

Now I can't SSH back in! I can't even log in locally.

Does anyone know how to SSH back in and then how to reset my network interfaces file?

Thanks! -Kat

  • Are you able to you ping that machine? – Germar Nov 18 '15 at 02:44
  • Can you access the machine locally? If you can go to this answer and reset the /etc/network/interfaces file back to default. – Alex Lowe Nov 18 '15 at 02:55
  • If you could can you edit your question and add in your /etc/network/interfaces file? So that we can see where you went wrong. – Alex Lowe Nov 18 '15 at 03:02
  • I can't access it locally :( I added some background information if that helps! I'm also not technical by any means so apologies in advance if I'm being a total noob! – Katerina Jeng Nov 18 '15 at 19:59

2 Answers2

1

These command will restore your /etc/network/interfaces file

Drop in to a root shell

sudo bash

Then run these commands.

blank the interfaces file

echo > /etc/network/interfaces 

Put the default connection information back in there assuming that your Ethernet interfaces is eth0 and you have no static ip's set.

echo -e "auto lo\niface lo inet loopback\nauto eth0"  > /etc/network/interfaces

run this command to restart network manager

sudo service network-manager restart
Neil
  • 4,475
  • 3
  • 22
  • 34
1

Digital Ocean provides different rescue modes to fix your droplet (from support site):

  1. Console Access - Your console can be accessed via the control panel by clicking on your droplet, then on Access while your droplet is powered on.

  2. Recovery Kernel - A minimal recovery kernel that can be used to boot your droplet and run filesystem checks can be activated by powering off your droplet and clicking on Settings -> Kernel and then choosing the DO-recovery-static-fsck and then booting your droplet.

  3. Recovery ISO - A recovery ISO that will allow you to mount your filesystem, access your droplet remotely, perform filesystem checks and other tasks is available if necessary. To use this recovery environment you will need to open a ticket with the support team to request that they mount the image and boot your droplet to it. Once you are done with the Recovery ISO just update the support team and they can boot your droplet back to it's disk image.

You should try the first mode. Digital Ocean use static IP's (no DHCP). So you need to put some more information into the /etc/network/interfaces file.

You need to open the control panel and go to Settings > Networking. There you will find Public IPv4 Address, Public IPv4 Netmask and Public IPv4 Gateway. Write them down as we need them later.

Open a console as described in 1. and type (replace <Public IPv4 ...> with values from above):

echo "auto lo\n" | sudo tee /etc/network/interfaces
echo "iface lo inet loopback" | sudo tee -a /etc/network/interfaces
echo "iface eth0 inet static" | sudo tee -a /etc/network/interfaces
echo "  address <Public IPv4 Address>" | sudo tee -a /etc/network/interfaces
echo "  netmask <Public IPv4 Netmask>" | sudo tee -a /etc/network/interfaces
echo "  gateway <Public IPv4 Gateway>" | sudo tee -a /etc/network/interfaces
echo "  dns-nameservers 209.244.0.3" | sudo tee -a /etc/network/interfaces
sudo service network-manager restart

Let me know if the first mode didn't work and I'll provide additional steps you need to do for second or third mode.


Germar
  • 6,377
  • 2
  • 26
  • 39