Archive

Monthly Archives: April 2012

Using the rendev command is it possible to change the name of a device such as a hdisk or an ent adapter. The new desired name must NOT exist in the system. If you are renaming an active device beware that the rendev command will uncofigure the device using rmdev -dl before the name will be changed. Also if you are renaming a ent adapter make sure you are not connected to the system using the ent adapter you are attempting to rename. After a name change on a ent adapter it might be nacessary to run cfgmgr.

          Device to be renamed
          |  
# rendev -l hdisk4 -n hdisk44
hdisk44             |
                    New device name

Here are some TCP/IP related commands, might be usefull.
Generally by using ifconfig and route commands your settings will not be preserved after the reboot, because the settings will not be stored in the ODM.
So to make the settings persistent across reboots use mktcpip or chdev for IP configuration and for the routing table smit route, /etc/rc.net or chdev

List routes stored in ODM

# odmget -q "attribute=route" CuAt

View curent routing table

# netstat -rn

Delete default route (persistent)

# chdev -l inet0 -a delroute=net,-hopcount,0,,0,192.168.2.2

Define default route (persistent)

# chdev -l inet0 -a route=net,-hopcount,0,,0,192.168.2.1

Lookup route information

# route get 

To permanently assign a IP to the en1 interface:

# chdev -l en1 -a netaddr=192.168.2.98 -a netmask=255.255.255.0

The following command sets the IP configuration on the specified adpter, adds an entry into /etc/hosts, and adds a static route to the routing table.

                  | Hostname           
# mktcpip -i en2 -h power1 -g 192.168.2.2 -a 192.168.4.6 -m 255.255.255.0
           |                |              |              |
           Interface        Gateway        Address        Netmask

View inet0 configuration

# lsattr -El inet0

To create a persistent IP alias:

         Interface name
         | 
# chdev -l en0 -a alias4=192.168.4.77,255.255.255.0
en0 changed     |
                Attribute

To permanently remove an IP alias

         Interface name     IP and netmask as shwon in `lsattr -El en0`
         |                  | 
# chdev -l en0 -a delalias4=192.168.2.77,255.255.255.0
en0 changed     |
                Attribute

Media link speed for the en0 interface

# entstat -d en0 | grep "Media Speed"

Show all listening ports

netstat -anf inet | grep LISTEN

Show domain name server settings

# namerslv -s

This post will describe how to define on a AIX NFS server a pseudo-root and mount it form a client. The pseudo-root will be changes from / to /exports

First check the current settings

# nfsd -getnodes
#root:public
/:/

Unexport the currently exported filesystems:

# exportfs -ua

Define pseudo-root in /etc/exports.

# cat /etc/exports
/exports -nfsroot
/fixes -vers=4,rw,access=cosmos,exname=/exports/fixes
/home  -vers=4,rw,access=cosmos,exname=/exports/home
/LP    -vers=4,rw,access=cosmos,exname=/exports/LP

-vers=4    This option exports the share using the NFSv4 protocol
rw            Read/write
exname    Export as the specified external name beginning with nfsroot
access     Access restriction, to mount the FS only by the specified hostname.

Now export the NFS exports and check the current nfsroot:

# exportfs -a
# nfsd -getnodes
#root:public
/exports:/exports

Now we can on the client mount all the exported dir’s using one command /mount request:

# mount -o vers=4 power1:/ /mi
# ls /mi
fixes  home  LP