Back to the command reference

route

NetworkAdvancedReference only

Show or edit the routing table (legacy; prefer ip route)

Name: route

This command is outside what the site lets you practise (mostly distribution-specific or rarely used tools). This page describes how to use it; try it on your own Linux system.

Description

route shows and edits the kernel's IP routing table (from net-tools), such as the default gateway. ip route is the modern equivalent.

Syntax

route [OPTION]...

Common options

-nNumeric
add / delAdd / remove a route: route add default gw 192.168.1.1 (needs root)

Examples

  • $ route -n

    Routing table and default gateway

    Explain

Related