# info > route

---
type: CommandReference
command: route
mode: man
section: 8
source: man-pages
---

## Quick Reference

- `route` — display routing table
- `route -n` — show numerical addresses
- `route add -net 192.168.1.0/24 gw 192.168.1.1 dev eth0` — add a network route
- `route add default gw 10.0.0.1` — set default gateway
- `route del -net 192.168.1.0/24` — delete a route
- `route add -net 10.0.0.0/8 reject` — add a blocking route
- `route -6 add 2001:db8::/32 metric 1 dev eth0` — add IPv6 route
- `route -C` — show routing cache

## Name

route — show / manipulate the IP routing table

## Synopsis

shell
route [-CFvnNee] [-A family | -4 | -6]
route [-v] [-A family | -4 | -6] add [-net | -host] target [netmask Nm] [gw Gw] [metric M] [mss M] [window W] [irtt I] [reject] [mod] [dyn] [reinstate] [[dev] If]
route [-v] [-A family | -4 | -6] del [-net | -host] target [gw Gw] [netmask Nm] [metric M] [[dev] If]
route [-V] [--version] [-h] [--help]
## Options

- **Display options**:
  - `-A family` — use address family (`inet`, `inet6`); `-4` alias for `-A inet`, `-6` alias for `-A inet6`
  - `-F` — operate on FIB (default)
  - `-C` — operate on routing cache
  - `-v` — verbose
  - `-n` — show numerical addresses (no DNS resolution)
  - `-e` — netstat-format output; `-ee` shows all parameters
- **Add/delete**:
  - `add` — add a new route
  - `del` — delete a route
  - `target` — destination network or host; can use `/prefixlen` instead of netmask
  - `-net` — target is a network
  - `-host` — target is a host
  - `netmask NM` — netmask for network route
  - `gw GW` — route via gateway (must be reachable first)
  - `metric M` — metric value (default: 0 for IPv4, 1 for IPv6; specify explicitly)
  - `mss M` — set MTU of route to M bytes (not MSS)
  - `window W` — TCP window size for connections over this route
  - `irtt I` — initial round trip time in ms (1–12000; default 300)
  - `reject` — install blocking route (forces lookup to fail; not for firewalling)
  - `mod`, `dyn`, `reinstate` — flags for dynamic/modified routes (diagnostic, set by routing daemons)
  - `dev If` — force route to use specified device; if last option, `dev` can be omitted

## Examples

shell
# Add loopback route
route add -net 127.0.0.0 netmask 255.0.0.0 metric 1024 dev lo

# Add local network route via eth0
route add -net 192.56.76.0 netmask 255.255.255.0 metric 1024 dev eth0

# Delete default route
route del default

# Delete a network route (netmask must match)
route del -net 192.56.76.0 netmask 255.255.255.0

# Add default gateway
route add default gw mango

# Add route to host via SLIP
route add mango sl0

# Route to network via gateway
route add -net 192.57.66.0 netmask 255.255.255.0 gw mango

# Add multicast route
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0

# Add blocking route for private network
route add -net 10.0.0.0 netmask 255.0.0.0 metric 1024 reject

# Add IPv6 route
route -6 add 2001:0002::/48 metric 1 dev eth0
## Output Columns

When displaying the routing table, the output includes:

- **Destination** — destination network or host
- **Gateway** — gateway address or `*` if none
- **Genmask** — netmask for destination; `255.255.255.255` for host, `0.0.0.0` for default
- **Flags** — `U` (up), `H` (host target), `G` (gateway), `R` (reinstate), `D` (dynamic), `M` (modified), `A` (addrconf), `C` (cache entry), `!` (reject)
- **Metric** — distance to target (usually hops)
- **Ref** — number of references (not used in Linux)
- **Use** — count of lookups; with `-F` = cache misses, `-C` = hits
- **Iface** — interface for packets
- **MSS** — default maximum segment size
- **Window** — default TCP window size
- **irtt** — initial round trip time (ms)
- **HH** (cached only) — number of ARP entries and cached routes referring to hardware header cache; `-1` if not needed
- **Arp** (cached only) — whether hardware address is up to date

## Files

- `/proc/net/ipv6_route`
- `/proc/net/route`
- `/proc/net/rt_cache`

## See Also

- [ifconfig(8)](http://localhost/phpMan.php/man/ifconfig/8/markdown)
- [netstat(8)](http://localhost/phpMan.php/man/netstat/8/markdown)
- [arp(8)](http://localhost/phpMan.php/man/arp/8/markdown)
- [rarp(8)](http://localhost/phpMan.php/man/rarp/8/markdown)
- [ip(8)](http://localhost/phpMan.php/man/ip/8/markdown)