I have a aix 5.3, two network adapter, configure as a etherchannel, how can I know the vlan id by command?
ifconfig -a
Will show on which interface is IP set. for example if it's en2 then run command:
entstat -dt ent2 | grep -i pvid
and you will see what is the VLAN is for the interface
entstat -d enN
where 'N' is the instance number of the interface.
However, I believe there are constraints such as the type of card you're using (lhea) / is this a virtual nic, as to whether you can get this info from the host-side.
Even if this an LPAR which is connected via a virtual adapter it will still give a VLAN id as this is still an ENT adapter according to AIX.
dsw has it right. You can see the VLANs of virtual network adapters even if they are inside an etherchannel. My ent0 is on VLAN 10 and my ent1 is on VLAN 20. Here is an example from one of my boxes.
hostname:/:$ lsdev | grep ^ent
ent0 Available Virtual I/O Ethernet Adapter (l-lan)
ent1 Available Virtual I/O Ethernet Adapter (l-lan)
ent2 Available EtherChannel / IEEE 802.3ad Link Aggregation
hostname:/:$ entstat -d en2 | egrep "ETHERNET STATISTICS|Port VLAN ID"
ETHERNET STATISTICS (en2) :
ETHERNET STATISTICS (ent0) :
Port VLAN ID: 10
ETHERNET STATISTICS (ent1) :
Port VLAN ID: 20
hostname:/:$