- 论坛徽章:
- 0
|
本帖最后由 tdy218 于 2010-04-21 13:54 编辑
自问自答了,刚弄出来了.
# lanscan
Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
0/0/3/0 0x00306E39B72E 0 UP lan0 snap0 1 ETHER Yes 119
0/1/2/0 0x00306E39271F 1 UP lan1 snap1 2 ETHER Yes 119
# ifconfig lan0
lan0: flags=843<UP,BROADCAST,RUNNING,MULTICAST>
inet 192.168.1.54 netmask ffffff00 broadcast 192.168.1.255
#cat /etc/rc.config.d/netconf
HOSTNAME="hp-ux"
OPERATING_SYSTEM=HP-UX
LOOPBACK_ADDRESS=127.0.0.1
INTERFACE_NAME[0]="lan0"
IP_ADDRESS[0]="192.168.1.54"
SUBNET_MASK[0]="255.255.255.0"
BROADCAST_ADDRESS[0]=""
INTERFACE_STATE[0]=""
DHCP_ENABLE[0]=0
INTERFACE_MODULES[0]=""
ROUTE_DESTINATION[0]="default"
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]="192.168.1.1"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""
#vi /etc/rc.config.d/netconf
To add a alias address to lan0, add the network information to /etc/rc.config.d/netconf file
INTERFACE_NAME[0]=lan0:1
IP_ADDRESS[0]=192.168.0.54
SUBNET_MASK[0]=255.255.255.0
BROADCAST_ADDRESS[0]=""
INTERFACE_STATE[0]=""
DHCP_ENABLE[0]=0
INTERFACE_MODULES[0]=""
#/sbin/init.d/net stop
#/sbin/init.d/net start
# ifconfig lan0
lan0: flags=843<UP,BROADCAST,RUNNING,MULTICAST>
inet 192.168.1.54 netmask ffffff00 broadcast 192.168.1.255
# ifconfig lan0:1
lan0:1: flags=843<UP,BROADCAST,RUNNING,MULTICAST>
inet 192.168.0.54 netmask ffffff00 broadcast 192.168.0.255
# netstat -in
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lan0:1 1500 192.168.0.0 192.168.0.54 3730 0 2738 0 0
lan0 1500 192.168.1.0 192.168.1.54 276231 0 1365674 0 0
lo0 32808 127.0.0.0 127.0.0.1 377222 0 377222 0 0 |
|