Linux Routing Configuration: ip route Commands and netplan

VDS / VPS Servers · 19.04.2026
Linux Routing Configuration: ip route Commands and netplan

Essential ip Commands

ip addr show           # all IP addresses
ip route show          # routing table
ip route get 8.8.8.8   # route to specific host
ip neigh show          # ARP table

Add Routes (temporary)

sudo ip route add 10.0.0.0/8 via 192.168.1.1
sudo ip route add default via 192.168.1.1

Persistent Routes via Netplan

network:
  version: 2
  ethernets:
    eth0:
      routes:
        - to: default
          via: 192.168.1.1
        - to: 10.0.0.0/8
          via: 10.0.0.1
💡 ip vs ifconfig: ifconfig is deprecated and not installed by default in Ubuntu 20.04+. Use ip addr and ip route — they support IPv6 and modern kernel features.
← Back to Knowledge Base Ask Support