Networking

From Stuff!
Jump to: navigation, search

General description

In AIX the entX is the physical device. It is associated with physical layer settings such as link speed, and duplex. enX and etX determine the frame type run on entX . IP addresses are configured on enX (Standard Ethernet) or etX (802.3). Typically only enX is used. The examples here assume that the default TCP/IP configuration (rc.net) method is used. If the alternate method of using rc.bsdnet is used then some of these examples may not apply.

Determine if rc.bsdnet is used over rc.net

lsattr -El inet0 -a bootup option

TCP/IP related daemon startup script

/etc/rc.tcpip

To view the route table

netstat -r

To view the route table from the ODM DB

lsattr -EHl inet0 -a route

Temporarily add a default route

route add default 192.168.1.1

Temporarily add an address to an interface

ifconfig en0 192.168.1.2 netmask 255.255.255.0

Temporarily add an alias to an interface

ifconfig en0 192.168.1.3 netmask 255.255.255.0 alias

To permanently add an IP address to the en1 interface

chdev -l en1 -a netaddr=192.168.1.1 -a netmask=0xffffff00

Permanently add an alias to an interface

chdev -l en0 -a alias4=192.168.1.3,255.255.255.0

Remove a permanently added alias from an interface

chdev -l en0 -a delalias4=192.168.1.3,255.255.255.0

List ODM (next boot) IP configuration for interface

lsattr -El en0

Permanently set the hostname

chdev -l inet0 -a hostname=bombay

List networking devices

lsdev -Cc tcpip

List Network Interfaces

lsdev -Cc if

List attributes of inet0

lsattr -Ehl inet0

List (physical layer) attributes of ent0

lsattr -El ent0

List (networking layer) attributes of en0

lsattr -El en0

Set (desired) speed is found through the entX device

lsattr -El ent0 -a media speed

Find actual (negotiated) speed, duplex, and link

entstat -d ent0

Warning: The interface must be up (ifconfig en0 up) for stats to be valid

Set the ent0 link to Gig full duplex

chdev -l ent0 -a media speed="1000 Full Duplex" -P

Auto Negotiation is another option

Turn off Interface Specific Network Options

no -p -o use isno=0

Get (long) statistics for the ent0 device

(remove -d for shorter results)

entstat -d ent0 (or) netstat -v ent0

The results of entstat vary by device type. Virtual, physical, and IVE (LHEA) devices all produce different results.

List all open, and in use TCP and UDP ports

netstat -anf inet

List all LISTENing TCP ports

netstat -na | grep LISTEN

Remove all TCP/IP configuration from a host

rmtcpip

Flush the netcd DNS cache

netcdctrl -t dns -e hosts -f

  • Hostname lookup order is determined using /etc/irs.conf, /etc/netsvc.conf and then $NSORDER. The irs.conf and $NSORDER are typically not used.
  • IP packets can be captured using iptrace / ipreport or tcpdump.