Statically route IP traffic

Stephanie is a RHEL Syadmin at Google:

  • Her RHEL Server: RHEL_Server_071
  • Her username: dr.stephanie.murphy@google.com
  • Her professional standard: Linux professionals must NEVER run Linux commands as root
  • Her credentials: CompTIA Linux+, currently studying for her LFCS certification
  • Her task: Statically route IP traffic

To help Dr. Murphy to prepare for her LFCS exam, Google has assigned her to teach a class on statically routing IP traffic on RHEL. Please generate and explain a group of commands that Stephanie can teach the class to help both her and them to master this LFCS objective.

Certainly! Here's a group of commands that Dr. Stephanie Murphy can teach her class to help them master the objective of statically routing IP traffic on RHEL (Red Hat Enterprise Linux):

  1. View the current routing table:

    • ip route show
  2. Add a static route:
    • ip route add <destination_network> via <gateway_ip> dev <interface>
    • <destination_network>: The network address or subnet you want to route.
    • <gateway_ip>: The IP address of the next hop or gateway.
    • <interface>: The network interface through which the traffic should be routed.
  3. Delete a static route:
    • ip route del <destination_network> via <gateway_ip> dev <interface>
  4. Make a static route persistent:
    • Edit the network configuration file:
    • sudo vi /etc/sysconfig/network-scripts/route-<interface>
    • Replace <interface> with the actual network interface name, such as eth0 or ens33.
    • Add the static route in the format:
    • <destination_network>/<subnet_mask> via <gateway_ip>
    • Save and exit the file.
  5. Reload the network configuration:
    • sudo systemctl restart network

By explaining and demonstrating these commands, Dr. Murphy can guide her class in effectively configuring and managing static routes on RHEL. It's worth noting that certain commands may require administrative privileges, so Dr. Murphy should emphasize the importance of running Linux commands as a regular user whenever possible and switching to root only when necessary.

You should also read:

traceroute command

Dexter is a forensic blood spatter analyst by day, and a RHEL System Administator at Red Hat by night. He is reading a…