Learn APA configuration in HPUX. Auto port aggregation logic is similar to network teaming in Linux. Used for network card hardware level redundancy.
APA stands for Auto Port aggregation. It is software i.e. operating system level configuration which offers NIC (Network Interface Card also referred as LAN card) redundancy. We have already briefed about APA in this post , refer first paragraph.
Also read : Network bonding-teaming in Linux
Lets run down to configuration steps for APA in HPUX in failover group mode.
You need to have teaming software installed on your system. The Teaming (Auto PORT Aggregation) application is inbuild in HP-UX 11i V2 EOE. If not you can download it from HP software repository and install on your HPUX server.
Make sure your primary network interface card (NIC) is configured with proper IP address, mask and gateway. Use netstat -in command.
# ioscan -funC lan Class I H/W Path Driver S/W State H/W Type Description =================================================================== lan 1 1/1/0 gelan CLAIMED INTERFACE HP A4926A PCI 1000Base-SX Adapter /dev/gelan4
Lets assume we have identified lan1 as secondary NIC for our config. lan0 being the primary one.
Secondly identify your second NIC which can be used as secondary card in APA configuration (Use ioscan -fnClan command.). Make sure this card is connected to different network switch, configured with same vLan as primary on network end and is physically does not reside in same hardware module of primary NIC. This ensures high availability in case of network, switch or card hardware failure.
To confirm both cards have same network reachability (i.e. on same vlan) use below command :
# linkloop -i PPA_pri StationAddr_sec # linkloop -i 1 0x00108323463C Link connectivity to LAN station: 0x00108323463C -- OK ---- failure output means no connectivity---- Link connectivity to LAN station: 0x00108323463C error: get_msg2 getmsg failed, errno = 4 -- FAILED frames sent : 1 frames received correctly : 0 reads that timed out : 1
where, station address is MAC (can be obtained from lanscan output) and PPA number is lan0, lan1 number. Try in both way. using MAC of primary and PPA of secondary and vice versa to make sure you have connectivity between both cards. If you get shown failed error then those two cards cant be used in APA config together.
Edit configuration file /etc/rc.config.d/hp_apaportconf and mention interface names (lano and lan1 in out case) like below:
HP_APAPORT_INTERFACE_NAME=lan0 HP_APAPORT_CONFIG_MODE=LAN_MONITOR HP_APAPORT_INTERFACE_NAME=lan1 HP_APAPORT_CONFIG_MODE=LAN_MONITOR
Start APA services.
# /sbin/init.d/hpapa start /sbin/init.d/hpapa started. Please be patient. This may take about 40 seconds. HP_APA_DEFAULT_PORT_MODE = MANUAL /usr/sbin/hp_apa_util -S 0 LAN_MONITOR /usr/sbin/hp_apa_util -S 1 LAN_MONITOR /sbin/init.d/hpapa Completed successfully. # /sbin/init.d/hplm start
Now, we will create LAN configuration file which can be applied later to both NIC to make them aware they are working in group under same IP umbrella. lanqueryconf command creates ASCII file at /etc/lanmon/lanconfig.ascii
# lanqueryconf -s # more /etc/lanmon/lanconfig.ascii NODE_NAME teststation POLLING_INTERVAL 10000000 DEAD_COUNT 3 FAILOVER_GROUP lan900 STATIONARY_IP 10.10.2.5 PRIMARY lan0 5 STANDBY lan1 3
See content of this ASCII file. It has node name, polling interval (microseconds, default is 10 sec). Dead count is number of polling packets missed to consider failure and initiate failover (default is 3). Failover group is lan name which will be visible systemwide. lan900 will have our primary NIC address and lan0, lan1 will work together as lan900. IP is IP taken up by lan900. lan0 will be treated as primary NIC and lan1 as standby. Number 5,3 denotes priorities of respective NIC.
You can make changes in this file if you dont want to go with default values.
Above file is genrated for admin to edit if any changes required. After that, file will be checked for integrity and then can be applied to APA configuration like below :
# lancheckconf Reading ASCII file /etc/lanmon/lanconfig.ascii Verification of input file /etc/lanmon/lanconfig.ascii is complete. # lanapplyconf Reading ASCII file /etc/lanmon/lanconfig.ascii Creating Fail-Over Group lan900 Updated binary file /etc/lanmon/lanconfig
Here lan900 is created and you APA is complete.
Now you can see your lan0 and lan1 are vanished from lanscan -q output and instead lan900 appeared with 0 and 1 as its members.
# lanscan -q 2 3 900 0 1 901
You can verify that lan900 will have IP address which was configured on primary NIC lan0 before configuration (in netstat -in output).
You can even test if APA failover is happening correctly. Follow this testing procedure to make sure your APA works properly. Sometimes lan900 wont appear and you need to restart your system. Rebooting system takes up new APA configuration and you will able to see lan900 in action.
If there are more than one APA configured on system then it will follow the series of lan901, lan902 and so on.