Operating System - HP-UX
1834403 Members
2853 Online
110067 Solutions
New Discussion

Re: Need to change the default gateway's IP

 
Rita Li
Frequent Advisor

Need to change the default gateway's IP

Hi All,

One very simple question here for you gurus there, but I just have no experience how to do it :

I am asked to "configure a permanent ARP cache entry that maps XXX.XXX.XXX.XXX to the same MAC address as the original XXX.XXX.YYY.YYY." & now I have this MAC addres on hand of format 0:0:x:x:xx:1.

ie. we want to change the default gateway from xx.xx.xx.xx to xx.xx.yy.yy, can someone tell me what command or sam can achieve this. Is it possible to do a permanent change without a reboot?

FYI - after default gateway change, that will be followed by a IP + net mask change where I know how to change via sam

Thanks in advance for any input

-Rita
5 REPLIES 5
Philip Chan_1
Respected Contributor

Re: Need to change the default gateway's IP

The command to use for changing default gateway is "set_parms addl_network".

# set_parms addl_network


Printaporn_1
Esteemed Contributor

Re: Need to change the default gateway's IP

Hi Rita,

1. To add arp permanent entry

#arp -s hostname hw_address

2. To change gateway IP
edit /etc/rc.config.d/netconf
change
ROUTE_GATEWAY entry to new address.

3. To change IP/Netmask in sam
goto networking and communication -> network interface card -> action -> configure

-----------
please make sure that entry in /etc/hosys or DNS was changed

then reboot or
#/sbin/init.d/net stop
#/sbin/init.d/net start

--------------
use
#arp -a to check for arp entry
#ifconfig to check for ip/netmask
#netstat -r to check for route statement.

Regards,

enjoy any little thing in my life
Mark Mitchell
Trusted Contributor

Re: Need to change the default gateway's IP

the fastest way to change the gateway is to
vi the file /etc/rc.config.d/netconf.
Put in the new address and then enter
#/sbin/init.d/net stop
#/sbin/init.d/net start
rick jones
Honored Contributor

Re: Need to change the default gateway's IP

if you want to change the default gateway configuration, why do you want to mess with the ARP table? Does the gateway not respond to ARP requests or something?
there is no rest for the wicked yet the virtuous have no pillows
Celso Medina Kern
Trusted Contributor

Re: Need to change the default gateway's IP

Hello Rita,

You don?t need to reboot indeed!

Take care using SAM if you are over the network because your connection may be broken. You would rather using system console.

To change your current default gateway, just delete the current route, readd with the new IP and make these changes permanent editing /etc/rc.config.d/netconf and changing the statement ROUTE_GATEWAY[]=xxx.xxx.xxx.xxx to xxx.xxx.yyy.yyy under the ROUTE_DESTINATION[]=default
Commands:
route delete default xx.xx.xx.xx
route add default xx.xx.yy.yy 1
vi /etc/rc.config.d/netconf

You don?t need to make permanent arp entry unless no ARP server answer this question(usually each host is arp server for its interfaces). If you need hp-ux to answer for gateway?s MAC, add an entry like that:
arp -s hostname mac pub

Don?t forget to update your name service too(/etc/hosts ou DNS database in DNS server).

If you want to change IP/mask manually, do the following:
- discover what network interface you will be working with through a `netstat -in`
- Suposing it is lan3, disable the interface:
ifconfig lan3 down
- Remove routes to lan3(/sbin/init.d/net stop does not do this):
netstat -rn
route delete
Use route delete to every route which interface columns states your equivalent to "lan3".
- Edit netconf to make new ip/netmask permanent: vi /etc/rc.config.d/netconf
Your changes need to be done only in statements identified by the same index as your interface. Ex.:
INTERFACE_NAME[0]="lan3"
IP_ADDRESS[0]="xxx.xxx.yyy.yyy"
SUBNET_MASK[0]="0xfffff800"
BROADCAST_ADDRESS[0]=""
LANCONFIG_ARGS[0]="ether"
DHCP_ENABLE[0]=0

Restart your interfaces(it will not disrupt established conections):
/sbin/init.d/net start

Best regards :)
God bless pessimists, they did the backup!