Monday, 22 April 2013

Networking [AIX]

To find out the link status, link speed and mac address and statistics of an Ethernet adapter ent0
 # entstat -d ent0  (or entstat -dt en0)
 Device Type: 10/100/1000 Base-TX PCI-X Adapter (14106902)
 Hardware Address: 00:11:25:08:1c:21

 Transmit Statistics:                          Receive Statistics: 
 --------------------                          -------------------
 Packets: 242183399                            Packets: 318139934
 Bytes: 41638159225                            Bytes: 234717791764
 Interrupts: 0                                 Interrupts: 172984103
 Transmit Errors: 0                            Receive Errors: 0
 Packets Dropped: 0                            Packets Dropped: 0
                                              Bad Packets: 0
 Max Packets on S/W Transmit Queue: 21        
 S/W Transmit Queue Overflow: 0
 Current S/W+H/W Transmit Queue Length: 1

 Broadcast Packets: 16676                      Broadcast Packets: 6200001
 Multicast Packets: 0                          Multicast Packets: 0
 No Carrier Sense: 0                           CRC Errors: 0
 DMA Underrun: 0                               DMA Overrun: 0
 Lost CTS Errors: 0                            Alignment Errors: 0
 Max Collision Errors: 0                       No Resource Errors: 0
 Late Collision Errors: 0                      Receive Collision Errors: 0
 Deferred: 0                                   Packet Too Short Errors: 0
 SQE Test: 0                                   Packet Too Long Errors: 0
 Timeout Errors: 0                             Packets Discarded by Adapter: 0
 Single Collision Count: 0                     Receiver Start Count: 0
 Multiple Collision Count: 0
 Current HW Transmit Queue Length: 1

 General Statistics:
 No mbuf Errors: 0
 Adapter Reset Count: 1
 Adapter Data Rate: 2000
 Driver Flags: Up Broadcast Debug 
         Running Simplex 64BitSupport 
         ChecksumOffload PrivateSegment LargeSend 

 10/100/1000 Base-TX PCI-X Adapter (14106902) Specific Statistics:
 Link Status : Up
 Media Speed Selected: Auto negotiation
 Media Speed Running: 1000 Mbps Full Duplex
 PCI Mode: PCI-X (100-133)
 PCI Bus Width: 64-bit
 Latency Timer: 144
 Cache Line Size: 128
 Jumbo Frames: Disabled
 TCP Segmentation Offload: Enabled
 TCP Segmentation Offload Packets Transmitted: 681521
 TCP Segmentation Offload Packet Errors: 0
 Transmit and Receive Flow Control Status: Disabled
 Transmit and Receive Flow Control Threshold (High): 49152
 Transmit and Receive Flow Control Threshold (Low): 24576
 Transmit and Receive Storage Allocation (TX/RX): 8/5
To find out the statistics of each adapter in a etherchannel
 # entstat -dt en2 
==> where en2 is a etherchannel device
==> This output give statistics about ent1 and ent2 including the link status and speed.  
To find out the MAC address, Hardware/Physical location of a network card
  # lscfg -vpl ent1 
   ent1             U7879.001.DQDGMBD-P1-T6  2-Port 10/100/1000 Base-TX PCI-X Adapter (14108902)

        2-Port 10/100/1000 Base-TX PCI-X Adapter:
        Network Address.............001125E6ACAA
        ROM Level.(alterable).......DV0210
        Hardware Location Code......U7879.001.DQDGMBD-P1-T6


  Name:  ethernet
    Node:  ethernet@1
    Device Type:  network
    Physical Location: U7879.001.DQDGMBD-P1-T6
Setting multiple IP address for a single network card
 # ifconfig lo0 alias 
 # ifconfig en0 alias <IPadress> netmask <net_mask>
To make the alias permaent, either add the above line to /etc/ or /etc/rc.tcpip. You can also make it permanent by running the following command.
 # chdev -l en0 -a alias=<IP_address>,<netmask>
To delete a static route manually

Syntax :-

chdev -l inet0 -a delroute=<net>,<destination_address>,<Gate_way_address>,<Subnet_mask>
 # chdev -l inet0 -a delroute='net','',''
To change the IP address of an interface manually
 # chdev -l en0 -a netaddr= -a netmask= -a state=up
To set the IP address initially
 # mktcpip -h <hostname> -a <ipaddress> -m <subnet_mask> -i <if_name> -n <NameServer_address> 
   -d <domain_name> -g <gateway_address> -A no 
Smit fast paths
 # smit chinet or smit inet

Name resolution order

We can achieve in two ways.
 01. By modifying /etc/netsvc.conf file
 02. By setting NSORDER Variable. (NSORDER Overrides /etc/netsvc.conf.
To change the Network speed
 # ifconfig en0 down detach
 # chdev -l ent0 -a media_speed=......
 # ifconfig en0 up

Network Options:


 command is used to change the network tuning parameters.

To list the current network parameters / network options
 # no  -a     
To enable IP forwarding
 # no -o "ipforwarding=1"
To make ipforwarding=1 permanent now and after reboot
 # no -p -o ipforwarding=1
To make the mbuff value to 200000 after the reboot
 # no -r -o ipforwarding=1
To set the ipforwarding to the default level
 # no -d ipforwarding

Network Packet Tracing and analyzing commands

Iptrace, Ipreport and tcpdump commands are used to trace and analyze network packets in AIX.

Using iptrace and ipreport utility:

1. Log in as a root user, then type the following command to start the iptrace utility:
 # startsrc -s iptrace -a -s it-ibm01 \ 
   -d it-ibm100 -p tcp -i en0 /tmp/iptrace.raw 
The utility will capture all packets using TCP protocol through the en0 interface from the source host it-ibm01 to the destination host it-ibm100. Captured packets are logged into the raw file /tmp/iptrace.raw.

2. To stop the iptrace daemon so that it no longer captures packets, type the following command:
 # stopsrc -s iptrace
3. To format the report
 # ipreport -srn /tmp/iptrace.raw > /tmp/iptrace.rpt

Using tcpdump utility:

1. To start tcpdump utility:
 # tcpdump -i en0 -w /tmp/tcpdump.raw host it-ibm01 and it-ibm100 and tcp
2. To read the captured /tmp/tcpdump.raw file
 # tcpdump -v -x -r /tmp/tcpdump.raw > /tmp/tcpdump.rpt


EtherChannel and IEEE 802.3ad Link Aggregation are network port aggregation technologies that allow several Ethernet adapters to be aggregated together to form a single pseudo Ethernet device. For example, ent0 and ent1 can be aggregated into an EtherChannel adapter called ent3; interface en3 would then be configured with an IP address. The system considers these aggregated adapters as one adapter. In addition, all adapters in the EtherChannel or Link Aggregation are given the same hardware (MAC) address, so they are treated by remote systems as if they were one adapter. Both EtherChannel and IEEE 802.3ad Link Aggregation require support in the switch so it is aware which switch ports should be treated as one.

The adapters that belong to an EtherChannel must be connected to the same EtherChannel-enabled switch. You must manually configure this switch to treat the ports that belong to the EtherChannel as an aggregated link

If an adapter fails, network traffic is automatically sent on the next available adapter without disruption to existing user connections. The adapter is automatically returned to service on the EtherChannel or Link Aggregation when it recovers.

Because the EtherChannel cannot be spread across two switches, the entire EtherChannel is lost if the switch is unplugged or fails. To solve this problem, a new backup option available in AIX 5.2 and later keeps the service running when the main EtherChannel fails. The backup and EtherChannel adapters should be attached to different network switches, which must be inter-connected for this setup to work properly. In the event that all of the adapters in the EtherChannel fail, the backup adapter will be used to send and receive all traffic. When any link in the EtherChannel is restored, the service is moved back to the EtherChannel.

Network Interface Backup

Network Interface Backup protects against a single point of network failure by providing failure detection and failover with no disruption to user connections. When operating in this mode, only one adapter is active at any given time. If the active adapter fails, another adapter in the EtherChannel will be used for all traffic. When operating in Network Interface Backup mode, it is not necessary to connect to EtherChannel-enabled switches.

The Network Interface Backup setup is most effective when the adapters are connected to different network switches, as this provides greater redundancy than connecting all adapters to one switch. When connecting to different switches, make sure there is a connection between the switches. This provides failover capabilities from one adapter to another by ensuring that there is always a route to the currently-active adapter.

To create a etherchannel with Network Backup
 # mkdev -c adapter -s pseudo -t ibm_ech -a adapter_names='ent0' -a backup_adapter='ent2'
 ent3 Available

 # lsattr -El ent3
 adapter_names   ent0           EtherChannel Adapters                       True
 alt_addr        0x000000000000 Alternate EtherChannel Address              True
 auto_recovery   yes            Enable automatic recovery after failover    True
 backup_adapter  ent2           Adapter used when whole channel fails       True
 hash_mode       default        Determines how outgoing adapter is chosen   True
 mode            standard       EtherChannel mode of operation              True
 netaddr         0              Address to ping                             True
 noloss_failover yes            Enable lossless failover after ping failure True
 num_retries     3              Times to retry ping before failing          True
 retry_time      1              Wait time (in seconds) between pings        True
 use_alt_addr    no             Enable Alternate EtherChannel Address       True
 use_jumbo_frame no             Enable Gigabit Ethernet Jumbo Frames        True

0 blogger-disqus:

Post a Comment