Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › Linux Networking

Recover an Ubuntu VPS After an IP Change: Console Access, /32 Routes, and Netplan

By Freedom251 Team · · 4 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If an Ubuntu VPS stopped accepting SSH after an IP change, use the hosting provider’s out-of-band console or rescue environment to inspect and repair the guest network. Confirm the assigned address, prefix, gateway, and interface with the provider before changing routes. A /32 address may require an explicitly on-link gateway route, but that depends on the provider’s network design.

How do I access a VPS when SSH is down?

SSH uses the guest’s network path; a provider’s VNC, serial, web console, or rescue environment gives you another way to reach the machine when that path is broken. The console entry point and rescue behavior vary by provider, so follow the provider’s own instructions rather than assuming a particular VNC menu or workflow.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep the console session open while testing. It gives you a way back in if a live route change or persistent configuration cuts off network access again.

How do I recover my Ubuntu VPS after changing its IP?

Inspect the live network state

From the console, identify the interface, assigned addresses, and routes. Ubuntu examples use names such as eth0 and enp3s0, but your interface may have a different name.

#1 Best Overall
OIKWAN USB Console Cable,USB to RJ45 Console Cable for Cisco Routers/AP Router/Switch Windows, Mac, Linux(1.8m,Blue)
  • ❤Console cable❤ :6FT-USB-RS232-RJ45 console cable .It's used for debugging and configuring network equipment ❤!!Please NOTE❤ this is USB to RJ45 CONSOLE CABLE ,Not ETHERNET !!!It is 8p8c!! Look carefully of the Pin is match with your device. Before ordering , please confirm it is you need. After receiving ,please read user manual /instruction at first . Customer service always online.
  • ❤Works for console port❤this USB to rj45 console cable Replaces COM port RS232 (DB-25/DB-9) serial port perfectly, connects to any laptop/PC's USB port directly to a console port like a charm. No more RS232 Female and male adapters。32 and 64 bit operating systems are both support.except Chrome OS
  • ❤Essential tools for network engineers❤The Cisoc Console Cable It's designed for that a PC or laptop‘s USB port connect to the console port with their Cisco modem, router, firewall, switch or other Serial based Cisco device. Cisco,Juniper,NETGEAR,Ubiquity,LINKSYS,TP-Link ,huawei, H3C, HP, 3com compatibly.
  • ❤The pinout names❤Cisco usb console cable USB2.0 (1.1 compatible); CONSOLE's DTE Pinouts: RTS(1), DTR(2), TXD (3), GND(4), GND(5), RXD (6), DSR(7), CTS(8); the RJ45 pinout names is 1-CTS, 2-DSR, 3-RXD, 4-GND, 5-GND, 6-TXD, 7-DTR, 8-RTS. Cable length 1.8m/6ft, Maximum RS232 speed 500kbaud
  • ❤LIFETIME CUSTOMER SUPPORT❤beside get 1pack *6ft cisco usb to console,you also back with 180-day no reason free return and refund and 24-hour online service.
ip address
ip route show
ls -l /etc/netplan/

Review the Netplan files in /etc/netplan/ as well as the live state. Ubuntu uses Netplan as a configuration layer, with backends including systemd-networkd and NetworkManager. A file for one backend is not interchangeable with Netplan YAML; first establish which configuration layer and renderer manage this host. See the Ubuntu Server guide to configuring networks.

Verify the provider’s network assignment

Before changing anything, check the provider panel or documentation for the exact IPv4 address, prefix length, gateway, and expected routing method. Do not infer a gateway from an example or reuse an old address simply because it appears in the current configuration. The provider’s assignment determines whether the gateway should be reached through an on-link route, an explicit host route, a point-to-point arrangement, or another setup.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
USB to RJ45 Console Cable 2pack, Essential Tool for Cisco, NETGEAR, Ubiquiti, LINKSYS, TP-Link Routers/Switches Connection, Compatible with Windows, Mac, Linux Laptops
  • Supports Multiple Operating Systems: The cable is designed to be compatible with Windows, Mac, and Linux operating systems, covering most of the laptops and desktops in the market to meet diverse user needs.
  • Fits Various Brand Devices: Specially designed for mainstream networking device brands such as Cisco, NETGEAR, Ubiquiti, LINKSYS, TP-Link, etc., ensuring high compatibility with these brands' routers and switches.
  • Plug and Play: Most operating systems support the plug-and-play feature of the USB to RJ45 console cable, eliminating the need to install special drivers and simplifying the process of connecting and configuring devices.
  • Portable Design: The lightweight design and portable size make this cable an ideal choice for field network technicians and IT professionals, convenient for carrying and usage.
  • Application Scenarios:Network Device Configuration,Troubleshooting,Firmware Updates

Test a temporary repair

Ubuntu documents ip commands for immediate network changes. Substitute only provider-confirmed values and the actual interface name. These illustrative commands add an address, bring up the link, and add a default route:

sudo ip addr add <assigned-address>/<prefix-length> dev <interface>
sudo ip link set <interface> up
sudo ip route add default via <provider-gateway> dev <interface>

Do not add a second address if the correct one is already present, and do not add a default route that conflicts with an existing route. If the provider’s design requires the gateway to be treated as directly reachable despite the address prefix, a live route may need an on-link option, for example:

Rank #3
USB-C Cisco Console Cable,OIKWAN 6ft USB Type C to RJ45 Serial Adapter Essential Accessory of Cisco, NETGEAR, Ubiquity, LINKSYS, TP-Link Routers/Switches for Laptops
  • USB C cisco console cable is to help those who have a PC or laptop and want to use a USB-C connection to connect the console port with their Cisco modem,router,firewall,switch or other serial based Cisco device. This is the exact cable to solve such problem.
  • USB Type C to RJ45 for Cisco Router Console Cable, Works great for tables Type-C USB port directly to a console port like a charm.
  • FTDI FT232R chip + RS232 Level Shifter, Compatible with any laptop/PC with a USB-C Port.
  • Brand : OIKWAN ; Cable length:3m (10 feet); Color: light blue ;Warranty : 3-years
sudo ip route add default via <provider-gateway> dev <interface> onlink

Use that form only when it matches the provider’s instructions. Temporary ip changes are not persistent and disappear after reboot. Ubuntu’s network configuration guide documents these temporary tools and the distinction from persistent configuration.

Why does my /32 IP have no route to the gateway?

An IPv4 /32 prefix identifies a single host address; it does not describe a conventional multi-address subnet. With some provider topologies, the kernel does not consider the configured gateway directly reachable through that address, so a default route via that gateway may be rejected or fail to install unless the route explicitly marks it on-link.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Cisco Console Cable,USB Console Cable with FTDI Chip,USB to RJ45 Serial Adapter Compatible with Cisco,HP,NETGEAR,Huawei,Routers/Switches for Laptop in Linux,Windows, Mac (6FT)
  • 🔌6FT Console cable: USB 2.0 to RJ45 console cable .It's used for configuring and debugging network equipment . Connect your computer or laptop's USB port to your Cisco modem, router, firewall, switch or other serial-based Cisco device with console port. Note: It's console cable USB 2.0 to RJ45 NOT USB to Ethernet cable.
  • 🔌Apply to Laptop and console connect: USB to RJ45 serial adapter console cable perfect replaces COM port RS232 serial port , connects to laptop/computer USB port directly to console port . compatible with 32-bit and 64-bit Windows, MAC, Linux and Android, except Chrome OS.
  • 🔌Stable and Reliable: JEEFULL POWER console cable adopts the FTDI-FT232RL chip and used the advanced technology to make data transfer more stable and reliable.Support connect a various of terminal device
  • 🔌4.Plug and Play: The USB console cable is free driver, no CD required for as the drivers are part of the OS distribution. Most new systems will automatically install the drivers. or select the appropriate driver directly on the FTDI official website
  • 🔌5.LIFE-TIME Customer Support】JEEFULL POWER Console cable provides 1 year product warranty, lifetime technical support and friendly customer service.. What You Get: 1 x Console cable; 1 x User Manual,1x Color Box.

Netplan’s on-link: true option indicates that a route is directly connected to the interface. In the systemd network configuration, GatewayOnLink=true allows insertion of the gateway route without the kernel’s usual direct-reachability check. Those settings affect route installation; they do not correct an incorrect gateway or provider-side address assignment. Check the Netplan manual and the systemd.network manual.

Do not treat /32 plus an on-link route as a universal VPS recipe. The provider’s documented assignment determines whether that is the right method.

Best Value
Cable Matters USB to RJ45 Console Cable with FTDI Chipset, 6ft
  • USB console cable adapter connects from the USB port of a computer to the RJ45 console port of a networking switch or router; RJ45 to USB console cable connects new computers and laptops without a serial port
  • Snagless male to male cisco console cable provides a convenient solution for configuring equipment with a console port; A snagless RJ45 connector protects the tab from being torn off and stuck in the console port
  • Simple installation of this USB to console cable with the FTDI drivers and instructions available for download from Cable Matters; Windows 10 and the latest MacOS usually include FTDI drivers as part of the OS when using this FTDI USB cable
  • Windows & Mac & linux compatible to connect equipment with a standard Cisco USB to RJ45 pin-out; USB to console cable reverses all 8 pins in the cable to communicate from a computer USB port to a console port
  • USB rollover cable directly connects to a router, switch, server or wireless access point for configuration from the console port; Directly connect this switch console cable instead of carrying a cable plus an adapter; Program equipment without a network or internet connection
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How do I set an on-link default route with Netplan?

Edit the Netplan YAML file that manages the interface, using the provider-confirmed address, prefix, gateway, and the syntax supported by the installed Ubuntu and Netplan versions. A modern-style route uses a default destination and can include on-link: true when the provider’s topology requires it. The Ubuntu Netplan reference documents the option, but the available information does not establish values for any particular VPS; do not copy invented addresses or interface names into a live configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Ubuntu’s server guide notes a version distinction: Ubuntu Bionic 18.04 does not support to: default in the route block and uses the older gateway4 key. Check the installed release and Netplan syntax before saving changes. Do not edit a generated systemd-networkd file as though it were the persistent Netplan source.

  1. Save the corrected configuration in the appropriate file under /etc/netplan/.
  2. Apply it with sudo netplan apply while keeping the provider console open.
  3. Check the resulting address and route with ip address and ip route show. Ubuntu also documents netplan status for checking network status.
  4. Test a fresh SSH connection from outside the VPS if practical. Keep the console available until that succeeds.

For persistent nameserver settings, use the applicable Netplan configuration. If IP connectivity and routes work but hostnames do not resolve, investigate DNS separately with resolvectl and systemd-resolved; Ubuntu documents temporary DNS configuration through resolvectl. Resolve basic IP reachability first.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Linux NetworkingNetplansystemd-networkdUbuntuVPS

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.