Adding a Static Route:
A static route is added manually in the routing table, as opposed to the dynamic routes that are added automatically using a dynamic routing protocol like RIP - Routing Information Protocol -
Displaying the connections in our system:
We can display the connections on our system, using the below command:
Adding a new default route:
We can add a new default route using the below command:
The above command adds a default route "22.214.171.124" for the "126.96.36.199/24" network, through the connection "Wired 1", that is associated with the "eno1" interface.
For the changes to take effect, we have to restart the "Wired 1" connection, using the below commands:
To remove a route we use the "-ipv4.routes" parameter with the nmcli command.
We could see our newly added route using the below command: