Static Routes in RH73 Linux
 

Static Routes in RH73 Linux

 

This post was last updated on June 3rd, 2020 at 04:36 pm

(Other routing page: routes.html)

Here’s how to set up Red Hat 7.3 /etc/sysconfig/static-routes file, I mention this here because this had me halted for longer than I wanted to be stuck trying to figure out how exactly this file works:

eth0 v 172.16.0.1
eth1 v 16.1.224.98
eth1 v default gw 16.1.224.1

So this system has 2 static IP addresses, 172.16.0.1 and 16.1.224.98. Looking at my route table I have:

[[email protected] root]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
16.1.224.0      0.0.0.0         255.255.252.0   U        40 0          0 eth1
172.16.0.0      0.0.0.0         255.255.0.0     U        40 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U        40 0          0 lo
[[email protected] root]# 

So I have my loopback and the two networks, but I don’t have any host lines (UH) for the static ip addresses themselves, nor do I have a default gateway (UG), so adding the /etc/sysconfig/static-routes and restarting the networking (service network restart) I then get the following correct route information:

[[email protected] root]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
172.16.0.1      0.0.0.0         255.255.255.255 UH       40 0          0 eth0
16.1.224.98     0.0.0.0         255.255.255.255 UH       40 0          0 eth1
16.1.224.0      0.0.0.0         255.255.252.0   U        40 0          0 eth1
172.16.0.0      0.0.0.0         255.255.0.0     U        40 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U        40 0          0 lo
0.0.0.0         16.1.224.1      0.0.0.0         UG       40 0          0 eth1
[[email protected] root]# 
Previous Using DD to backup your drive
Next Setting up PXE Server
 

About author

shibaa987
shibaa987 275 posts

Linux kernel developer and a firmware developer with an experience of 10+ years.

View all posts by this author →

You might also like

System Internals 0 Comments

Basic Operating System Services: A beginner’s guide

This post was last updated on November 3rd, 2020 at 05:20 pmOperating System Services are the basic functionalities or the responsibilities of an Operating System that it provides to the

System Internals 0 Comments

What’s an Operating system & why do we need one?

This post was last updated on November 3rd, 2020 at 05:15 pmBasically an operating system (OS) is a software system (collection of interdependent software code) on its own that allows

System Internals 0 Comments

Drivers in Linux

This post was last updated on May 26th, 2020 at 10:43 pm Contents0.1 What to do with static drivers, module drivers, append=, and insmod.0.2 Drivers in Linux can take on

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply