From the course: Red Hat Enterprise Linux 8 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Route IP traffic and create static routes

Route IP traffic and create static routes

From the course: Red Hat Enterprise Linux 8 Essential Training

Start my 1-month free trial

Route IP traffic and create static routes

- [Instructor] We can add static routes using the ip route command. We can also add static routes using the legacy route command, although it needs to be installed first. However, if you want your static routes to survive a reboot, you'll need to add them to configuration files in /etc/sysconfigs/network-scripts. When we create a network interface configuration file, we name it ifcfg-interface name such as ifcfg-eth0. For a static routes, we name the configuration file route-interface name. For instance, if we wanted to add a static route for the eth0 interface, we'd create a file called route-eth0. To add a route manually using the ip command, we type ip route add 192.168.100.0, which is the network address /24 which is the subnet mask, 192.168.100.1 which is the gateway, dev team0, which is the interface. If you type in ip route, you would see the results of this line. The legacy route version of this command line is a bit longer. We type in route add -net 192.168.100.0 netmask…

Contents