Operating System - HP-UX
1834162 Members
2660 Online
110064 Solutions
New Discussion

Setting "final route_gateway[0]" automatically...

 
SOLVED
Go to solution
Jeff Carlin
Frequent Advisor

Setting "final route_gateway[0]" automatically...

I have a custom config file that I include in my INDEX that sets up the "standards" for disk layout and networking. Here at Kmart, we have many subnets, each with there own gateway. For each subnet the IP of the gateway is always 1. The subnet will often be different.

If I don't specify anything for the "final route_gateway[0]=xxx.xxx.xxx.xxx" it will always default to the gateway on the ignite server. This is okay for that subnet, but I am igniting HP's over 18 different subnets. How can I derive the final route_gateway value automatically from the IP address that I want to set the target server to? For example, say the target is 148.162.196.100 and I want the final route_gateway[0]= to automatically be 148.162.196.1

Is it possible to manuiplate strings in the config files and make a new string for the route_gateway? How would I do this?
Where wisdom is called for, force is of little use. --Of course, a hammer does wonders for relieving stress.
4 REPLIES 4
harry d brown jr
Honored Contributor

Re: Setting "final route_gateway[0]" automatically...


Yes, use perl.

live free or die
harry
Live Free or Die
Kellogg Unix Team
Trusted Contributor

Re: Setting "final route_gateway[0]" automatically...

Hi,

I think you can easily accomplish this in your post-install script. In that, you'll grep for "route_gateway" keyword in /etc/rc.config.d/netconf file and change the IP to that of lan?[0] replacing last octect to 1.

HTH
...Manjeet
work is fun ! (my manager is standing behind me!!)
Neil Steurs
Advisor
Solution

Re: Setting "final route_gateway[0]" automatically...

Hi,
We have the same situation and have achieved it by creating a 'settings_cfg' file that contains the IP ranges of all our subnets, and sets the final_route_gateway accordingly. For example:-

ip_addr[] ~ "10.1.10"
{
final route_gateway[0] = "10.1.10.1"
final route_destination[0] = "default"
final route_count[0] = 1
}

ip_addr[] ~ "10.1.11"
{
final route_gateway[0] = "10.1.11.1"
final route_destination[0] = "default"
final route_count[0] = 1
}

Hope that helps,
Nei
Jeff Carlin
Frequent Advisor

Re: Setting "final route_gateway[0]" automatically...

Thanks Neil!
Where wisdom is called for, force is of little use. --Of course, a hammer does wonders for relieving stress.