1823986 Members
4425 Online
109667 Solutions
New Discussion юеВ

an easy routing question

 
SOLVED
Go to solution
Ron Irving
Trusted Contributor

an easy routing question

We have 5 networks here. 172.16.0.0, (the home office,) and,
172.17.0.0
172.18.0.0
172.19.0.0
172.20.0.0

The default gateway is all set up, 172.16.0.1.

The question is, how do I automatically set these routes at reboot? I manually add them each time the server is rebooted.

I know it's an easy one, but any answers will be greatly appreciated/rewarded

thanx

ron
Should have been an astronaut.
10 REPLIES 10
John Bolene
Honored Contributor

Re: an easy routing question

You should not have to add static routes.
But you can by adding route statements to /etc/rc.config.d/netconf
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Andreas Voss
Honored Contributor

Re: an easy routing question

Hi,

edit the fie /etc/rc.config.d/netconf such as:

ROUTE_DESTINATION[0]="default"
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]="172.16.0.1"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""

Regards
Ron Irving
Trusted Contributor

Re: an easy routing question

Thanks for the quick reply, John. I'm familiar with the netconf file, but just not quite as familiar on where in the netconf file to place these entries.

The problem started when our T1 went down earlier this week, and when it came back up, only some of our users across the WAN could access the app. We added the static routes to aleviate this. So far, it seems to have worked.

Thanx again

ron
Should have been an astronaut.
Sanjay_6
Honored Contributor

Re: an easy routing question

Hi,

Have you tried Sam--> Networking and Communication --> Hosts --> Local Hosts File . This will open you /etc/hosts. Select Tab, select Action from the Menu bar, Selcet Configure Default Gateway. Give the ip of the gateway, and exit from sam.

Next reboor onwards, it should work. If you do this you won't have to manually add entries or modify them in /etc/rc.config.d/netconf, else you can do them as advised by jonh.

Thanks
Ron Irving
Trusted Contributor

Re: an easy routing question

The default gateway is already setup as per your example. My question again is, where do I put the net statements, as in the manual statement "route add net 172.17.0.0 netmask 255.255.0.0 172.16.0.1"?

Thanx again

ron
Should have been an astronaut.
Ron Irving
Trusted Contributor

Re: an easy routing question

Unfortunatly, I'm running 10.20, which doesn't have the 'hosts' option under networking and communications in sam. Drat the bad luck!!

ron
Should have been an astronaut.
Sanjay_6
Honored Contributor

Re: an easy routing question

Hi ron,

You have to put that in /etc/rc file in UX 10.20, if i remember correctly.

if you vi and read that file, you'll find the location where you should put net add statement.

Thanks
Andreas Voss
Honored Contributor
Solution

Re: an easy routing question

Hi,

route add net 172.17.0.0 netmask 255.255.0.0 172.16.0.1 has to be added in netconf as:

ROUTE_DESTINATION[#]="net 172.17.0.0"
ROUTE_MASK[#]="255.255.0.0"
ROUTE_GATEWAY[#]="172.16.0.1"
ROUTE_COUNT[#]="1"
ROUTE_ARGS[#]=""

Replace the # with an uniq number.

Regards
linuxfan
Honored Contributor

Re: an easy routing question

Hi Ron,

Are you trying to add a default route plus routes to other networks,

you could do something like this in your /etc/rc.config.d/netconf

ROUTE_DESTINATION[0]="default"
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]="172.16.0.254"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""

ROUTE_DESTINATION[1]="net 172.17.0"
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]="172.16.0.1"
ROUTE_COUNT[1]="1"
ROUTE_ARGS[1]=""


If you want to use the same gateway for all the networks then you only need the entry for default pointing to your default gateway. but if you want to add additional routes then you can add as many routes as you want in your netconf file.

-HTH
Ramesh
They think they know but don't. At least I know I don't know - Socrates
Ron Irving
Trusted Contributor

Re: an easy routing question

Thank you all for your prompt, and helpful replies. Someday, with YEARS of practice, I'll be able to answer these myself.

ron
Should have been an astronaut.