xref: /freebsd/contrib/libpcap/doc/README.hpux (revision 6f9cba8f)
157e22627SCy SchubertFor HP-UX 11i (11.11) and later, there are no known issues with
257e22627SCy Schubertpromiscuous mode under HP-UX.  If you are using a earlier version of
357e22627SCy SchubertHP-UX and cannot upgrade, please continue reading.
457e22627SCy Schubert
557e22627SCy SchubertHP-UX patches to fix packet capture problems
657e22627SCy Schubert
757e22627SCy SchubertNote that packet-capture programs such as tcpdump may, on HP-UX, not be
857e22627SCy Schubertable to see packets sent from the machine on which they're running.
957e22627SCy SchubertSome articles on groups.google.com discussing this are:
1057e22627SCy Schubert
11*6f9cba8fSJoseph Mingrone	https://groups.google.com/groups?selm=82ld3v%2480i%241%40mamenchi.zrz.TU-Berlin.DE
1257e22627SCy Schubert
1357e22627SCy Schubertwhich says:
1457e22627SCy Schubert
1557e22627SCy Schubert  Newsgroups: comp.sys.hp.hpux
1657e22627SCy Schubert  Subject:  Re: Did someone made tcpdump working on 10.20 ?
1757e22627SCy Schubert  Date: 12/08/1999
1857e22627SCy Schubert  From: Lutz Jaenicke <jaenicke@emserv1.ee.TU-Berlin.DE>
1957e22627SCy Schubert
2057e22627SCy Schubert  In article <82ks5i$5vc$1@news1.dti.ne.jp>, mtsat <mtsat@iris.dti.ne.jp>
2157e22627SCy Schubert  wrote:
2257e22627SCy Schubert   >Hello,
2357e22627SCy Schubert   >
2457e22627SCy Schubert   >I downloaded and compiled tcpdump3.4 a couple of week ago. I tried to use
2557e22627SCy Schubert   >it, but I can only see incoming data, never outgoing.
2657e22627SCy Schubert   >Someone (raj) explained me that a patch was missing, and that this patch
2757e22627SCy Schubert   >must me "patched" (poked) in order to see outbound data in promiscuous mode.
2857e22627SCy Schubert   >Many things to do .... So the question is : did someone has already this
2957e22627SCy Schubert   >"ready to use" PHNE_**** patch ?
3057e22627SCy Schubert
3157e22627SCy Schubert   Two things:
3257e22627SCy Schubert   1. You do need a late "LAN products cumulative patch" (e.g.  PHNE_18173
3357e22627SCy Schubert  for   s700/10.20).
3457e22627SCy Schubert   2. You must use
3557e22627SCy Schubertecho 'lanc_outbound_promisc_flag/W1' | /usr/bin/adb -w /stand/vmunix /dev/kmem
3657e22627SCy Schubert     You can insert this e.g. into /sbin/init.d/lan
3757e22627SCy Schubert
3857e22627SCy Schubert   Best regards,
3957e22627SCy Schubert   Lutz
4057e22627SCy Schubert
4157e22627SCy Schubertand
4257e22627SCy Schubert
4357e22627SCy Schubert	http://groups.google.com/groups?selm=88cf4t%24p03%241%40web1.cup.hp.com
4457e22627SCy Schubert
4557e22627SCy Schubertwhich says:
4657e22627SCy Schubert
4757e22627SCy Schubert  Newsgroups: comp.sys.hp.hpux
4857e22627SCy Schubert  Subject: Re: tcpdump only shows incoming packets
4957e22627SCy Schubert  Date: 02/15/2000
5057e22627SCy Schubert  From: Rick Jones <foo@bar.baz.invalid>
5157e22627SCy Schubert
5257e22627SCy Schubert  Harald Skotnes <harald@cc.uit.no> wrote:
5357e22627SCy Schubert  > I am running HPUX 11.0 on a C200 hanging on a 100Mb switch. I have
5457e22627SCy Schubert  > compiled libpcap-0.4 an tcpdump-3.4 and it seems to work. But at a
5557e22627SCy Schubert  > closer look I only get to see the incoming packets not the
5657e22627SCy Schubert  > outgoing. I have tried tcpflow-0.12 which also uses libpcap and the
5757e22627SCy Schubert  > same thing happens.  Could someone please give me a hint on how to
5857e22627SCy Schubert  > get this right?
5957e22627SCy Schubert
6057e22627SCy Schubert  Search/Read the archives ?-)
6157e22627SCy Schubert
6257e22627SCy Schubert  What you are seeing is expected, un-patched, behaviour for an HP-UX
6357e22627SCy Schubert  system.  On 11.00, you need to install the latest lancommon/DLPI
6457e22627SCy Schubert  patches, and then the latest driver patch for the interface(s) in use.
6557e22627SCy Schubert  At that point, a miracle happens and you should start seeing outbound
6657e22627SCy Schubert  traffic.
6757e22627SCy Schubert
6857e22627SCy Schubert[That article also mentions the patch that appears below.]
6957e22627SCy Schubert
7057e22627SCy Schubertand
7157e22627SCy Schubert
72*6f9cba8fSJoseph Mingrone	https://groups.google.com/groups?selm=38AA973E.96BE7DF7%40cc.uit.no
7357e22627SCy Schubert
7457e22627SCy Schubertwhich says:
7557e22627SCy Schubert
7657e22627SCy Schubert  Newsgroups: comp.sys.hp.hpux
7757e22627SCy Schubert  Subject: Re: tcpdump only shows incoming packets
7857e22627SCy Schubert  Date: 02/16/2000
7957e22627SCy Schubert  From: Harald Skotnes <harald@cc.uit.no>
8057e22627SCy Schubert
8157e22627SCy Schubert  Rick Jones wrote:
8257e22627SCy Schubert
8357e22627SCy Schubert	...
8457e22627SCy Schubert
8557e22627SCy Schubert  > What you are seeing is expected, un-patched, behaviour for an HP-UX
8657e22627SCy Schubert  > system. On 11.00, you need to install the latest lancommon/DLPI
8757e22627SCy Schubert  > patches, and then the latest driver patch for the interface(s) in
8857e22627SCy Schubert  > use. At that point, a miracle happens and you should start seeing
8957e22627SCy Schubert  > outbound traffic.
9057e22627SCy Schubert
9157e22627SCy Schubert  Thanks a lot.  I have this problem on several machines running HPUX
9257e22627SCy Schubert  10.20 and 11.00.  The machines where patched up before y2k so did not
9357e22627SCy Schubert  know what to think.  Anyway I have now installed PHNE_19766,
9457e22627SCy Schubert  PHNE_19826, PHNE_20008, PHNE_20735 on the C200 and now I can see the
9557e22627SCy Schubert  outbound traffic too.  Thanks again.
9657e22627SCy Schubert
9757e22627SCy Schubert(although those patches may not be the ones to install - there may be
9857e22627SCy Schubertlater patches).
9957e22627SCy Schubert
10057e22627SCy SchubertAnd another message to tcpdump-workers@tcpdump.org, from Rick Jones:
10157e22627SCy Schubert
10257e22627SCy Schubert  Date: Mon, 29 Apr 2002 15:59:55 -0700
10357e22627SCy Schubert  From: Rick Jones
10457e22627SCy Schubert  To: tcpdump-workers@tcpdump.org
10557e22627SCy Schubert  Subject: Re: [tcpdump-workers] I Can't Capture the Outbound Traffic
10657e22627SCy Schubert
10757e22627SCy Schubert	...
10857e22627SCy Schubert
10957e22627SCy Schubert  http://itrc.hp.com/ would be one place to start in a search for the most
11057e22627SCy Schubert  up-to-date patches for DLPI and the lan driver(s) used on your system (I
11157e22627SCy Schubert  cannot guess because 9000/800 is too generic - one hs to use the "model"
11257e22627SCy Schubert  command these days and/or an ioscan command (see manpage) to guess what
11357e22627SCy Schubert  the drivers (btlan[3456], gelan, etc) might be involved in addition to
11457e22627SCy Schubert  DLPI.
11557e22627SCy Schubert
11657e22627SCy Schubert  Another option is to upgrade to 11i as outbound promiscuous mode support
11757e22627SCy Schubert  is there in the base OS, no patches required.
11857e22627SCy Schubert
11957e22627SCy SchubertAnother posting:
12057e22627SCy Schubert
121*6f9cba8fSJoseph Mingrone	https://groups.google.com/groups?selm=7d6gvn%24b3%241%40ocean.cup.hp.com
12257e22627SCy Schubert
12357e22627SCy Schubertindicates that you need to install the optional STREAMS product to do
12457e22627SCy Schubertcaptures on HP-UX 9.x:
12557e22627SCy Schubert
12657e22627SCy Schubert  Newsgroups: comp.sys.hp.hpux
12757e22627SCy Schubert  Subject:  Re: tcpdump HP/UX 9.x
12857e22627SCy Schubert  Date: 03/22/1999
12957e22627SCy Schubert  From: Rick Jones <foo@bar.baz>
13057e22627SCy Schubert
13157e22627SCy Schubert  Dave Barr (barr@cis.ohio-state.edu) wrote:
13257e22627SCy Schubert  : Has anyone ported tcpdump (or something similar) to HP/UX 9.x?
13357e22627SCy Schubert
13457e22627SCy Schubert  I'm reasonably confident that any port of tcpdump to 9.X would require
13557e22627SCy Schubert  the (then optional) STREAMS product.  This would bring DLPI, which is
13657e22627SCy Schubert  what one uses to access interfaces in promiscuous mode.
13757e22627SCy Schubert
13857e22627SCy Schubert  I'm not sure that HP even sells the 9.X STREAMS product any longer,
13957e22627SCy Schubert  since HP-UX 9.X is off the pricelist (well, maybe 9.10 for the old 68K
14057e22627SCy Schubert  devices).
14157e22627SCy Schubert
14257e22627SCy Schubert  Your best bet is to be up on 10.20 or better if that is at all
14357e22627SCy Schubert  possible.  If your hardware is supported by it, I'd go with HP-UX 11.
14457e22627SCy Schubert  If you want to see the system's own outbound traffic, you'll never get
14557e22627SCy Schubert  that functionality on 9.X, but it might happen at some point for 10.20
14657e22627SCy Schubert  and 11.X.
14757e22627SCy Schubert
14857e22627SCy Schubert  rick jones
14957e22627SCy Schubert
15057e22627SCy Schubert(as per other messages cited here, the ability to see the system's own
15157e22627SCy Schubertoutbound traffic did happen).
15257e22627SCy Schubert
15357e22627SCy SchubertRick Jones reports that HP-UX 11i needs no patches for outbound
15457e22627SCy Schubertpromiscuous mode support.
15557e22627SCy Schubert
15657e22627SCy SchubertAn additional note, from Jost Martin, for HP-UX 10.20:
15757e22627SCy Schubert
15857e22627SCy Schubert	Q: How do I get ethereral on HPUX to capture the _outgoing_ packets
15957e22627SCy Schubert	   of an interface
16057e22627SCy Schubert	A: You need to get PHNE_20892,PHNE_20725 and PHCO_10947 (or
16157e22627SCy Schubert	   newer, this is as of 4.4.00) and its dependencies.  Then you can
162*6f9cba8fSJoseph Mingrone	   enable the feature as described below:
16357e22627SCy Schubert
16457e22627SCy Schubert	Patch Name: PHNE_20892
16557e22627SCy Schubert	Patch Description: s700 10.20 PCI 100Base-T cumulative patch
16657e22627SCy Schubert		To trace the outbound packets, please do the following
16757e22627SCy Schubert		to turn on a global promiscuous switch before running
16857e22627SCy Schubert		the promiscuous applications like snoop or tcpdump:
16957e22627SCy Schubert
17057e22627SCy Schubert		adb -w /stand/vmunix /dev/mem
17157e22627SCy Schubert		lanc_outbound_promisc_flag/W 1
17257e22627SCy Schubert		(adb will echo the result showing that the flag has
17357e22627SCy Schubert		been changed)
17457e22627SCy Schubert		$quit
17557e22627SCy Schubert	(Thanks for this part to HP-support, Ratingen)
17657e22627SCy Schubert
17757e22627SCy Schubert		The attached hack does this and some security-related stuff
17857e22627SCy Schubert	(thanks to hildeb@www.stahl.bau.tu-bs.de (Ralf Hildebrandt) who
17957e22627SCy Schubert	posted the security-part some time ago)
18057e22627SCy Schubert
18157e22627SCy Schubert		 <<hack_ip_stack>>
18257e22627SCy Schubert
18357e22627SCy Schubert		(Don't switch IP-forwarding off, if you need it !)
18457e22627SCy Schubert		Install the hack as /sbin/init.d/hacl_ip_stack (adjust
18557e22627SCy Schubert	permissions !) and make a sequencing-symlink
18657e22627SCy Schubert	/sbin/rc2.d/S350hack_ip_stack pointing to this script.
18757e22627SCy Schubert		Now all this is done on every reboot.
18857e22627SCy Schubert
18957e22627SCy SchubertAccording to Rick Jones, the global promiscuous switch also has to be
19057e22627SCy Schubertturned on for HP-UX 11.00, but not for 11i - and, in fact, the switch
19157e22627SCy Schubertdoesn't even exist on 11i.
19257e22627SCy Schubert
19357e22627SCy SchubertHere's the "hack_ip_stack" script:
19457e22627SCy Schubert
19557e22627SCy Schubert-----------------------------------Cut Here-------------------------------------
19657e22627SCy Schubert#!/sbin/sh
19757e22627SCy Schubert#
198*6f9cba8fSJoseph Mingrone# nettune:  hack kernel params for safety
19957e22627SCy Schubert
20057e22627SCy SchubertOKAY=0
20157e22627SCy SchubertERROR=-1
20257e22627SCy Schubert
20357e22627SCy Schubert# /usr/contrib/bin fuer nettune auf Pfad
20457e22627SCy SchubertPATH=/sbin:/usr/sbin:/usr/bin:/usr/contrib/bin
20557e22627SCy Schubertexport PATH
20657e22627SCy Schubert
20757e22627SCy Schubert
20857e22627SCy Schubert##########
20957e22627SCy Schubert#  main  #
21057e22627SCy Schubert##########
21157e22627SCy Schubert
21257e22627SCy Schubertcase $1 in
21357e22627SCy Schubert   start_msg)
21457e22627SCy Schubert      print "Tune IP-Stack for security"
21557e22627SCy Schubert      exit $OKAY
21657e22627SCy Schubert      ;;
21757e22627SCy Schubert
21857e22627SCy Schubert   stop_msg)
21957e22627SCy Schubert      print "This action is not applicable"
22057e22627SCy Schubert      exit $OKAY
22157e22627SCy Schubert      ;;
22257e22627SCy Schubert
22357e22627SCy Schubert   stop)
22457e22627SCy Schubert      exit $OKAY
22557e22627SCy Schubert      ;;
22657e22627SCy Schubert
22757e22627SCy Schubert   start)
22857e22627SCy Schubert      ;;  # fall through
22957e22627SCy Schubert
23057e22627SCy Schubert   *)
23157e22627SCy Schubert      print "USAGE: $0 {start_msg | stop_msg | start | stop}" >&2
23257e22627SCy Schubert      exit $ERROR
23357e22627SCy Schubert      ;;
23457e22627SCy Schubert   esac
23557e22627SCy Schubert
23657e22627SCy Schubert###########
23757e22627SCy Schubert#  start  #
23857e22627SCy Schubert###########
23957e22627SCy Schubert
24057e22627SCy Schubert#
24157e22627SCy Schubert# tcp-Sequence-Numbers nicht mehr inkrementieren sondern random
24257e22627SCy Schubert# Syn-Flood-Protection an
24357e22627SCy Schubert# ip_forwarding aus
24457e22627SCy Schubert# Source-Routing aus
24557e22627SCy Schubert# Ausgehende Packets an ethereal/tcpdump etc.
24657e22627SCy Schubert
24757e22627SCy Schubert/usr/contrib/bin/nettune -s tcp_random_seq 2 || exit $ERROR
24857e22627SCy Schubert/usr/contrib/bin/nettune -s hp_syn_protect 1 || exit $ERROR
24957e22627SCy Schubert/usr/contrib/bin/nettune -s ip_forwarding 0 || exit $ERROR
25057e22627SCy Schubertecho 'ip_block_source_routed/W1' | /usr/bin/adb -w /stand/vmunix /dev/kmem || exit $ERROR
25157e22627SCy Schubertecho 'lanc_outbound_promisc_flag/W 1' | adb -w /stand/vmunix /dev/mem  || exit $ERROR
25257e22627SCy Schubert
25357e22627SCy Schubertexit $OKAY
25457e22627SCy Schubert-----------------------------------Cut Here-------------------------------------
255