Differences
This shows you the differences between two versions of the page.
linux_wiki:route_ip_traffic_and_create_static_routes [2016/08/08 23:39] billdozor [Persistent Static Route] |
linux_wiki:route_ip_traffic_and_create_static_routes [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Route IP Traffic And Create Static Routes ====== | ||
- | |||
- | **General Information** | ||
- | |||
- | Routing IP traffic and creating static routes. | ||
- | |||
- | ---- | ||
- | |||
- | ====== Linux Routing ====== | ||
- | |||
- | Show Route Table | ||
- | <code bash> | ||
- | ip route show | ||
- | </ | ||
- | |||
- | \\ | ||
- | Create static route (NOT persistent) | ||
- | <code bash> | ||
- | ip route add 216.58.217.0/ | ||
- | </ | ||
- | * 216.58.217.0/ | ||
- | * via 192.168.1.254 -> use this gateway | ||
- | * dev eth1 -> use this interface | ||
- | |||
- | \\ | ||
- | Remove static route | ||
- | <code bash> | ||
- | ip route delete 216.58.217.0/ | ||
- | </ | ||
- | |||
- | \\ | ||
- | |||
- | ===== Persistent Static Route ===== | ||
- | |||
- | Create config file (per interface routes) | ||
- | <code bash> | ||
- | vim / | ||
- | |||
- | 216.58.217.0/ | ||
- | </ | ||
- | * 216.58.217.0/ | ||
- | * via 192.168.1.254 -> use this gateway | ||
- | * dev eth0 -> use this device | ||
- | |||
- | \\ | ||
- | Restart the network service | ||
- | <code bash> | ||
- | systemctl restart network | ||
- | </ | ||
- | |||
- | ---- | ||