Recovering Network Connectivity on a Dual-Interface DigitalOcean Droplet

Recovering Network Connectivity on a Dual-Interface DigitalOcean Droplet
Photo by Dimitri Karastelev / Unsplash

February 19, 2025

Recently, I faced an interesting challenge with my DigitalOcean Droplet that was configured with two network interfaces (eth0 and eth1). After a system update, the network connectivity was completely lost, despite having both interfaces properly configured in the system. This post details my journey through diagnosing and fixing this issue, which turned out to be different from common network problems.

The Initial Scenario

My Droplet was running a production environment with two network interfaces:

  • eth0: Handling public traffic with a static IP
  • eth1: Managing internal network communications (private network)

After a routine system update, both interfaces stopped responding, although they were still visible in the system. What made this case particularly interesting was the dual-interface setup, which added an extra layer of complexity to the troubleshooting process.

Diagnostic Steps

The first indication of trouble was when both SSH and HTTP traffic stopped responding. Through the DigitalOcean Recovery Console, I discovered:

  1. Both interfaces were present in the system:
ip link show
1: lo: <LOOPBACK,UP,LOWER_UP>
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP>
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP>
  1. The routing table showed correct routes:
ip route
default via <gateway-ip> dev eth0 proto static
10.0.0.0/16 dev eth0 proto kernel scope link src <private-ip>
10.100.0.0/16 dev eth1 proto kernel scope link src <internal-ip>
<public-network>/20 dev eth0 proto kernel scope link src <public-ip>

The Recovery Process

Here's how I managed to restore connectivity:

  1. Booted into Recovery ISO mode through DigitalOcean's control panel
  2. Set up the recovery environment:
sudo vim /etc/resolv.conf
# Added Google's DNS
nameserver 8.8.8.8
  1. Mounted and chrooted into the system:
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo cp /etc/resolv.conf /mnt/etc/resolv.conf
sudo chroot /mnt
  1. Reinstalled critical networking packages:
apt-get update
apt-get install --reinstall netplan.io cloud-init systemd-resolved

What Made This Case Unique

Unlike most network issues where only one interface is involved, this setup required careful attention to both interfaces and their respective configurations. The system had both traditional networking (/etc/network/interfaces) and modern netplan configurations working together:

# /etc/netplan/50-cloud-init.yaml excerpt
network:
    version: 2
    ethernets:
        eth0:
            addresses:
            - <public-ip>/20
            - <private-ip>/16
        eth1:
            addresses:
            - <internal-ip>/16

Key Lessons

  1. Dual-interface setups require extra attention during system updates
  2. Having both traditional and modern network configurations can complicate troubleshooting
  3. The Recovery ISO is essential for fixing network issues, especially in complex setups
  4. Always document your network configuration, including both interfaces and their purposes

Best Practices Moving Forward

To prevent similar issues in dual-interface setups:

  • Keep separate backups of network configurations for both interfaces
  • Test both interfaces independently after system changes
  • Maintain documentation about which services use which interface
  • Consider using configuration management tools to track network setup changes
  • Regular system backups before major updates
  • Document all IP assignments and network topology separately from the configuration files

Conclusion

While this issue shared some similarities with common network problems, the dual-interface setup made it unique. The solution involved understanding both traditional and modern networking approaches in Ubuntu, while dealing with multiple network layers simultaneously.

Remember: When dealing with multiple network interfaces, always verify the configuration of each interface independently before assuming system-wide issues.