• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Using iptrace command in AIX

by admin

iptrace is a utility for recording Internet packets received from configured interfaces. You can provide a filter to capture only important network data. You can only trace data between local and remote host (not between two remote hosts). The iptrace utility runs as a daemon, and you must stop it with the kill command. The trace data is written to a file, which can then be processed with the ipreport command. The syntax for the iptrace utility is:

# iptrace [ flags ] LogFile

You can use any combination of these options, but you do not need to use them all:

  • -a: This suppresses ARP packets.
  • -s: [source IP] Limit trace to source/client IP address, if known.
  • -d: [destination IP] Limit trace to destination IP, if known.
  • -b: Capture bidirectional network traffic (send and receive packets).
  • -p [port]: Specify the port to be traced.
  • -i [interface]: Only trace for network traffic on a specific interface.
  • -b: This changes -s or -d to bidirectional mode.
  • -e: This enables promiscuous mode on network adapters that support this function.

Examples of iptrace Command in AIX

1. Run iptrace on AIX interface en1 to capture port 80 traffic to file trace.out from a single client IP to a server IP:

# iptrace -a -i en1 -s clientip -b -d serverip -p 80 trace.out

This trace will capture both directions of the port 80 traffic on interface en1 between the clientip and serverip and sends this to the raw file of trace.out.

2. To stop the trace:

# ps -ef|grep iptrace
# kill [PID]

3. The ipreport command can be used to transform the trace file generated by iptrace to human readable format:

# ipreport trace.out > trace.report

4. To start the iptrace daemon with the System Resource Controller (SRC), enter:

# startsrc -s iptrace -a "/tmp/nettrace"

5. To stop the iptrace daemon with SRC enter the following:

# stopsrc -s iptrace

6. To record packets coming in and going out to any host on every interface, enter the command in the following format:

# iptrace /tmp/nettrace

The recorded packets are received on and sent from the local host. All packet flow between the local host and all other hosts on any interface is recorded. The trace information is placed into the /tmp/nettrace file.

7. To record packets received on an interface from a specific remote host, enter the command in the following format:

# iptrace -i en0 -p telnet -s airmail /tmp/telnet.trace

The packets to be recorded are received on the en0 interface, from remote host airmail, over the telnet port. The trace information is placed into the /tmp/telnet.trace file.

7. To record packets coming in and going out from a specific remote host, enter the command in the following format:

# iptrace -i en0 -s airmail -b /tmp/telnet.trace

The packets to be recorded are received on the en0 interface, from remote host airmail. The trace information is placed into the /tmp/telnet.trace file.

Filed Under: AIX

Some more articles you might also be interested in …

  1. Using savevg on AIX to save time creating filesystems, LV’s and volume groups
  2. Run VIO commands from the HMC using “viosvrcmd” without VIOs Passwords
  3. Memory utilization of processes in AIX
  4. What is VIOS?
  5. vmstat output explained
  6. Backup Command Examples in AIX
  7. How to find CPU, Memory(RAM), Hard disks, IP address information in AIX
  8. AIX HMC CommandLine Reference (Cheat Sheet)
  9. Procedure to mount and unmount NFS filesystems on AIX
  10. Adding Static Routes On Various *NIX (Linux,AIX,HP-UX)

You May Also Like

Primary Sidebar

Recent Posts

  • raw: command not found
  • raw Command Examples in Linux
  • rankmirrors Command Examples in Linux
  • radeontop: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright