]> The Tcpdump Group git mirrors - libpcap/blob - README.hpux
Add a "pcap_close_common()" routine which can be used as the close
[libpcap] / README.hpux
1 HP-UX patches to fix packet capture problems
2
3 Note that packet-capture programs such as tcpdump may, on HP-UX, not be
4 able to see packets sent from the machine on which they're running.
5 Some articles on groups.google.com discussing this are:
6
7 http://groups.google.com/groups?selm=82ld3v%2480i%241%40mamenchi.zrz.TU-Berlin.DE
8
9 which says:
10
11 Newsgroups: comp.sys.hp.hpux
12 Subject: Re: Did someone made tcpdump working on 10.20 ?
13 Date: 12/08/1999
14 From: Lutz Jaenicke <jaenicke@emserv1.ee.TU-Berlin.DE>
15
16 In article <82ks5i$5vc$1@news1.dti.ne.jp>, mtsat <mtsat@iris.dti.ne.jp>
17 wrote:
18 >Hello,
19 >
20 >I downloaded and compiled tcpdump3.4 a couple of week ago. I tried to use
21 >it, but I can only see incoming data, never outgoing.
22 >Someone (raj) explained me that a patch was missing, and that this patch
23 >must me "patched" (poked) in order to see outbound data in promiscuous mode.
24 >Many things to do .... So the question is : did someone has already this
25 >"ready to use" PHNE_**** patch ?
26
27 Two things:
28 1. You do need a late "LAN products cumulative patch" (e.g. PHNE_18173
29 for s700/10.20).
30 2. You must use
31 echo 'lanc_outbound_promisc_flag/W1' | /usr/bin/adb -w /stand/vmunix /dev/kmem
32 You can insert this e.g. into /sbin/init.d/lan
33
34 Best regards,
35 Lutz
36
37 and
38
39 http://groups.google.com/groups?selm=88cf4t%24p03%241%40web1.cup.hp.com
40
41 which says:
42
43 Newsgroups: comp.sys.hp.hpux
44 Subject: Re: tcpdump only shows incoming packets
45 Date: 02/15/2000
46 From: Rick Jones <foo@bar.baz.invalid>
47
48 Harald Skotnes <harald@cc.uit.no> wrote:
49 > I am running HPUX 11.0 on a C200 hanging on a 100Mb switch. I have
50 > compiled libpcap-0.4 an tcpdump-3.4 and it seems to work. But at a
51 > closer look I only get to see the incoming packets not the
52 > outgoing. I have tried tcpflow-0.12 which also uses libpcap and the
53 > same thing happens. Could someone please give me a hint on how to
54 > get this right?
55
56 Search/Read the archives ?-)
57
58 What you are seeing is expected, un-patched, behaviour for an HP-UX
59 system. On 11.00, you need to install the latest lancommon/DLPI
60 patches, and then the latest driver patch for the interface(s) in use.
61 At that point, a miracle happens and you should start seeing outbound
62 traffic.
63
64 [That article also mentions the patch that appears below.]
65
66 and
67
68 http://groups.google.com/groups?selm=38AA973E.96BE7DF7%40cc.uit.no
69
70 which says:
71
72 Newsgroups: comp.sys.hp.hpux
73 Subject: Re: tcpdump only shows incoming packets
74 Date: 02/16/2000
75 From: Harald Skotnes <harald@cc.uit.no>
76
77 Rick Jones wrote:
78
79 ...
80
81 > What you are seeing is expected, un-patched, behaviour for an HP-UX
82 > system. On 11.00, you need to install the latest lancommon/DLPI
83 > patches, and then the latest driver patch for the interface(s) in
84 > use. At that point, a miracle happens and you should start seeing
85 > outbound traffic.
86
87 Thanks a lot. I have this problem on several machines running HPUX
88 10.20 and 11.00. The machines where patched up before y2k so did not
89 know what to think. Anyway I have now installed PHNE_19766,
90 PHNE_19826, PHNE_20008, PHNE_20735 on the C200 and now I can see the
91 outbound traffic too. Thanks again.
92
93 (although those patches may not be the ones to install - there may be
94 later patches).
95
96 And another message to tcpdump-workers@tcpdump.org, from Rick Jones:
97
98 Date: Mon, 29 Apr 2002 15:59:55 -0700
99 From: Rick Jones
100 To: tcpdump-workers@tcpdump.org
101 Subject: Re: [tcpdump-workers] I Can't Capture the Outbound Traffic
102
103 ...
104
105 http://itrc.hp.com/ would be one place to start in a search for the most
106 up-to-date patches for DLPI and the lan driver(s) used on your system (I
107 cannot guess because 9000/800 is too generic - one hs to use the "model"
108 command these days and/or an ioscan command (see manpage) to guess what
109 the drivers (btlan[3456], gelan, etc) might be involved in addition to
110 DLPI.
111
112 Another option is to upgrade to 11i as outbound promiscuous mode support
113 is there in the base OS, no patches required.
114
115 Another posting:
116
117 http://groups.google.com/groups?selm=7d6gvn%24b3%241%40ocean.cup.hp.com
118
119 indicates that you need to install the optional STREAMS product to do
120 captures on HP-UX 9.x:
121
122 Newsgroups: comp.sys.hp.hpux
123 Subject: Re: tcpdump HP/UX 9.x
124 Date: 03/22/1999
125 From: Rick Jones <foo@bar.baz>
126
127 Dave Barr (barr@cis.ohio-state.edu) wrote:
128 : Has anyone ported tcpdump (or something similar) to HP/UX 9.x?
129
130 I'm reasonably confident that any port of tcpdump to 9.X would require
131 the (then optional) STREAMS product. This would bring DLPI, which is
132 what one uses to access interfaces in promiscuous mode.
133
134 I'm not sure that HP even sells the 9.X STREAMS product any longer,
135 since HP-UX 9.X is off the pricelist (well, maybe 9.10 for the old 68K
136 devices).
137
138 Your best bet is to be up on 10.20 or better if that is at all
139 possible. If your hardware is supported by it, I'd go with HP-UX 11.
140 If you want to see the system's own outbound traffic, you'll never get
141 that functionality on 9.X, but it might happen at some point for 10.20
142 and 11.X.
143
144 rick jones
145
146 (as per other messages cited here, the ability to see the system's own
147 outbound traffic did happen).
148
149 Rick Jones reports that HP-UX 11i needs no patches for outbound
150 promiscuous mode support.
151
152 An additional note, from Jost Martin, for HP-UX 10.20:
153
154 Q: How do I get ethereral on HPUX to capture the _outgoing_ packets
155 of an interface
156 A: You need to get PHNE_20892,PHNE_20725 and PHCO_10947 (or
157 newer, this is as of 4.4.00) and its dependencies. Then you can
158 enable the feature as descibed below:
159
160 Patch Name: PHNE_20892
161 Patch Description: s700 10.20 PCI 100Base-T cumulative patch
162 To trace the outbound packets, please do the following
163 to turn on a global promiscuous switch before running
164 the promiscuous applications like snoop or tcpdump:
165
166 adb -w /stand/vmunix /dev/mem
167 lanc_outbound_promisc_flag/W 1
168 (adb will echo the result showing that the flag has
169 been changed)
170 $quit
171 (Thanks for this part to HP-support, Ratingen)
172
173 The attached hack does this and some security-related stuff
174 (thanks to hildeb@www.stahl.bau.tu-bs.de (Ralf Hildebrandt) who
175 posted the security-part some time ago)
176
177 <<hack_ip_stack>>
178
179 (Don't switch IP-forwarding off, if you need it !)
180 Install the hack as /sbin/init.d/hacl_ip_stack (adjust
181 permissions !) and make a sequencing-symlink
182 /sbin/rc2.d/S350hack_ip_stack pointing to this script.
183 Now all this is done on every reboot.
184
185 Here's the "hack_ip_stack" script:
186
187 -----------------------------------Cut Here-------------------------------------
188 #!/sbin/sh
189 #
190 # nettune: hack kernel parms for safety
191
192 OKAY=0
193 ERROR=-1
194
195 # /usr/contrib/bin fuer nettune auf Pfad
196 PATH=/sbin:/usr/sbin:/usr/bin:/usr/contrib/bin
197 export PATH
198
199
200 ##########
201 # main #
202 ##########
203
204 case $1 in
205 start_msg)
206 print "Tune IP-Stack for security"
207 exit $OKAY
208 ;;
209
210 stop_msg)
211 print "This action is not applicable"
212 exit $OKAY
213 ;;
214
215 stop)
216 exit $OKAY
217 ;;
218
219 start)
220 ;; # fall through
221
222 *)
223 print "USAGE: $0 {start_msg | stop_msg | start | stop}" >&2
224 exit $ERROR
225 ;;
226 esac
227
228 ###########
229 # start #
230 ###########
231
232 #
233 # tcp-Sequence-Numbers nicht mehr inkrementieren sondern random
234 # Syn-Flood-Protection an
235 # ip_forwarding aus
236 # Source-Routing aus
237 # Ausgehende Packets an ethereal/tcpdump etc.
238
239 /usr/contrib/bin/nettune -s tcp_random_seq 2 || exit $ERROR
240 /usr/contrib/bin/nettune -s hp_syn_protect 1 || exit $ERROR
241 /usr/contrib/bin/nettune -s ip_forwarding 0 || exit $ERROR
242 echo 'ip_block_source_routed/W1' | /usr/bin/adb -w /stand/vmunix /dev/kmem || exit $ERROR
243 echo 'lanc_outbound_promisc_flag/W 1' | adb -w /stand/vmunix /dev/mem || exit $ERROR
244
245 exit $OKAY
246 -----------------------------------Cut Here-------------------------------------