Operating System - HP-UX
1754014 Members
5372 Online
108811 Solutions
New Discussion юеВ

How to change gateway on lan1 without interrupting system

 
SOLVED
Go to solution
Jerry_109
Super Advisor

How to change gateway on lan1 without interrupting system

HP-UX hohp112 B.11.11 U 9000/800/rp4440

##################################
Hello All,

Is there a way to change gateway address of my "lan1" card without interrupting the system ? This is a production server, and lan0
should not be interrupted.

##################################
root@hohp112[/root]
# /etc/ioscan -nfC lan
Class I H/W Path Driver S/W State H/W Type Description
===================================================================
lan 0 0/1/2/0 iether CLAIMED INTERFACE HP AB352-60001 PCI/PCI-X 1000Base-T Dual-port Core
lan 1 0/1/2/1 iether CLAIMED INTERFACE HP AB352-60001 PCI/PCI-X 1000Base-T Dual-port Core
######################################



root@hohp112[/root]
# ifconfig lan1
lan1: flags=1843
inet 172.31.22.218 netmask fffffff8 broadcast 172.31.22.223

##################################



root@hohp112[/root]
# netstat -rn
Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
10.2.110.112 10.2.110.112 UH 0 lan0 4136
172.31.22.218 172.31.22.218 UH 0 lan1 4136
172.31.22.216 172.31.22.218 U 2 lan1 1500
10.2.0.0 10.2.110.112 U 2 lan0 1500
172.31.22.224 172.31.22.217 UG 0 lan1 0
172.31.22.0 172.31.22.217 UG 0 lan1 0
127.0.0.0 127.0.0.1 U 0 lo0 0
default 10.2.1.1 UG 0 lan0 0
root@hohp112[/root]
######################################



#
root@hohp112[/root]
# netstat -rn | grep lan1
172.31.22.218 172.31.22.218 UH 0 lan1 4136
172.31.22.216 172.31.22.218 U 2 lan1 1500
172.31.22.224 172.31.22.217 UG 0 lan1 0
172.31.22.0 172.31.22.217 UG 0 lan1 0
##################################

# cat /etc/rc.config.d/netconf | grep -v "#"

HOSTNAME="hohp112"
OPERATING_SYSTEM=HP-UX
LOOPBACK_ADDRESS=127.0.0.1


INTERFACE_NAME[0]="lan0"
IP_ADDRESS[0]="10.2.110.112"
SUBNET_MASK[0]="255.255.0.0"
BROADCAST_ADDRESS[0]=""
INTERFACE_STATE[0]=""
DHCP_ENABLE[0]=0


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


GATED=0
GATED_ARGS=""


RDPD=0


RARP=0

IP_ADDRESS[1]=172.31.22.218
SUBNET_MASK[1]=255.255.255.248
INTERFACE_NAME[1]=lan1
BROADCAST_ADDRESS[1]=172.31.22.223
INTERFACE_STATE[1]=up
DHCP_ENABLE[1]=0

ROUTE_DESTINATION[1]="net 172.31.22.224"
ROUTE_MASK[1]="255.255.255.0"
ROUTE_GATEWAY[1]=172.31.22.217
ROUTE_COUNT[1]=1
ROUTE_ARGS[1]=""

root@hohp112[/root]
#######################################


7 REPLIES 7
IT_2007
Honored Contributor
Solution

Re: How to change gateway on lan1 without interrupting system

you can change netconf file reflecting new gateway but you need to stop and restart /sbin/init.d/net otherwise it won't take affect.

Since you are using default gateway through lan0 it is ok you can plumb lan1 to get going with new gateway through lan1.

ifconfig lan1 plumb
ifconfig lan1 unplumb
Marvin Strong
Honored Contributor

Re: How to change gateway on lan1 without interrupting system


As stated the ifconfig command is your friend.

but you will also need to update /etc/rc.config.d/netconf

man ifconfig for more details.
Marcel Boogert_1
Trusted Contributor

Re: How to change gateway on lan1 without interrupting system

Hi there,

You can use "route add" for the time being. After your next planned reboot the netconf will be used and your settings will be permanent.

Regards,
MB.
Jerry_109
Super Advisor

Re: How to change gateway on lan1 without interrupting system

Hello All,

I'm still waiting for the network folks to deliver the new gateway address. I assume the commands would look like :
####################################

# ifconfig lan1 unplumb

#ifconfig lan1 172.31.22.218 netmask 255.255.255.248 up

#route add 172.31.22.0 1

netconf:
INTERFACE_NAME[1]=lan1
IP_ADDRESS[1]=172.31.22.218
SUBNET_MASK[1]=255.255.255.248
BROADCAST_ADDRESS[1]=172.31.22.223
INTERFACE_STATE[1]=up

ROUTE_DESTINATION[1]="net 172.31.22.0"
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]=""
ROUTE_COUNT[1]=1
ROUTE_ARGS[1]=""
Kevin Wright
Honored Contributor

Re: How to change gateway on lan1 without interrupting system

route delete/route add the 172.31.22.224 route. Your default route won't be affected.
Jerry_109
Super Advisor

Re: How to change gateway on lan1 without interrupting system

# ifconfig lan1 unplumb

#ifconfig lan1 172.31.22.218 netmask 255.255.255.248 up

#route delete 172.31.22.224
#route add 172.31.22.0 1

netconf:
INTERFACE_NAME[1]=lan1
IP_ADDRESS[1]=172.31.22.218
SUBNET_MASK[1]=255.255.255.248
BROADCAST_ADDRESS[1]=172.31.22.223
INTERFACE_STATE[1]=up

ROUTE_DESTINATION[1]="net 172.31.22.0"
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]=""
ROUTE_COUNT[1]=1
ROUTE_ARGS[1]=""
IT_2007
Honored Contributor

Re: How to change gateway on lan1 without interrupting system

looks good.

Good Luck.