Operating System - HP-UX
1821983 Members
3352 Online
109638 Solutions
New Discussion юеВ

how to change the default gateway in HP-UX

 
chakribobby
Advisor

how to change the default gateway in HP-UX

HI
can you please tell me how to change the default gateway of my HPUX machine from the command prompt with out user iteration

ex:
#change_gateway.sh gate_wayIP

thanks in advance
8 REPLIES 8
T G Manikandan
Honored Contributor

Re: how to change the default gateway in HP-UX

route add default 1

This would be gone when the server is rebooted.

So you need to edit
/etc/rc.config.d/netconf

and restart you network
/sbin/init.d/net stop
/sbin/init.d start

T G Manikandan
Honored Contributor

Re: how to change the default gateway in HP-UX

what do you mean by user iteration, you want to change the gateway without network disruptions?

There can be only one default gateway to a machine and you would tend to loose connections by the change,afaik.
Steven E. Protter
Exalted Contributor

Re: how to change the default gateway in HP-UX

Shalom,

Change gateway configuration in /etc/rc.config.d/netconf

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

Problem is that won't work because there are probably a 100 network dependent services. You almost have to reboot the sywstem afer changing netconf.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ganesan R
Honored Contributor

Re: how to change the default gateway in HP-UX

Hi,

I would prefer you to change via SAM. So that the changes will be made permenantly. Means SAM will update the netconf file for you.

By command:
If you have a default gateway already set remove it and add new gateway.

# route delete default
# route add default 1

After that modify the /etc/rc.config.d/netconf file manually.
Best wishes,

Ganesh.
Ganesan R
Honored Contributor

Re: how to change the default gateway in HP-UX

Hi,

Could you provide the content of change_gateway.sh ?
Best wishes,

Ganesh.
T G Manikandan
Honored Contributor

Re: how to change the default gateway in HP-UX


Correction to my above posting:

should be

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

P.S:No points on this post please
Michael_695
Occasional Contributor

Re: how to change the default gateway in HP-UX

the best way to change your default gateway is to issue the following command:

set_parms addl_netwrk

to see all the other set_parms command just issue the set_parms command without any options and you will see all the available settings.

The set_parms command is what is run when the machine is being setup and it is the cleanest way to change any of your default settings.

Updating the /etc/rc.config.d/netconf file will work; however, it has been known to cause problems by manually editing this file.
sujit kumar singh
Honored Contributor

Re: how to change the default gateway in HP-UX

Hi

Just one inforamtion

set_parms without any arguments wont tell the existing settings rather it shall show you to execute commands with any of the options as root_passwd,date_time,timezone,hostname,ip_address,addl_network or initial.

You can invoke the command set_parms initial to achieve the routing changes of the default route as you are wishing.

OR also you can take the use of SAM--- Network and Oommunications- Routes -- andd modify.

else as suggested earlier you can directly edit the /etc/rc.config.d/netconf, change the default route and do the do /sbin/init.d/net stop and /sbin/init.d/net start.


route delete net default
and
route add net default
shall make the changes but that shall not be surviving thereboots.

regards
sujit