Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IP, Network mask and Default gataway change

Status
Not open for further replies.

vkostovic

IS-IT--Management
Jan 16, 2001
34
US
Hi All

I am Unix admin experienced with SUN and AIX environment. I need to change IP, netmask and Default Gataway on my HPUX 10.20 T600 server.
Bellow is the procedure that I have created and I would appreciate any feedback.

1. cp /etc/hosts /etc/hosts.date

2.cp /etc/rc.config.d/netconfig /etc/rc.config.d/netconfig.date

3. vi /etc/hosts and add your new IP address
new IP address hostname

4. vi /etc/rc.config.d/netconf and change the following entries
„h IP address
„h Netmask
„h Default gataway


ROUTE_DESTINATION[1]="default"
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]=new IP address for gataway
ROUTE_COUNT[1]=1
ROUTE_ARGS[1]=""

RARPD=0
IP_ADDRESS[1]=new IP address
SUBNET_MASK[1]=new subnet mask address
INTERFACE_NAME[1]=lan1
BROADCAST_ADDRESS[1]=new broadcast IP address
LANCONFIG_ARGS[1]="ether"
DHCP_ENABLE[1]=0

5. To configure IP parameters without rebooting the box type

ifconfig lan1 down

ifconfig lan1 IP-address netmask NM-address up

6. Route add default DG-address

Thanks a lot.

Vlad
 
Use the command : set_parms initial

This will run you through all the necessary configuration you need to set up....

 
First, you cannot have backup files of netconf in the /etc/rc.config.d directory please mv the file /etc/rc.config.d/netconfig.date because at startup the system will read the netconfig.date last and use the setting form that file.

Second, you can only have 1 default gateway, I am assuming that ROUTE_DESTINATION[0]="default" is also set.
if that is the use ROUTE_DESTINATION[1]="net xxx.xxx.xxx" for a second gateway.

Third I did not see a line for INTERFACE_NAME[1]=lan1
this lets the system know the all entries with [1] is for lan1
 
Also, you can go to /sbin/init.d and execute:

1. "./net stop"
2. "./net start"

This will read all config files.
 
Thanks Guys,

When I posted my message I copied and pasted one part of my netconf file.

I edited netconf file, changed manually ip (ifconfig) and default gateway (route add) and everything worked OK.

Thanks a lot for hints.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top