IP configuration in AIX

IP configuration in AIX

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
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
System Admin Mirrorvg without locking the volume group
Viewed 4076 times since Mon, May 21, 2018
Part 1, The basics of network troubleshooting
Viewed 7176 times since Tue, May 22, 2018
How to check dual path in AIX
Viewed 15615 times since Fri, Jun 8, 2018
VIO Server Howto
Viewed 11730 times since Mon, Jun 11, 2018
Reconfigure RSCT ID to fix DLPAR issues on cloned AIX systems
Viewed 17562 times since Thu, Feb 21, 2019
Script to make mksysb backup from NIM to LPAR
Viewed 4465 times since Thu, Feb 21, 2019
Useful AIX general commands
Viewed 13430 times since Wed, Apr 17, 2019
AIX, user gets “pwd: The file access permissions do not allow the specified action.”
Viewed 13539 times since Tue, Mar 16, 2021
Using Shell Redirection: All About the Here-Doc
Viewed 11502 times since Wed, May 30, 2018
AIX 6/7 Script to create a file with commands to remove missing and failed paths
Viewed 5659 times since Tue, Jun 14, 2022