Book Image

Red Hat Enterprise Linux Server Cookbook

By : Jakub Gaj, William Leemans
Book Image

Red Hat Enterprise Linux Server Cookbook

By: Jakub Gaj, William Leemans

Overview of this book

Dominating the server market, the Red Hat Enterprise Linux operating system gives you the support you need to modernize your infrastructure and boost your organization’s efficiency. Combining both stability and flexibility, RHEL helps you meet the challenges of today and adapt to the demands of tomorrow. This practical Cookbook guide will help you get to grips with RHEL 7 Server and automating its installation. Designed to provide targeted assistance through hands-on recipe guidance, it will introduce you to everything you need to know about KVM guests and deploying multiple standardized RHEL systems effortlessly. Get practical reference advice that will make complex networks setups look like child’s play, and dive into in-depth coverage of configuring a RHEL system. Also including full recipe coverage of how to set up, configuring, and troubleshoot SELinux, you’ll also discover how secure your operating system, as well as how to monitor it.
Table of Contents (17 chapters)
Red Hat Enterprise Linux Server Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 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...>:

  2. Now, select <Edit...> next to the IPv4 Configuration – Routing entry and enter your routes. Select <OK> to confirm:

  3. Finally, click on <OK> to confirm...