linux_wiki:route_ip_traffic_and_create_static_routes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

linux_wiki:route_ip_traffic_and_create_static_routes [2016/09/20 23:07]
billdozor [Linux Routing]
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 ====== 
- 
-Ensure IP Forwarding is enabled if using router like functionality 
-<code bash> 
-# Temp Immediate Change 
-echo 1 > /proc/sys/net/ipv4/ip_forward 
- 
-# Persistent Change that takes place upon system boot 
-vim /etc/sysctl.d/overrides.conf 
- 
-net.ipv4.ip_forward = 1 
-</code> 
- 
-\\ 
-Show Route Table 
-<code bash> 
-ip route show 
-</code> 
- 
-\\ 
-Create static route (NOT persistent) 
-<code bash> 
-ip route add 216.58.217.0/24 via 192.168.1.254 dev eth1 
-</code> 
-  * 216.58.217.0/24 -> destination network 
-  * 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/24 via 192.168.1.254 dev eth1 
-</code> 
- 
-\\ 
- 
-===== Persistent Static Route ===== 
- 
-Create config file 
-<code bash> 
-vim /etc/sysconfig/static-routes 
- 
-any net 216.58.217.0/24 gw 192.168.1.254 dev eth0 
-</code> 
-  * any net -> source from any network 
-  * 216.58.217.0/24 -> traffic to this destination 
-  * gw 192.168.1.254 -> use this gateway 
-  * **OPTIONAL**: dev eth0 -> use this device 
- 
-\\ 
-Restart the network service 
-<code bash> 
-systemctl restart network 
-</code> 
- 
----- 
  
  • linux_wiki/route_ip_traffic_and_create_static_routes.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)