Question & Answer
Question
How to set up or add IP aliases to network adapters?
Answer
1) List the current network interfaces and identify the target for the alias
a. Use the netstat command:
COMMAND TO RUN:
netstat –in
Sample output:
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
en1 1500 link#2 ce.11.50.0.50.2 7405423 0 465211 0 0
en1 1500 9.3.44 9.3.44.247 7405423 0 465211 0 0
lo0 16896 link#1 2806 0 2806 0 0
lo0 16896 127 127.0.0.1 2806 0 2806 0 0
lo0 16896 ::1%1 2806 0 2806 0 0
b. Use the ifconfig command
COMMAND TO RUN:
ifconfig –a
Sample output:
en1: flags=1e080863,480<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),CHAIN>
inet 9.3.44.247 netmask 0xffffff00 broadcast 9.3.44.255
tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
lo0: flags=e08084b,c0<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
inet6 ::1%1/0
tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1
2) To maintain the changes after a reboot, it is recommended to use the SMIT menu.
COMMAND TO RUN:
smit inetalias
<select> Add an IPV4 Network Alias
<select> network interface (en1 as in example)
Populate:
* IPV4 ADDRESS (dotted decimal) [192.168.2.1]
Network MASK (hexadecimal or dotted decimal) [255.255.255.0]
<hit enter>
3) Verify the new address shows up in the netstat or ifconfig output:
a. Verify netstat output:
COMMAND TO RUN:
netstat –in
Sample output:
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
en1 1500 link#2 ce.11.50.0.50.2 7409882 0 465491 0 0
en1 1500 9.3.44 9.3.44.247 7409882 0 465491 0 0
en1 1500 192.168.2 192.168.2.1 7409882 0 465491 0 0 <- Aliased ip
lo0 16896 link#1 2806 0 2806 0 0
lo0 16896 127 127.0.0.1 2806 0 2806 0 0
lo0 16896 ::1%1 2806 0 2806 0 0
b. Verify ifconfig –a output:
COMMAND TO RUN:
ifconfig –a
You can add aliases by using the ifconfig command live to the system:
# ifconfig en1 alias 192.168.2.1 netmask 255.255.255.0
Sample output:
en1: flags=1e080863,480<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),CHAIN>
inet 9.3.44.247 netmask 0xffffff00 broadcast 9.3.44.255
inet 192.168.2.1 netmask 0xffffff00 broadcast 192.168.2.255 <- - Aliased ip
tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
lo0: flags=e08084b,c0<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
inet6 ::1%1/0
tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1
To remove Alias IP:
# smit inetalias
OR
# chdev –l enX –a delalias4=IP,subnet
- The ifconfig command also removes the alias
# ifconfig en1 –alias 192.168.2.1 netmask 255.255.255.0
[{"Product":{"code":"SWG10","label":"AIX"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Network communications","Platform":[{"code":"PF002","label":"AIX"}],"Version":"Not Applicable","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]
Was this topic helpful?
Document Information
More support for:
AIX
Software version:
Not Applicable
Operating system(s):
AIX
Document number:
634161
Modified date:
05 December 2019
UID
isg3T1027029
Manage My Notification Subscriptions