Pages

Monday 30 January 2012

Virtual I/O Server(VIOS) useful commands

Virtual I/O Server(VIOS) useful commands 

Initialize the LPAR Configuration : 

# mkgencfg -o init

[OS] Software Management : 

To display VIO Server level:

# ioslevel

To update the IOS software:

# updateios –dev /update -

To installs a new filesets (mainly used for TL updates):

# updateios –dev /cd0 -install -accept

To commit all applied :

# updateios –commit

To rejects all uncommitted updates :

# updateios –reject

To clean all incomplete pieces of the previous installation :

# updateios –clean

To remove a fileset :

# updateios –remove fileset_name

To take the OS backup in a CD ROM :

# backupios –cd /dev/cd1 -cdformat

To take the OS backup in a DVD-RAM :

# backupios –cd /dev/cd1 -udf

To take the OS backup in a tape drive :

# backupios –tape /dev/rmt0

Just verifies the backup available in a tape :

# backupios –tape /dev/rmt0 -verify

Generates backup to a file. No user VGs are -nosvg back’d up :

# backupios –file /opt/file1

To display the underlying AIX OS version :

# oem_platform_level

To open a non-restricted root shell :

# oem_setup_env

This shell is used mainly for the installation of vendor software such as device drivers.

Remote Management : 

To enable remote_management using NIM master :

# remote_management nim1

To disable remote management :

# remote_management –disable

License Management: 

To display the current license :

# license –view

To accept the license :

# license –accept

To view if the license has been accepted :

# license

Software Management: 

To list all the installed software :

# lssw

To list all the installed software and their history

# lssw –hist

Management of Virtual Terminals: 

To open a virtual terminal for partition with id 2 :

# mkvt –id

To close a virtual terminal for a partition with id 2 :

# rmvt –id 2

Device Management: 

To change the attribute of a device permanently.

# chdev -dev scsi0 -attr -perm

Sometimes it reboots the system if perm is used

To disable the path between hdisk1 and scsi0 :

# chpath -dev hdisk1 -pdev scsi0 -op disable

To configures the devices in the VIO server :

# cfgdev

To configures the devices attached to scsi0 adapter :

# cfgdev –dev

To unconfigure the cd-rom device :

# rmdev –dev cd0

To unconfigure scsi adapter and its child devices :

# rmdev –recursive –dev scsi1

To unconfigures the children of pci1 but not the PCI bus pci1 :

# rmdev –pdev pci1

Management of Virtual/Shared Devices: 

To create a virtual target device that maps lv20 as a virtual disk for a client partition hosted by the vhost0 virtual server adapter :

# mkvdev -vdev lv20 -vadapter vhost0

Same as above except here hdisk is used instead of a logical volume :

# mkvdev -vdev hdisk6 -vadapter vhost2

To create a SEA that maps the physical Ethernet adapter ent4 as a virtual adapter for the client

partitions served by the virtual Ethernet adapters ent6 and ent7, using ent6 as the default adapter and 8 as the default id :

# mkvdev -sea ent4 -vadapter ent6,ent7 -default ent6 -defaultid 8

To remove a virtual target device vtscsi9 along with its backing lv :

# rmvdev –vdev vtscsi9 –

To remove all virtual target device associated with backing device lv001 :

# rmvdev –vdev lv001

To remove a specific virtual target device :

# rmvdev –vtd vtscsi10

List Device Mapping: 

To list all virtual target devices and backing devices mapped to virtual server adapter vhost2 :

# lsmap -vadapter vhost2

To list SEA and physical device mapped to virtual Ethernet Adapter ent4 :

# lsmap -vadapter ent4 –net

To list all virtual target devices and backing devices where backing devices are of type LV :

# lsmap -all -type lv

To list all network mapping :

# lsmap –all –net

How to list Devices : 

To display all the devices :

# lsdev

To display all the virtual devices :

# lsdev –virtual

To display all the virtual adapters :

# lsdev –type adapter –virtual

To display all the slots :

# lsdev –slot s

To display all the adapters :

# lsdev –type adapter

Few other device types: disk, lv, optical, tape, tty

To list all physical Ethernet adapters and Etherchannel available for creating a SEA :

# lsdev –type ent4sea

To list all virtual Ethernet adapters available for creating a SEA :

# lsdev –type ven4sea

To list all adapters over which ip address can be configured :

# lsdev –type ent4ip

To display parent device of a device :

# lsdev –dev hdisk0 –

To list disks names and physical location alone :

# lsdev -type disk -field name physloc

Logical Volume Manager : 

Volume Group

To create a vg on hdisk1 :

# mkvg -vg newvg hdisk1

To drain I/O’s for a vg and suspends future I/O’s :

# chvg -suspend vg03

To resume normal I/O operations for a vg :

# chvg -resume vg03

Unlock a VG if left in a locked state by abnormal termination of another lvm operation :

# chvg -unlock vg03

To add a physical volume to a volume group :

# extendvg vg3 hdisk3

To remove a PV from a VG :

# reducevg vg01 hdisk1

To remove a PV and all residing LVs from a VG with no confirmation :

# reducevg –rmlv –f vg01

To activate a vg :

# activatevg vg03

To deactivate a vg :

# deactivatevg vg03

To mirror the VIO Server’s rootvg to hdisk4 and reboots VIO Server :

# mirrorios –force hdisk4

To mirror the VIO Server’s rootvg to hdisk4 but don’t reboot the server :

# mirrorios –defer hdisk4

To remove the rootvg mirror from hdisk4 :

# unmirrorios hdisk4

To import a VG from hdisk07 :

# importvg –vg vg001 hdisk07

To export a VG :

# exportvg vg3

Note: Volume Group containing a paging space can’t be exported

To sync a VG :

# syncvg –vg vg01

To sync a LV :

# syncvg –lv lv001

To sync a PV :

# syncvg –pv hdisk4 hdisk5

To redefine a VG based on the VGDA from hdisk04 :

# redefvg –dev hdisk04

Logical Volume : 

To create a logical volume of size 1MB in vg01 :

# mklv –lv lv001 vg01 1M hdisk1

To create a logical volume with mirror in place in vg01 of size 1GB :

# mklv –mirror vg01 1G

To extend an LV by 3MB :

# extendlv lv01 3M

To extend an LV by 1GB with space taken from hdisk5 :

# extendlv lv01 1G hdisk5

To remove a logical volume :

# rmlv lv05

To display the properties of a logical volume :

# lslv lv03

To display info about LV by Physical volume :

# lslv –pv lv03

To display LVs that can be used as backing devices :

# lslv –free

To make a copy for lv01 in hdisk03 :

# mklvcopy lv01 hdisk03

To remove lv01’s copy from hdisk03 :

# rmlvcopy lv01 hdisk03

To copy the contents of lv01 to lv02 :

# cplv lv01 lv02

To copy the contents of lv01 to a new lv in vg01 :

# cplv –vg vg01 lv01

To change the name of oldlv to newlv :

# chlv –lv newlv oldlv

Physical Volume 

To display all physical volumes in the system :

# lspv

To display the status and characteristics of hdisk03 :

# lspv hdisk03

To list all the available PVs used as virtual SCSI backing devices :

# lspv –avail

To list PVs that can be used as virtual SCSI backing devices and are not currently a backing device :

# lspv –free

To move physical partitions from hdisk1 to hdisk2 :

# migratepv hdisk1 hdisk2

To move physical partitions in lv01 from hdisk1 to hdisk2 :

# migratepv –lv lv01 hdisk1 hdisk2

Storage Pool Management:

To create storage pool “client_data” using hdisk3 hdisk4 hdisk3 and hdisk4 :

# mksp -f client_data

To set client_data storage pool as default :

# chsp –default client_data

To list all storage pools :

# lssp

To list the default storage pool :

# lssp –default

To list the backing device in rootvg storage pool :

# lssp –bd –sp rootvg

To attach a storage from a storage pool to a Virtual SCSI adapter:

# mkbdsp -bd lv001 -vadapter vthost2 -tn vtscsi9

To removes storage from a Virtual SCSI adapter, and removes the backing device :

# rmbdsp –bd lv001

To remove storage from a Virtual SCSI adapter, And makes sure backing device is not deleted :

# rmbdsp –bd lv001 -savebd

To removes storage from a Virtual SCSI adapter, and removes the backing device :

# rmbdsp –vtd vtscsi9

To removes storage from a Virtual SCSI adapter. and makes sure backing device is not deleted :

# rmbdsp –vtd vtscsi8 -savebd

Network Configuration : 

TCP/IP Configation:

To configure tcpip on a network interface :

# mktcpip -hostname sys01vio2 -inetaddr 9.47.90.113 -interface en2 -netmask 255.255.255.0 -gateway 9.47.90.1 -nsrvdomain yahoo.com -start

To display the stored tcp/ip configuration in the system :

# lstcpip –stored

To display ethernet adapters on the system :

# lstcpip –adapters

To display the system hostname :

# lstcpip –hostname

To display DNS name servers in search order and domain name :

# lstcpip –namesrv

To display the routing table :

# lstcpip –routtable

To display routing table in numeric output instead of hostname :

# lsctpip –num –routtable

To display all the open inet sockets :

# lstcpip –sockets –family inet

To display the status of all configured interfaces :

# lstcpip –state

To remove all TCP/IP configuration :

# rmtcpip –all

To unconfigure tcpip in en0:

# rmtcpip –interface en0

To cleanup static routing table :

# rmtcpip –f -routing

To remove IP information from en0 after reboot :

# rmtcpip –f –interface en0 -nextboot

To remove DNS information and clears the hosts file :

# rmcpip –namesrv

Managing IP address-to-host name Mapping Entries: 
To add IP address-to-host name mapping entry :

# hostmap -addr 192.100.1.7 -host alpha

To list all IP address-to-host name mapping entries :

# hostmap –ls

To delete the IP address-to-host name mapping entry :

# hostmap-rm 192.100.1.7

Managing Network Services: 

To enable all the network services :

# startnetsvc ALL

To enable the telnet daemon :

# startnetsvc telnet

To enable the ftp daemon :

# startnetsvc ftp

To enable the ssh daemon :

# startnetsvc ssh

To enable the ldap daemon :

# startnetsvc ldap

To enable the cimserver daemon :

# startnetsvc cimserver

To enable the xntpd daemon :

# startnetsvc xntpd

To send CLI tracing details to the system log :

# startnetsvc tracelog

To send system error to the system log :

# startnetsvc errorlog

To disable all the network services :

# stopnetsvc ALL

To disable the telnet daemon :

# stopnetsvc telnet

To disable the ftp daemon :

# stopnetsvc ftp

To disable the ssh daemon :

# stopnetsvc ssh

To disable the ldap daemon :

# stopnetsvc ldap

To disable the cimserver daemon :

# stopnetsvc cimserver

To disable the xntpd daemon :

stopnetsvc xntpd

To stop sending CLI tracing details to system log :

# stopnetsvc tracelog

To stop sending system error log to the system log :

# stopnetsvc errorlog -

To display the status of ftp network service :

# lsnetsvc ftp

Managing DNS, Domain and Search Order Entries: 
To add a domain entry :

# cfgnamesrv -add -dname abc.aus.century.com

To add a name server entry :

# cfgnamesrv –add -ipaddr 192.9.201.1

To display all the DNS entries :

# cfgnamesrv -ls

Network Tuning Parameters:

To display the maximum size of the mbuf pool :

# optimizenet –get thewall

To set a machine as internet work router over TCP/IP networks :

# optimizenet –set ipforwarding=1

To display information on udp_recvspace :

# optimizenet –h udp_recvspace

Network Monitoring: 
To display all the statistics, including the device- specific statistics :

# entstat ent0

To reset all the statistics back to their initial values :

# entstat –reset ent0

To display the route to a particular host :

# traceroute nis.nsf.net

System Monitoring : 
To display the summary of current system activity :

# sysstat

To display the system statistics :

# topas

System Management Commands: 
To halt the operating system :

# shutdown

To halt the operating system forcibly :

# shutdown –force

To reboot the vio server :

# shutdown –restart

To invalidate the boot list for service mode :

# bootlist -mode service –rm

To display the boot list for service mode :

# bootlist -mode service –ls

To set the boot list for normal mode :

# bootlist –more normal hdisk0

To display the complete detailed error report :

# errlog –ls

To remove all the error log entries :

# errlog –rm 0

To remove the error log entries older than 5 days :

# errlog –rm 5

To change the system date and time :

# chdate -day 12 -month 10 -year 2004 -hour 16 -minute 30

To change the language for the entire system to French Canadian :

# chlang -lang fr_CA

To display available languages :

# chlang –ls

To perform hardware problem determination and maintenance :

# diagmenu

To generate report on microcode levels of all the devices :

# invscout –report

To display the vpd survey of the partition :

# invscout –vpd

To append the current MOTD [Message Of The Day] :

# motd –append “Message”

To overwrite MOTD :

# motd –overwrite -file filename

To do the initial configuration of VIO Server :

# cfgassist

It is like configuration assitant in AIX.

To do filesystem scan :

# fsck /dev/lv01

To display exported (nfs) directories on a remote server :

# showmount hostname

To start system dump on the primary device :

# startsysdump

To display continuous disk report on disk1 at 2sec interval :

# viostat -disk disk1 2

To display adapter throughput reports :

# viostat –adapter

To display system and adapter throughput reports :

# viostat –sys –adapter

To gather system info and to store it in the floppy disk :

# snap -general -dev /dev/rfd0

To display microcode levels of all devices :

# lsfware –all

Managing Agents: 
To start an agent : # startsvc agent_name

To stop an agent: # stopsvc agent_name

To display an agent’s configuration information :

# lssvc agent_name

To display all the available agents :

# lssvc

To display the attributes associated with ITSM_base agent :

# cfgsvc –ls ITM_base

To display the ITM_base agent ssh public key :

# cfgsvc -key ITM_base

User Management: 
To create a user :

# mkuser

To change an attribute of a user :

# chuser

To display the properties of a user :

# lsuser

To remove a user from the system :

# rmuser

To set/reset password for a user :

# passwd

Security Commands: 
To display all failed logins :

# lsfailedlogin

To display the contents of global command log :

# lsgcl

To displays high system settings :

# viosecure -level high

To apply all of the high system settings to the system :

# viosecure -level high –apply

To displays the current system settings :

# viosecure –view

To allow IP activity on the ftp-data, ftp, ssh, www, https, rmc, and cimon ports, and to deny other IP activity :

# viosecure –firewall on

To enable IP activity on all ports :

# viosecure –firewall off

To display the list of allowed ports :

# viosecure -firewall view

Friday 27 January 2012

Cleaning up a failed software installation

Cleaning up a failed software installation 

Using this scenario, you can clean up software products and service updates after an interrupted or failed installation.

Things to consider 

The information in this how-to scenario was tested using specific versions of AIX. The results you obtain might vary significantly depending on your version and level of AIX.

The cleanup procedure attempts to delete items that were partially installed or left in an incomplete state. This scenario applies only to the update or installation of optional software products.

Note: It is recommended that you first perform a system backup before installing software updates to ensure safe system recovery.

The cleanup procedure attempts to revert the update to its previous state. For example, when cleaning up an update that was interrupted in the COMMITTING state, the cleanup procedure attempts to return the update to its APPLIED state.

If an update installation is interrupted, run the lslpp -l command to see the current state of the update. For example, if you run lslpp -l on an interrupted update installation, it might report the update status as APPLYING rather than APPLIED.

If the interruption occurs during the initial state of an installation, then the cleanup procedure attempts to delete the installation entirely and restore the previous version of the product (if there is one). When the previous version is restored, it becomes the active version. When the previous version cannot be restored, the software is listed by the lslpp -l command as BROKEN.

When the product is deleted or BROKEN, you can attempt to reinstall the software. Any product in the BROKEN state cannot be cleaned up; it can only be reinstalled or removed. 

To initiate a cleanup procedure using SMIT: 
  1. Type smit maintain_software on the command line. 
  2. Select Clean Up After Failed or Interrupted Installation and press Enter. 
To initiate a cleanup procedure from the command line: 

  1. Type installp -C on the command line and press Enter. 

If prompted to reboot (restart) the system after running the cleanup procedure, then do so now.

If you get a message indicating that no products were found that could be cleaned up, you may have executed the cleanup procedure when it was not needed. Try your installation again.

clearing selective history in centos multiple lines script


# This bash script must be used with 'source' or '.'
# and so it does not need to be made executable.
# . scriptname          Display last 35 history lines (default)
# . scriptname n        Display last n history lines
# The lines are displayed with their line numbers.
# Enter a list of the lines to be deleted
# An example of a line list is 90 45-56 78-
# 90     Delete line 90
# 45-56  Delete lines 45 to 56 (can also use 56-45)
# 78-    Delete line 78 to the last line
# Number ranges can be in any order in the list and can overlap.
# The lines are deleted in memory, not from the history file.

displaylines=35  # default
#displaylines=    # if unset all of the history will be displayed
if [ "$1" ];then displaylines=$1;fi # or use $1 instead of default

lastline=$(echo $(history 1))   # Last line, with leading spaces removed
lastlinenum=${lastline%%[* ]*}  # Extract line number from the last line
# Note: '*' after a line number in bash history indicates a modified line

# history -d$lastlinenum # Delete the command which ran this script (optional)
history $displaylines   # Display history
while true;do
  if [ "${displaylines//[0-9]/}" ];then break;fi # If it contains non-integer characters.
  read -ep "Lines to delete (e.g. 67-89 45 103- ) or enter nothing to quit: " numbers
  if ! [ "$numbers" ];then break;fi     # exit if nothing entered
  numbers="$numbers "                   # Append a space to the line number list
  numbers=${numbers//- /-$lastlinenum } # e.g change '23- ' to '23-lastlinenumber '
  numbers=$(echo $numbers)              # Remove unnecessary spaces

  # Check the entered number list is valid:
  errors=$(echo "${numbers// /
}"|while read line;do
   # [ "not just digits and -" OR "more than one -" OR "starts with -" ] && echo 'error'
     [  "${line//[0-9-]/}" -o  "${line%%*-*-*}" = '' -o "${line:0:1}" = '-' ] && echo 'error'
   done)
  if [ "$errors"  ];then echo "Bad line number list, try again:";continue;fi

  # Expand line ranges n-m to a list of individual line numbers
  numbers=$(echo "${numbers// /
}" | while read line;do
       if [ "${line#*-}" != "$line" ];then # Found a line containing '-'  (a range 'n-m')
         n=${line%-*}
         m=${line#*-}
         if [ $n -lt $m ];then line="$m-$n";fi # Descending order for faster reverse sorting
         line="{${line/-/..}}"  # Change 'n-m' to '{n..m}'
       fi
       eval echo $line  # '{n..m}' will be expanded to a list of numbers (brace expansion)
     done)
  a=( $numbers ) # Put line numbers into an array for reverse unique sorting
  sorted="no"
  while [ "$sorted" = "no" ];do
    unset sorted
    for ((i=0;i<${#a[@]}-1;i++));do
      if (( ${a[i]} < ${a[i+1]} ));then  # Sort by comparing/swapping adjacent elements
        tmp=${a[i]}
        a[i]=${a[i+1]}
        a[i+1]=$tmp
        sorted="no"
      fi
    done
  done
  for ((i=0;i<${#a[@]}-1;i++));do # Remove duplicate line numbers from the sorted array
    if (( ${a[i]} == ${a[i+1]} ));then
      a[i]=
    fi
  done
  a=( ${a[@]} ) # Remove empty array elements created by removing duplicates
  i=${#a[@]}    # Number of array elements
  # Check that the reverse sorted list is in the range  $lastlinenum to 1
  if [ ${a[0]} -gt $lastlinenum -o ${a[i-1]} -lt 1 ];then
    echo "Line number list is out of range, try again:"
    continue
  fi
  echo "Deleting these lines from the above history: ${a[@]}"
  echo "***********************************************************************"
  for ((i=0;i<${#a[@]};i++));do
    a[i]="history -d${a[i]};"  # Create the delete commands e.g. history -d67; ....
  done
  eval ${a[@]}                     # Execute all the 'history -d' commands
  lastline=$(echo $(history 1))    # New last line, with leading spaces removed
  lastlinenum=${lastline%%[* ]*}   # Extract the line number from the new last line
  history $displaylines            # Refresh the displayed history
done
unset a errors i lastline lastlinenum line numbers sorted tmp # Finished; tidy up

Thursday 26 January 2012

Adding open source applications to your AIX system

Adding open source applications to your AIX system 

Options for installing open source applications from the AIX Toolbox for Linux Applications media.

Things to consider 

The information in this how-to scenario was tested using specific versions of AIX. The results you obtain might vary significantly depending on your version and level of AIX. 

The AIX Toolbox for Linux Applications media that is shipped with your base operating system

software contains the most commonly used open source applications that you can use with the AIX operating system. Your options for installing from this media include: 

  • Using the SMIT install_software fast path to install RPM packages from the AIX Toolbox for Linux Applications media. 
  • Using the geninstall command to install RPM packages from the AIX Toolbox for Linux Applications media. 
  • Installing a bundle. Bundles group the applications you need for a basic Linux operating environment, basic desktop use, GNOME or KDE desktop use, or application development. 
  • Installing from a directory of packages classified by function. These directory groupings cover a broad range of applications, shell environments, network applications, development tools, application libraries, and so on. 
  • Installing a single package for a particular application. 

The following procedures provide examples of installing RPM packages from AIX Toolbox for Linux Applications media. 

  • To install the cdrecord and mtools RPM packages using SMIT, do the following: 
  1. Run the SMIT install_software fast path. 
  2. Enter the device name for the AIX Toolbox for Linux Applications media (for example, /dev/cd0), and press Enter. 
  3. Use the F4 key to list the contents of the device. 
  4. Select the cdrecord and mtools packages, and press Enter. 
  5. Accept the default values for the rest of the Install Software menu fields, and press Enter. 
  6. Confirm that you do want to install the software, and press Enter. 

The software installation process begins at this point. 

  • To install the cdrecord and mtools RPM packages from the command line, type the following: 

           # geninstall -d/dev/cd0 R:cdrecord R:mtools

The software installation process begins at this point. 

  • Use the rpm command, which is automatically installed with the base operating system for AIX, to install the bundles required for the GNOME desktop and the bc application package. Complete instructions are available on the readme file for the AIX Toolbox for Linux Applications. 
  1. With your system powered on and AIX running, insert the AIX Toolbox for Linux Applications media into the media drive of your system. 
  2. With root authority, mount the media drive using the following command: 

mount -vcdrfs -oro /dev/cd0 /mnt

The -v flag specifies the virtual file system type of cdrfs. The -o flag specifies the ro option, which means the mounted file is read-only. The device name is /dev/cd0. The directory in which you want to mount the media drive is /mnt. 

    3. Change to the /mnt directory by using the following command:

cd /mnt 

    4. Use the ls command to list the contents of the media. The listing contains the following, which you can view or print: 

  • The readme file contains complete instructions for installing from this media. 
  • The CONTENTS file lists all packages available on this media and provides a short description of the purpose for each package. 
   5. In your Web browser, open the /mnt/LICENSES/index.html file to view software licensing information. 

   6. In your terminal window, change to the ezinstall/ppc directory by using the following command:

cd /mnt/ezinstall/ppc

In the next step, you use the rpm program to install GNOME by installing four bundles (Base, Desktop Base, GNOME Base, and GNOME Apps). Alternatively, you can install all necessary packages using the smit install_bundle fast path and selecting the GNOME bundle.

7. Install GNOME by using the following sequence of commands:

8. rpm -Uhv ezinstall/ppc/base/*

9. rpm -Uhv ezinstall/ppc/desktop.base/*

10.rpm -Uhv ezinstall/ppc/gnome.base/*

rpm -Uhv ezinstall/ppc/gnome.apps/*

The -U flag updates any earlier versions of each package that you might have on your system. The -h flag prints hash marks (#) at timed intervals to indicate that the installation is progressing. The -v flag displays relevant informational or error messages that occur during the installation. Your result will look similar to the following:

rpm -Uhv ezinstall/ppc/desktop.base/*

gdbm ##################################################

libjpeg ##################################################

libpng ##################################################

libtiff ##################################################

libungif ##################################################

readline ##################################################

zlib ##################################################

If your rpm command returns an error, it is probably caused by one of the following:
  • Not enough space in your current file system. Resize the file system or change your mount point. 
  • Package is already installed. The rpm program discovered an existing package of the same name and version level, so it did not replace the package. A script on the media installs only those packages from a directory that are not already installed on your system, as shown in the following example: 

/mnt/contrib/installmissing.sh ezinstall/ppc/desktop.base/*
  • Failed dependencies. The packages listed in the error message must be installed before you can install this package or bundle. 
Install the bc application package by using the following command:

rpm -Uhv RPMS/ppc/bc-*.rpm

Configure TCP/IP on Your AIX System


Configure TCP/IP on Your AIX System

Summary: 

With AIX, you can configure your TCP/IP network with a single command, mktcpip. On other systems, setting up TCP/IP might involve creating and editing multiple files, executing a number of commands, setting various variables, locating values for persistence after reboot, and starting several daemons. The mktcpip command completes all the necessary TCP/IP configuration tasks for a typical system. The process is even easier when you
use the System Management Interface Tool (SMIT) to prompt you for all necessary parameters to configure your network 


Configuring TCP/IP is easiest when you use SMIT. On the command line, type the following fast path:

smitty mktcpip

If you prefer the command line approach, you can specify all the necessary parameters in a single instruction, as shown in the following example:

mktcpip -h server1 -a 10.47.1.3 -m 255.255.0.0 -i en0  -n 9.3.240.2 -d itsc.austin.ibm.com -g 9.3.240.1 -s -C 0 –A no

If you prefer a more graphical interface, you can use the Web-based System Manager tool to complete this task. This tool uses icons, windows, and wizards to guide you through the configuration. To start this interface, type the following on the command line:

Wsm

If you want to further configure your network, for example, if you want to select more than one interface type, SMIT has an easy interface for that, too. On the command line, type:

smitty configtcp

Naming Conventions for Your Network Devices and Interfaces

When you install AIX, it automatically detects each adapter card and installs the corresponding interface software. AIX uses the following naming convention for network devices and interfaces:

Device Type
Device Name
Interface Name
Asynchronous Transfer Mode(ATM)
atm#
at#
Ethernet (IEEE 802.3)
ent#
et#
Ethernet (Standard, Version 2)
ent#
en#
Fiber Distributed Data Interface (FDDI)
fddi#
fi#
Loopback
N/A
lo#
Token-ring
tok#
tr#


The # sign represents the number of the device or interface you intend to use.

Name Services

If you use name services, you can provide the minimal information needed through the mktcpip command. Typically, the /etc/resolv.conf file stores your domain name and name server IP address. The mktcpip command creates or updates the /etc/resolv.conf file for you. By default, the resolver routines on hosts running TCP/IP use the following lookup sequence:

1. Domain Name Server (DNS)
2. Network Information Service (NIS or NIS+), if active
3. Local /etc/hosts file

But you can override the default lookup by editing the /etc/netsvc.conf file. Also, you can set the NSORDER environment variable to override the host settings in the /etc/netsvc.conf file.

Gateways

A machine can communicate to the network through a gateway. A gateway contains the addressing and routing information for each host on its network, and can use routing daemons to broadcast routing information to, and receive routing information from, other gateways. TCP/IP routes information to the appropriate computer on the network using address information carried in a packet or stream of information. AIX version 5.0 allows a host to discover if one of its gateways is down (called dead gateway detection) and, if so, choose a backup gateway, if one has been configured. Dead gateway detection can be passive (the default) or active.

·         In passive mode, a host looks for an alternate gateway when normal TCP or ARP requests notice the gateway is not responding. Passive mode provides a best effortservice and requires very little overhead, but there may be a lag of several minutes before a dead gateway is noticed.
·         In active mode, the host periodically pings the gateways. If a gateway fails to
respond to several consecutive pings, the host chooses an alternate gateway. Active mode incurs added overhead, but maintains high availability for your network.

In either mode, the host chooses the alternate gateway with the lowest associated cost value. You determine the cost value, using any criteria you wish, when configuring TCP/IP. The value can be any number from 0 (the default) to 2147482647.

TCP/IP Subsystems

The mktcpip command runs a shell script called rc.tcpip to start the TCP/IP daemons for your configuration. The script contains start stanzas for the following daemons:

autoconf6, ndpd-host            Internet Protocol version 6 (IPv6)
dhcpcd, dhcprd,
dhrcpsd
          Dynamic Host Control Protocol (DHCP) daemons

inetd                                      Internet daemon that starts related services such as telnet and ftp
lpd                                         Print server daemon
mrouted                                 Multicast routing daemon
named                                    Domain name server in a domain network
portmap                                 Port lookup facility used for remote procedure calls (RPCs)
routed or gated                      Dynamic routing (both daemons cannot run simultaneously)
rwhod                                    Remote uptime and users daemon
sendmail                                 Mail transfer agent
snmpd, dpid2                         Simple network management protocol (SNMP) daemons
syslog                                     Log server for standard UNIX error logs
timed, xntpd                          Time synchronization daemons

By default, the script starts the syslogd, portmap, inetd, lpd, and Sendmail daemons and puts their entries into the /etc/inittab file so the subsystems begin automatically after every reboot. To automatically start any of the other listed daemons, simply uncomment their corresponding lines in the rc.tcpip file. You can add start stanzas for other daemons, too.


Configuration, Status, and Troubleshooting Commands
lsdev -Cc adapter and
List system adapters and IP interfaces
lsdev -Cc if
netstat -in
 Show status of IP interfaces with numeric addresses
netstat -rn
Show status of TCP/IP routes with numeric addresses
arp -a
Display local ARP cache
no -a and no -o
Display/set kernel variable values, such as ipforwarding
ifconfig and route
Display status and configure temporarily
mkdev (chdev, rmdev, etc.) and SMIT
Configure permanently
lsattr -El
Display ODM database attributes for the specified interface or adapter
nslookup
Troubleshoot DNS
host
 Resolve host name to IP address and vice versa
hostname
Display current local host name




System Files
/etc/hosts
Local hosts table
/etc/rc.*
Scripts for TCP/IP, NFS, and so forth
/etc/resolv.conf
Name resolver
/etc/netsvc.conf
Name resolution order
/usr/sample/tcpip/named.*
Sample files that can be copied and edited
/etc/named.*
DNS resolution files
/etc/hosts.equiv,
Remote user access files
/etc/rhosts, and /etc/hosts.lpd


Twitter Bird Gadget