Linux route Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux route Guide
Complete beginner-friendly guide to route on Linux, covering Arch Linux, CachyOS, and other distributions including routing table management, static routes, and network routing.
Table of Contents
Understanding route
What is route?
route manages routing table.
Uses:
- View routes: Show routing table
- Add routes: Add static routes
- Delete routes: Remove routes
- Network routing: Manage network routing
Note: Modern alternative is ip route.
route Basics
View Routes
Basic usage:
# View routing table
route -n
# -n = numeric (no hostname resolution)
Kernel Table
Kernel routes:
# Kernel routing table
route
# Shows routing table
Viewing Routes
Numeric Output
No resolution:
# Numeric addresses
route -n
# Faster (no DNS lookup)
Specific Interface
Interface routes:
# Routes for interface
route -n | grep eth0
# Shows routes for eth0
Adding Routes
Add Route
Add static route:
# Add route
sudo route add -net 192.168.2.0/24 gw 192.168.1.1
# Adds route to network
Delete Route
Remove route:
# Delete route
sudo route del -net 192.168.2.0/24
# Removes route
Troubleshooting
route Not Found
Check installation:
# Check route
which route
# Usually in net-tools
# Install if missing
sudo pacman -S net-tools
Summary
This guide covered route usage, routing table management, and network routing for Arch Linux, CachyOS, and other distributions.
Next Steps
- ip Guide - Modern routing tool
- IP Routing - Routing guide
- Networking - Network setup
- route Documentation:
man route
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.