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
AIX routing - How Do I Compare ODM with the Current Routing Table?
Viewed 2941 times since Mon, Jul 29, 2019
Part 3, Monitoring your network packets and tuning the network
Viewed 6216 times since Mon, Jun 4, 2018
AIX 7.2 running on my Macbook?
Viewed 12922 times since Mon, Jun 3, 2019
SNAP in AIX
Viewed 11917 times since Mon, Sep 17, 2018
AIX: Error code 0516-1339, 0516-1397 0516-792: cannot extendvg with a previous Oracle ASM disk
Viewed 4033 times since Wed, Feb 6, 2019
replacing (hot-swap) failed disk in rootvg
Viewed 9463 times since Thu, Sep 20, 2018
SSH-COPY-ID on AIX. SSH remote AIX’s box without password
Viewed 17802 times since Thu, Feb 21, 2019
IBM AIX multipath I/O (MPIO) resiliency and problem determination
Viewed 14112 times since Wed, May 30, 2018
AIX NFS Version 4 configuration over Kerberos inter-realm setup
Viewed 4415 times since Wed, Jun 27, 2018
AIX Undocumented AIX command lquerypv
Viewed 3889 times since Tue, Jul 17, 2018