Configuring static network routes

In some cases, it is required to set static routes on your system. As static routes are not natively supported in kickstart, this is not covered in this recipe.

How to do it…

Add static routes to both the 192.168.0.0/24 and 192.168.1.0/24 networks via 10.0.0.1.

Configuring static network routes using nmcli

Here's what you need to do:

  1. Set the route using the following command:
    ~]# nmcli connection modify eth0 ipv4.routes "192.168.0.0/24 10.0.0.1,192.168.1.0/24 10.0.0.1"
    
  2. Now, execute the following command line to verify the configuration:
    ~]# nmcli connection show eth0
    

    Here is an example output of the preceding commands:

    Configuring static network routes using nmcli

Configuring network routes using nmtui

Here are the steps for this recipe:

  1. Launch nmtui, select the interface that you wish to modify the static routes for, and click on <Edit...>:
    Configuring network routes using nmtui
  2. Now, select <Edit...> next to the IPv4 Configuration – Routing entry and enter your routes. Select <OK> to confirm:
    Configuring network routes using nmtui
  3. Finally, click on <OK> to confirm the changes and save them.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset