方法一
1.set_parms hostname
2. set_parms address
3. 修改/etc/hosts文件
注意:上面的方法实际修改了/etc/rc.config.d/netconf,重启机器生效
方法二
1. vi /etc/rc.config.d/netconf
2. 手工修改/etc/hosts文件
注意:重启机器生效
方法三:(不需要reboot机器)
1. 使用方法一或者方法二修改相关配置文件
2. 手工修改/etc/hosts文件
3. 执行(建议在console上做)
/sbin/init.d/net stop
/sbin/init.d/net.init stop
/sbin/init.d/net.init start
/sbin/init.d/net start
# cat /etc/rc.config.d/netconf
# netconf: configuration values for core networking subsystems
# @(#)B.11.11_LR $Revision: 1.6.119.6 $ $Date: 97/09/10 15:56:01 $
HOSTNAME=“hp4440a"
OPERATING_SYSTEM=HP-UX
LOOPBACK_ADDRESS=127.0.0.1 # 修改主机名,需要重启主机。
# For each additional network interfaces, add a set of variable assignments
# like the ones below, changing the index to "[1]", "[2]" et cetera.
# IMPORTANT: for 9.x-to-10.0 transition, do not put blank lines between
# the next set of statements
INTERFACE_NAME[0]=lan1 # 0 表示这是第一个网卡参数,依次类推。
IP_ADDRESS[0]=10.77.220.115
SUBNET_MASK[0]=255.255.248.0 -------------网卡
BROADCAST_ADDRESS[0]=""
INTERFACE_STATE[0]=""
DHCP_ENABLE[0]=0
# The NODENAME variable (limited to 8 chars) will be used to set the
# UUCP name (uname -S), since HOSTNAME is longer than 8 chars.
NODENAME=hp4440a
ROUTE_GATEWAY[0]=10.77.220.1 ----------缺省路由
ROUTE_COUNT[0]=1
ROUTE_DESTINATION[0]=default