Sometimes we have problems to reach remote systems due to a misconfiguration of the default gateway or static routes:
How to check the AIX Ethernet adapter and gateway used to reach the remote system?
For example, my LPAR has the following network configuration:
lpar_aix(root):/>ifconfig -a
Management Network
en4: flags=5e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),PSEG,LARGESEND,CHAIN>
inet 192.168.198.128 netmask 0xffffff00 broadcast 192.168.198.255
tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 0
Backup Network
en6: flags=1e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
inet 192.168.197.13 netmask 0xffffff00 broadcast 192.168.197.255
tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 0
lo0: flags=e08084b<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT>
inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
inet6 ::1/0
tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1
The target production host has the following network configuration:
- Production Network 192.168.125.148
- Management Network 192.168.198.138
- Backup Network 192.168.197.22
What is the network interface that will use our LPAR to reach the Production Network 192.168.125.148?
lpar_aix(root):/>route get 192.168.125.148
route to: lpar_prod.intranet.lab.es
destination: default
mask: default
gateway: 192.168.198.13 <-- Gateway used to reach the 192.168.125.148 host
interface: en4 <-- Ethernet Adapter used to reach the network 192.168.125.xxx
interf addr: lpar_aix.intranet.lab.es
flags: <UP,GATEWAY,DONE>
recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
0 0 0 0 0 0 0 52
What is the network interface that will use our LPAR to reach the Management Network 192.168.198.138?
lpar_aix(root):/>route get 192.168.198.138
route to: lpar_prod_manag.intranet.lab.es
destination: 192.168.198.0 <-- The source and destination IP are on the same network
mask: 255.255.255.0 <-- Subnet Mask of the network
interface: en4 <-- Ethernet Adapter used to reach the network 192.168.198.xxx
interf addr: lpar_aix.intranet.lab.es
flags: <UP,DONE>
recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
0 0 0 438 375 0 0 60
Note: Pay attention to the “gateway” field does not appear, since the EN4 interface is in the same network as the IP destination to reach.
What is the network interface that will use our LPAR to reach the Backup Network 192.168.197.22?
lpar_aix(root):/>route get 192.168.197.22
route to: lpar_prod_bck.intranet.lab.es
destination: 192.168.197.0 <-- The source and destination IP are on the same network
mask: 255.255.255.0 <-- Subnet Mask of the network
interface: en6 <-- Ethernet Adapter used to reach the network 192.168.197.xxx
interf addr: lpar_aix_bck.intranet.lab.es
flags: <UP,DONE>
recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
0 0 0 438 375 0 0 60
Note: Pay attention to the “gateway” field does not appear, since the EN6 interface is in the same network as the IP destination to reach.
I hope you like it!