Configuring Redhat 6 And Centos 6 Linux For Static Persistent Routes

All right and this little short webcast we’re going to deal with the adding static persistent routes to your CentOS or Red Hat six box this is going to probably come across you’re going to probably come across this in your environment at times where you’ll have a VPN connection or something where your default gateway won’t have a route to.

It you’ll need to add a persistent static route in your configuration so you’ll be able to access that the other network the far network to you so what I’m going to do is I’m.

On my you bond to desktop machine around here this is my workstation and I’m on a 20 network you’re looking to see here the network address is a 192 168 xx dot 107 so of course I can ping anything on that network on the 20 net subnet I’m fine but I.
Also have a dot 1 network I have a 1 92168 one subnet still 1.
1 as you can see from this machine because I’ve got the right route set up you know of course I can ping over a VPN connection to another subnet.

Well I’ve got a my lab machine that I used to do these webcasts with and it’s a Cintas server sent all six and we’re gonna log into it and see what happens when we try to ping to that other Network I’m just gonna go ahead and login his route and it’s of course on the 20 subnet also they did get a prompt for.

A password in just a second okay okay now I’m logging in to my lab.

Server machine a sent all six machine that’s a one nine two one six eight 20.3 is the IP so of course if I want to ping something on the local subnet well of course no problem now when I go to ping over to that other subnet now I just showed how my workstation.

That I could ping it fine from it now I’m on the same subnet and I’m pinging across there trying to ping across to server that’s on the other side on a.

VPN connection and it’s not working well I don’t have a route set up for this my default gateway on this box does not know about that other subnet so and since I’m not going to add it to that router the other option is on the local box itself to add a static persistent route of some kind so.

That it’s constantly there after a reboot or whatnot so it’s always there when I need to access that Network so it’s pretty simple to do first thing we’re gonna do is we’re gonna go in navigate to our e TC sis config Network scripts directory okay let’s have a look in.

Here as you can see our Ethernet our.

I should say our device our NIC is a – or ET eth – that’s the only NIC we have configured on this machine is just one so that’s our device and so when we’re doing persistent routes or static routes we have to assign them to what Nick or what device they’re going to utilize them basically what.

Would a NIC they’re going to go out out over so what we need to do is create a.

File that we’re going to put our static routes in and we’re just going to be called route – and then the number of our interface which.

Is e th – so route – ETH – is going to be our file now if you if you look at this you’ll notice that file does not exist because we haven’t created it yet and so what we’re gonna need to do is create it and the easiest way to do is use the VI editor because if you type in.