Operating System - HP-UX
1834090 Members
1875 Online
110063 Solutions
New Discussion

Set Default Gateway Permanently

 
SOLVED
Go to solution
ckchua
Occasional Advisor

Set Default Gateway Permanently

Dear Friends,

I have tried to set the default gateway using SAM and I have problem getting the setting permanently. When server re-booting, the default gateway will be blank.
please advise.

Many thanks

regards
ckchua
17 REPLIES 17
T G Manikandan
Honored Contributor

Re: Set Default Gateway Permanently

Hello,
Please enter your default gateway address in the /etc/rc.config.d/netconf
Change the parameters

ROUTE_DESTINATION[0]=default
ROUTE_GATEWAY[0]=xx.xx.xx.xx
ROUTE_COUNT[0]=1
ROUTE_ARGS[0]=""
and do a
/sbin/init.d/net stop
/sbin/init.d/net start.

Thanks
G Manikandan
Michael Tully
Honored Contributor

Re: Set Default Gateway Permanently

Hi,

sam is fine for doing this sort of thing....
usually but .... You can edit the
/etc/rc.config.d/netconf file and change
the following parameters then stop and
start your network, by running the below:

# /sbin/init.d/net stop
# /sbin/init.d/net start

Changes to /etc/rc.config.d/netconf

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

To add your default route at the command line
# /usr/sbin/route add default xx.xx.xx.xx 1
(1 being the number of hops to your router)

HTH
-Michael


Anyone for a Mutiny ?
Wim Rombauts
Honored Contributor

Re: Set Default Gateway Permanently

The default way to do this is

/etc/set_parms addl_netwrk.

This utility allows you to set the network mask and IP-address, but also DNS and NIS settings. If you don't want to configure the last two, just press cancel. It has a GUI and CLI interface.
Eugen Cocalea
Respected Contributor

Re: Set Default Gateway Permanently

Hi,

/sbin/set_parms addl_netwrk

or

edit the file

/etc/rc.config.d/netconf

and change the settings for the '0' route to suit your needs, then restart the network.

There you go.

E.
To Live Is To Learn
Alex Glennie
Honored Contributor

Re: Set Default Gateway Permanently

Also make sure you have only one correct copy of netconf in the /etc/rc.config.d dir, if you have files such as netconf.orig or netconf.old move them to another directory.
Rita C Workman
Honored Contributor

Re: Set Default Gateway Permanently

As was mentioned by the folks above the permanent method of setting your default gateway is in the /etc/rc.config.d/netconf file.

Now, since your up and running and want to have the system aware of that gateway address NOW...you would want to enter:

route add default 1

Remember to key that ( 1 ) after the IP...
So, doing this there is no need to recycle anything..your done.

Rgrds,
Rita
John Bolene
Honored Contributor

Re: Set Default Gateway Permanently

I normally put the entry for the machine and its gateway into /etc/hosts, these are the addresses needed to bring the machine up. The rest of the addresses are available from DNS when networking is up.


Sam should work.

Are you getting any errors using Sam?
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Tommy Brown
Respected Contributor

Re: Set Default Gateway Permanently

I had that happened to me, when in SAM I used the Name of the gateway, and not the IP address. During the boot process it could not resolve the name and left it blank when it finished booting, it was without a gateway... Just a minor lesson learned..
Tommy
I may be slow, but I get there !
Sanjay_6
Honored Contributor

Re: Set Default Gateway Permanently

Roger Baptiste
Honored Contributor
Solution

Re: Set Default Gateway Permanently

Ck,

Apart from the comprehensive
suggestions which folks have
given in this thread:
Make sure you are setting
the gateway on the correct
lan interface!


To make sure your network configuration is correct, do

#lanscan -> shows lan interfaces

#lanscan |grep -v Hardware |grep -v path | awk '{print $5}'
-> this will give your
lan interfaces (lan0,lan1..)

check the settings of the interfaces:
#ifconfig
-> this will show the current network settings of the interface.
Make sure it is what you want.

#netstat -nr
-> shows the current routing table. The entry
corresponding to default
is your default gateway
entry and it also shows
the lan interface it corresponds to.

To set default gateway permanent, edit /etc/rc.config./netconf
file and enter the parameters
in the ROUTE_DESTINATION
ROUTE_COUNT and ROUTE_GATEWAY
entries. Also make sure
the subscript of the ROUTE
is the same as the lan
interface you are using.

HTH
raj
Take it easy.
ckchua
Occasional Advisor

Re: Set Default Gateway Permanently

Hi Everybody,

Thank you for your superb advise. I am confident that I will be able to resolve this issue as soon as I am at site next Wednesday.

Have a nice weekend.

warmest regards
ckchua
John Bolene
Honored Contributor

Re: Set Default Gateway Permanently

And remember to assign points if this info has helped.

We only work for peanuts, throw a few.

Thanks
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
ckchua
Occasional Advisor

Re: Set Default Gateway Permanently

I have checked in etc/rc.config.d/netconf, everything is perfect. The gateway ip is specified but is SAM it does not show the default gateway ip.

I have tried to run /sbin/init.d/net start, everything seems to be okay after executing the net start. I suspect some network process is not executed. How to check net start is executed during server boot-up. Please advise.

regards
ckchua
Animesh Chakraborty
Honored Contributor

Re: Set Default Gateway Permanently

Hi,
Check /etc/rc.log file for any error during boot up.
----------------------------
Configure LAN interfaces
Output from "/sbin/rc2.d/S340net start":
----------------------------

Animesh
Did you take a backup?
Darrell Allen
Honored Contributor

Re: Set Default Gateway Permanently

Hi,

cd /sbin; ll rc?.d | grep net

You should find a symbolic link (on my 11.0 servers it is /sbin/rc2.d/S340net) pointing to /sbin/init.d/net.

I've seen SAM do some weird things with netconf so I like to edit it by hand. Verify there is no other stanze using the same "instance number" ([0] or whatever you're using for the default route).

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
ckchua
Occasional Advisor

Re: Set Default Gateway Permanently

Hi,

Actually, my server is using ATM instead of LAN interface.
What shall I check ?

regards
ckchua
Michael Tully
Honored Contributor

Re: Set Default Gateway Permanently

Hi,

Don't know much about these but....
Try and do 'nettl' trace. This may bring up
some interesting things. Also check this
out this link.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,11866,0xf5eb660142b2d5118ff10090279cd0f9,00.html

-Michael
Anyone for a Mutiny ?