Sponsored Content
Special Forums IP Networking How to capturing packet data so i can see the Version, IHL, TOS, etc? Post 302568608 by polutan on Thursday 27th of October 2011 07:24:24 PM
Old 10-27-2011
ok thank you... :)

Ok.... thank you very much @thanhdat Smilie
now i can see the packet just like what i want Smilie

---------- Post updated at 07:24 AM ---------- Previous update was at 07:20 AM ----------

Before i forget, i want to add some correction from your answer
tcpdump -w afile.log -x -X
then read it with
tcpdump -r afile.log -x -X

Thank you Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Capturing some data from a file into a variable

I have a file with some values in a tab delimted format Eg: 'test' contains: a<tab>b<tab>c<tab>Trk_12345678 now i need to capture this value 'Trk_12345678' into a variable say 'x' and append that value of 12345678 to 12345679 and store is back to a new 'test1' file as : 'test1'... (11 Replies)
Discussion started by: shiroh_1982
11 Replies

2. Shell Programming and Scripting

Capturing Unix Traceroute data

Hi guys, I need a way to capture the host on the next-to-last hop in a traceroute output. The last output is the destination but I need to capture the router just before the last hop. I can do this in perl but I'm not so sure about Shell... I'm on AIX 5.3 using ksh any ideas? ... (3 Replies)
Discussion started by: TivoliGUY
3 Replies

3. UNIX for Dummies Questions & Answers

Keep alive packet for control session in ftp data transfer

I'm new to UNIX. We are using SunOS5.9. In order to maintain the control session active during large file tranfers in ftp, i like to send keep alive packets for every 10 seconds.I like to know the steps to be done to achieve this. Please help me guys.Thanks in advance. (0 Replies)
Discussion started by: rpr
0 Replies

4. Programming

Packet capturing using pcap

Hi, i am using a linux CentOS machine. I have 2 real network interfaces eth0, eth1 and 2 virtual interfaces tap0 and tap1. I am using PCAP library to capture the packets on theses interfaces. If i specify the interface as "any", i cannot find a way to know from which interface the packet... (1 Reply)
Discussion started by: rahulnitk2004
1 Replies

5. Shell Programming and Scripting

Capturing Particular Data

Hi everyone! Can any one help me out regarding capturing relevant data from a file. For e.g, if i want to capture the comment written after "Prompt:" for a particular date, like for this case what would be the command to capture the tag written after "Prompt:" for Date: 2009-03-20. A... (7 Replies)
Discussion started by: muhmsida
7 Replies

6. Shell Programming and Scripting

Capturing data between patterns

Hii, Friends, I want your help in one of my problem. My problem is as follows. I have a flat file as follows (Just a sample) MHT011 01(DOT)8750707asdfas8609 03(DOT)ASD3453ASD 09(DOT)876JHT87 11(DOT)sfd324ert TTT077 01(MOB)876786klj897 06(MOB)876JHT87 07(MOB)sfd324ert... (4 Replies)
Discussion started by: anushree.a
4 Replies

7. Red Hat

capturing data of nethogs

I have installed nethogs to see which process is sending load on the network. i would like to know how can i capture its data in a log file. Or is there is a unix command like script or tee which can help me to capture the data using cronjob (0 Replies)
Discussion started by: anshus1
0 Replies

8. Shell Programming and Scripting

capturing selective data from a vcd file

Hi, This is a vcd file.A vcd file may have 'n' modules. 1) I need to capture the data in bold,i.e. the module names (shown in bold) 2) Also i need to capture the data inside each individual module,say for tst_bench_top ,i need to capture data from line 4 to line 20 ... I just want one... (2 Replies)
Discussion started by: veerabahu
2 Replies

9. Shell Programming and Scripting

Perl : not capturing all the data from excel sheet

Hi folks, I am working on assignment that captures all the records(2 columns one column contains names and other contain date of birth) from excel sheet stored in a directory and checks for current date and month. If it matches current date and month then the matched records are printed as... (1 Reply)
Discussion started by: giridhar276
1 Replies

10. AIX

Packet loss coming with big packet size ping

(5 Replies)
Discussion started by: Vishal_dba
5 Replies
ipftest(1)						      General Commands Manual							ipftest(1)

NAME
ipftest - test packet filter rules with arbitrary input. SYNOPSIS
ipftest [ -6bCdDoRvx ] [ -F input-format ] [ -i <filename> ] [ -I interface ] [ -l <filename> ] [ -N <filename> ] [ -P <filename> ] [ -r <filename> ] [ -S <ip_address> ] [ -T <optionlist> ] DESCRIPTION
ipftest is provided for the purpose of being able to test a set of filter rules without having to put them in place, in operation and pro- ceed to test their effectiveness. The hope is that this minimises disruptions in providing a secure IP environment. ipftest will parse any standard ruleset for use with ipf, ipnat and/or ippool and apply input, returning output as to the result. However, ipftest will return one of three values for packets passed through the filter: pass, block or nomatch. This is intended to give the opera- tor a better idea of what is happening with packets passing through their filter ruleset. At least one of -N, -P or -r must be specified. OPTIONS
-6 Use IPv6. -b Cause the output to be a brief summary (one-word) of the result of passing the packet through the filter; either "pass", "block" or "nomatch". This is used in the regression testing. -C Force the checksums to be (re)calculated for all packets being input into ipftest. This may be necessary if pcap files from tcpdump are being fed in where there are partial checksums present due to hardware offloading. -d Turn on filter rule debugging. Currently, this only shows you what caused the rule to not match in the IP header checking (addresses/netmasks, etc). -D Dump internal tables before exiting. This excludes log messages. -F This option is used to select which input format the input file is in. The following formats are available: etherfind, hex, pcap, snoop, tcpdump,text. etherfind The input file is to be text output from etherfind. The text formats which are currently supported are those which result from the following etherfind option combinations: etherfind -n etherfind -n -t hex The input file is to be hex digits, representing the binary makeup of the packet. No length correction is made, if an incor- rect length is put in the IP header. A packet may be broken up over several lines of hex digits, a blank line indicating the end of the packet. It is possible to specify both the interface name and direction of the packet (for filtering purposes) at the start of the line using this format: [direction,interface] To define a packet going in on le0, we would use [in,le0] - the []'s are required and part of the input syntax. pcap The input file specified by -i is a binary file produced using libpcap (i.e., tcpdump version 3). Packets are read from this file as being input (for rule purposes). An interface maybe specified using -I. snoop The input file is to be in "snoop" format (see RFC 1761). Packets are read from this file and used as input from any inter- face. This is perhaps the most useful input type, currently. tcpdump The input file is to be text output from tcpdump. The text formats which are currently supported are those which result from the following tcpdump option combinations: tcpdump -n tcpdump -nq tcpdump -nqt tcpdump -nqtt tcpdump -nqte text The input file is in ipftest text input format. This is the default if no -F argument is specified. The format used is as follows: "in"|"out" "on" if ["tcp"|"udp"|"icmp"] srchost[,srcport] dsthost[,destport] [FSRPAU] This allows for a packet going "in" or "out" of an interface (if) to be generated, being one of the three main protocols (option- ally), and if either TCP or UDP, a port parameter is also expected. If TCP is selected, it is possible to (optionally) supply TCP flags at the end. Some examples are: # a UDP packet coming in on le0 in on le0 udp 10.1.1.1,2210 10.2.1.5,23 # an IP packet coming in on le0 from localhost - hmm :) in on le0 localhost 10.4.12.1 # a TCP packet going out of le0 with the SYN flag set. out on le0 tcp 10.4.12.1,2245 10.1.1.1,23 S -i <filename> Specify the filename from which to take input. Default is stdin. -I <interface> Set the interface name (used in rule matching) to be the name supplied. This is useful where it is not otherwise possible to asso- ciate a packet with an interface. Normal "text packets" can override this setting. -l <filename> Dump log messages generated during testing to the specified file. -N <filename> Specify the filename from which to read NAT rules in ipnat(5) format. -o Save output packets that would have been written to each interface in a file /tmp/interface_name in raw format. -P <filename> Read IP pool configuration information in ippool(5) format from the specified file. -r <filename> Specify the filename from which to read filter rules in ipf(5) format. -R Don't attempt to convert IP addresses to hostnames. -S <ip_address> The IP address specified with this option is used by ipftest to determine whether a packet should be treated as "input" or "output". If the source address in an IP packet matches then it is considered to be inbound. If it does not match then it is considered to be outbound. This is primarily for use with tcpdump (pcap) files where there is no in/out information saved with each packet. -T <optionlist> This option simulates the run-time changing of IPFilter kernel variables available with the -T option of ipf. The optionlist param- eter is a comma separated list of tuning commands. A tuning command is either "list" (retrieve a list of all variables in the ker- nel, their maximum, minimum and current value), a single variable name (retrieve its current value) and a variable name with a fol- lowing assignment to set a new value. See ipf(8) for examples. -v Verbose mode. This provides more information about which parts of rule matching the input packet passes and fails. -x Print a hex dump of each packet before printing the decoded contents. SEE ALSO
ipf(5), ipf(8), tcpdump(8), BUGS
Not all of the input formats are sufficiently capable of introducing a wide enough variety of packets for them to be all useful in testing. ipftest(1)
All times are GMT -4. The time now is 05:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy