Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux_wiki:route_ip_traffic_and_create_static_routes [2018/03/27 22:54] billdozor [Option B: Use nmtui] |
linux_wiki:route_ip_traffic_and_create_static_routes [2018/05/29 22:16] billdozor |
||
---|---|---|---|
Line 11: | Line 11: | ||
The following virtual machines will be used: | The following virtual machines will be used: | ||
* server1.example.com (192.168.1.150) -> Configure the routes here | * server1.example.com (192.168.1.150) -> Configure the routes here | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====== Help ====== | ||
+ | |||
+ | Finding help in this section. | ||
+ | * nmcli examples< | ||
---- | ---- | ||
Line 18: | Line 25: | ||
Ensure IP Forwarding is enabled if using router like functionality | Ensure IP Forwarding is enabled if using router like functionality | ||
<code bash> | <code bash> | ||
- | # Temp Immediate Change | ||
- | echo 1 > / | ||
- | |||
# Persistent Change that takes place upon system boot | # Persistent Change that takes place upon system boot | ||
vim / | vim / | ||
Line 32: | Line 36: | ||
ip route show | 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 ===== | ===== Persistent Static Route ===== | ||
Line 56: | Line 43: | ||
---- | ---- | ||
- | ==== Option A: Use a static config file ==== | + | ==== Option A: Use nmcli ==== |
- | **Note**: This method is considered " | + | Interface specific route using nmcli. |
- | + | | |
- | Create | + | * Bring up the new connection config<code bash>nmcli con up enp0s3</ |
- | <code bash> | + | * Verify |
- | vim / | + | |
- | + | ||
- | any net 216.58.217.0/24 gw 192.168.1.254 dev eth0 | + | |
- | </ | + | |
- | * any net -> source from any network | + | |
- | * 216.58.217.0/ | + | |
- | * gw 192.168.1.254 -> use this gateway | + | |
- | * **OPTIONAL**: | + | |
- | + | ||
- | \\ | + | |
- | Restart | + | |
- | <code bash> | + | |
- | systemctl restart network | + | |
- | </ | + | |
- | + | ||
- | \\ | + | |
- | View route | + | |
- | <code bash> | + | |
- | ip route show | + | |
- | </ | + | |
---- | ---- | ||
Line 104: | Line 71: | ||
---- | ---- | ||
- | ==== Option C: Use nmcli ==== | + | ==== Option C: Use a static config file ==== |
+ | |||
+ | **Note**: This method is considered " | ||
+ | |||
+ | * Create config file< | ||
+ | |||
+ | # Minimal route entry | ||
+ | any net 216.58.217.0/ | ||
+ | |||
+ | # Can also specify a device to use for the route | ||
+ | any net 216.58.217.0/ | ||
+ | |||
+ | # Can also specify a route metric | ||
+ | any net 216.58.217.0/ | ||
+ | * any -> source from any | ||
+ | * net 216.58.217.0/ | ||
+ | * gw 192.168.1.254 -> use this gateway | ||
+ | * **OPTIONAL**: | ||
- | Interface specific route using nmcli. | ||
- | * Create route< | ||
* Restart the network service< | * Restart the network service< | ||
+ | * View route< | ||
---- | ---- | ||