]> The Tcpdump Group git mirrors - libpcap/blob - doc/README.hpux
CI: Call print_so_deps() on rpcapd in remote enabled build
[libpcap] / doc / README.hpux
1 If you use HP-UX, you must have at least version 10.20 and either the
2 version of `cc` that supports C99 (`cc -AC99`) or else use the GNU C
3 compiler. The required DLPI streams package is standard starting with
4 HP-UX 10.
5
6 The HP implementation of DLPI is a little bit eccentric. Unlike
7 Solaris, you must attach `/dev/dlpi` instead of the specific `/dev/*`
8 network pseudo device entry in order to capture packets. The PPA is
9 based on the ifnet "index" number. Under HP-UX 10,
10 DLPI can provide information for determining the PPA. It does not seem
11 to be possible to trace the loopback interface. Unlike other DLPI
12 implementations, PHYS implies MULTI and SAP and you get an error if you
13 try to enable more than one promiscuous mode at a time.
14
15 To capture outbound packets on HP-UX 10, you will, apparently, need a
16 late "LAN products cumulative
17 patch" (at one point, it was claimed that this would be PHNE_18173 for
18 s700/10.20; at another point, it was claimed that the required patches
19 were PHNE_20892, PHNE_20725 and PHCO_10947, or newer patches), and to do
20 so on HP-UX 11 you will, apparently, need the latest lancommon/DLPI
21 patches and the latest driver patch for the interface(s) in use on HP-UX
22 11 (at one point, it was claimed that patches PHNE_19766, PHNE_19826,
23 PHNE_20008, and PHNE_20735 did the trick).
24
25 Furthermore, on HP-UX 10, you will need to turn on a kernel switch by
26 doing
27
28 echo 'lanc_outbound_promisc_flag/W 1' | adb -w /stand/vmunix /dev/mem
29
30 You would have to arrange that this happens on reboots; the right way to
31 do that would probably be to put it into an executable script file
32 `/sbin/init.d/outbound_promisc` and making
33 `/sbin/rc2.d/S350outbound_promisc` a symbolic link to that script.
34
35 Finally, testing shows that there can't be more than one simultaneous
36 DLPI user per network interface.
37
38 For HP-UX 11i (11.11) and later, there are no known issues with
39 promiscuous mode under HP-UX. If you are using a earlier version of
40 HP-UX and cannot upgrade, please continue reading.
41
42 HP-UX patches to fix packet capture problems
43
44 Note that packet-capture programs such as tcpdump may, on HP-UX, not be
45 able to see packets sent from the machine on which they're running.
46 Some articles on groups.google.com discussing this are:
47
48 https://groups.google.com/groups?selm=82ld3v%2480i%241%40mamenchi.zrz.TU-Berlin.DE
49
50 which says:
51
52 Newsgroups: comp.sys.hp.hpux
53 Subject: Re: Did someone made tcpdump working on 10.20 ?
54 Date: 12/08/1999
55 From: Lutz Jaenicke <jaenicke@emserv1.ee.TU-Berlin.DE>
56
57 In article <82ks5i$5vc$1@news1.dti.ne.jp>, mtsat <mtsat@iris.dti.ne.jp>
58 wrote:
59 >Hello,
60 >
61 >I downloaded and compiled tcpdump3.4 a couple of week ago. I tried to use
62 >it, but I can only see incoming data, never outgoing.
63 >Someone (raj) explained me that a patch was missing, and that this patch
64 >must me "patched" (poked) in order to see outbound data in promiscuous mode.
65 >Many things to do .... So the question is : did someone has already this
66 >"ready to use" PHNE_**** patch ?
67
68 Two things:
69 1. You do need a late "LAN products cumulative patch" (e.g. PHNE_18173
70 for s700/10.20).
71 2. You must use
72 echo 'lanc_outbound_promisc_flag/W1' | /usr/bin/adb -w /stand/vmunix /dev/kmem
73 You can insert this e.g. into /sbin/init.d/lan
74
75 Best regards,
76 Lutz
77
78 and
79
80 http://groups.google.com/groups?selm=88cf4t%24p03%241%40web1.cup.hp.com
81
82 which says:
83
84 Newsgroups: comp.sys.hp.hpux
85 Subject: Re: tcpdump only shows incoming packets
86 Date: 02/15/2000
87 From: Rick Jones <foo@bar.baz.invalid>
88
89 Harald Skotnes <harald@cc.uit.no> wrote:
90 > I am running HPUX 11.0 on a C200 hanging on a 100Mb switch. I have
91 > compiled libpcap-0.4 an tcpdump-3.4 and it seems to work. But at a
92 > closer look I only get to see the incoming packets not the
93 > outgoing. I have tried tcpflow-0.12 which also uses libpcap and the
94 > same thing happens. Could someone please give me a hint on how to
95 > get this right?
96
97 Search/Read the archives ?-)
98
99 What you are seeing is expected, un-patched, behaviour for an HP-UX
100 system. On 11.00, you need to install the latest lancommon/DLPI
101 patches, and then the latest driver patch for the interface(s) in use.
102 At that point, a miracle happens and you should start seeing outbound
103 traffic.
104
105 [That article also mentions the patch that appears below.]
106
107 and
108
109 https://groups.google.com/groups?selm=38AA973E.96BE7DF7%40cc.uit.no
110
111 which says:
112
113 Newsgroups: comp.sys.hp.hpux
114 Subject: Re: tcpdump only shows incoming packets
115 Date: 02/16/2000
116 From: Harald Skotnes <harald@cc.uit.no>
117
118 Rick Jones wrote:
119
120 ...
121
122 > What you are seeing is expected, un-patched, behaviour for an HP-UX
123 > system. On 11.00, you need to install the latest lancommon/DLPI
124 > patches, and then the latest driver patch for the interface(s) in
125 > use. At that point, a miracle happens and you should start seeing
126 > outbound traffic.
127
128 Thanks a lot. I have this problem on several machines running HPUX
129 10.20 and 11.00. The machines where patched up before y2k so did not
130 know what to think. Anyway I have now installed PHNE_19766,
131 PHNE_19826, PHNE_20008, PHNE_20735 on the C200 and now I can see the
132 outbound traffic too. Thanks again.
133
134 (although those patches may not be the ones to install - there may be
135 later patches).
136
137 And another message to tcpdump-workers@tcpdump.org, from Rick Jones:
138
139 Date: Mon, 29 Apr 2002 15:59:55 -0700
140 From: Rick Jones
141 To: tcpdump-workers@tcpdump.org
142 Subject: Re: [tcpdump-workers] I Can't Capture the Outbound Traffic
143
144 ...
145
146 http://itrc.hp.com/ would be one place to start in a search for the most
147 up-to-date patches for DLPI and the lan driver(s) used on your system (I
148 cannot guess because 9000/800 is too generic - one hs to use the "model"
149 command these days and/or an ioscan command (see manpage) to guess what
150 the drivers (btlan[3456], gelan, etc) might be involved in addition to
151 DLPI.
152
153 Another option is to upgrade to 11i as outbound promiscuous mode support
154 is there in the base OS, no patches required.
155
156 Rick Jones reports that HP-UX 11i needs no patches for outbound
157 promiscuous mode support.
158
159 An additional note, from Jost Martin, for HP-UX 10.20:
160
161 Q: How do I get [Wireshark] on HPUX to capture the _outgoing_ packets
162 of an interface
163 A: You need to get PHNE_20892,PHNE_20725 and PHCO_10947 (or
164 newer, this is as of 4.4.00) and its dependencies. Then you can
165 enable the feature as described below:
166
167 Patch Name: PHNE_20892
168 Patch Description: s700 10.20 PCI 100Base-T cumulative patch
169 To trace the outbound packets, please do the following
170 to turn on a global promiscuous switch before running
171 the promiscuous applications like snoop or tcpdump:
172
173 adb -w /stand/vmunix /dev/mem
174 lanc_outbound_promisc_flag/W 1
175 (adb will echo the result showing that the flag has
176 been changed)
177 $quit
178 (Thanks for this part to HP-support, Ratingen)
179
180 The attached hack does this and some security-related stuff
181 (thanks to hildeb@www.stahl.bau.tu-bs.de (Ralf Hildebrandt) who
182 posted the security-part some time ago)
183
184 <<hack_ip_stack>>
185
186 (Don't switch IP-forwarding off, if you need it !)
187 Install the hack as /sbin/init.d/hacl_ip_stack (adjust
188 permissions !) and make a sequencing-symlink
189 /sbin/rc2.d/S350hack_ip_stack pointing to this script.
190 Now all this is done on every reboot.
191
192 According to Rick Jones, the global promiscuous switch also has to be
193 turned on for HP-UX 11.00, but not for 11i - and, in fact, the switch
194 doesn't even exist on 11i.
195
196 Here's the "hack_ip_stack" script:
197
198 -----------------------------------Cut Here-------------------------------------
199 #!/sbin/sh
200 #
201 # nettune: hack kernel params for safety
202
203 OKAY=0
204 ERROR=-1
205
206 # /usr/contrib/bin fuer nettune auf Pfad
207 PATH=/sbin:/usr/sbin:/usr/bin:/usr/contrib/bin
208 export PATH
209
210
211 ##########
212 # main #
213 ##########
214
215 case $1 in
216 start_msg)
217 print "Tune IP-Stack for security"
218 exit $OKAY
219 ;;
220
221 stop_msg)
222 print "This action is not applicable"
223 exit $OKAY
224 ;;
225
226 stop)
227 exit $OKAY
228 ;;
229
230 start)
231 ;; # fall through
232
233 *)
234 print "USAGE: $0 {start_msg | stop_msg | start | stop}" >&2
235 exit $ERROR
236 ;;
237 esac
238
239 ###########
240 # start #
241 ###########
242
243 #
244 # tcp-Sequence-Numbers nicht mehr inkrementieren sondern random
245 # Syn-Flood-Protection an
246 # ip_forwarding aus
247 # Source-Routing aus
248 # Ausgehende Packets an ethereal/tcpdump etc.
249
250 /usr/contrib/bin/nettune -s tcp_random_seq 2 || exit $ERROR
251 /usr/contrib/bin/nettune -s hp_syn_protect 1 || exit $ERROR
252 /usr/contrib/bin/nettune -s ip_forwarding 0 || exit $ERROR
253 echo 'ip_block_source_routed/W1' | /usr/bin/adb -w /stand/vmunix /dev/kmem || exit $ERROR
254 echo 'lanc_outbound_promisc_flag/W 1' | adb -w /stand/vmunix /dev/mem || exit $ERROR
255
256 exit $OKAY
257 -----------------------------------Cut Here-------------------------------------
258
259 If you are trying to do packet capture with a FORE ATM card, you may or
260 may not be able to. They usually only release their driver in object
261 code so unless their driver supports packet capture, there's not much
262 libpcap can do.
263
264 If you get an error like:
265
266 tcpdump: recv_ack: bind error 0x???
267
268 when using DLPI, look for the DL_ERROR_ACK error return values, usually
269 in `/usr/include/sys/dlpi.h`, and find the corresponding value.