To make a static route permanent under Rocky Linux 9, you need to follow these steps:

  1. Open the terminal on your Rocky Linux system.

  2. Type the following command to open the network configuration file in the nano editor:

    sudo nano /etc/sysconfig/network-scripts/route-interface

    Replace 'interface' with the name of the interface that the static route is associated with.

  3. Add the static route details to the file in the following format:

    ADDRESS via GATEWAY dev INTERFACE

    Replace ADDRESS with the IP address of the network or host that the static route is for.

    Replace GATEWAY with the IP address of the gateway for the network.

    Replace INTERFACE with the name of the interface that the static route is associated with.

  4. Save the changes to the file by pressing Ctrl+O and exit the nano editor by pressing Ctrl+X.

  5. Restart the network service to apply the changes by typing the following command:

    sudo systemctl restart network

The static route should now be permanent and will be automatically added to the routing table every time the network service is started or restarted.

How to Create a Permanent Static Route on Rocky Linux 9

原文地址: https://www.cveoy.top/t/topic/ohK7 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录