Steps for installing the tcpcopy offline version in ubuntu

Source: Internet
Author: User

In the previous article, I have already used the online version of tcpcopy. Today I will share with you the usage of the offline version of tcpcopy. The tcpcopy online version requires at least two machines, while the offline version requires only one machine.
Uninstall the online version of tcpcopy
Skip this step if no installation is available.
 

The code is as follows: Copy code
# Cd tcpcopy-0.6.0
# Make uninstall
# Cd ..
# Rm-rf tcpcopy-0.6.0
Install libpcap
To install the offline version of tcpcopy, you must first install libpcap. The latest version I downloaded is the libpcap-1.3.0
 
The code is as follows: Copy code
# Tar-zxvf libpcap-1.3.0.tar.gz
# Cd libpcap-1.3.0
#./Configure
# Make
# Make install
Three errors will occur during installation.

 
./Configure: error: Your operating system's lex is insufficient to compile libpcap.

Solution:


# Apt-get install flex

 
Make: yacc: Command not found

Solution:


# Apt-get install biso

 
/Usr/local/lib/libpcap. so: undefined reference to 'pcap _ parse'

Solution:

# Apt-get install libpcap-dev
Install the offline version of tcpcopy
 

The code is as follows: Copy code
# Tar-zxvf tcpcopy-0.6.0 .tar.gz
# Cd tcpcopy-0.6.0
#./Configure -- enable-offline
# Make
# Make install

Tcpcopy for offline use
1. Capture packets from online servers
 
Tcpdump-I any tcp and port <port>-s 0-w online. pcap
2. Start the tested program on the test server.
3. Start intercept on the test server
 

The code is as follows: Copy code
# Modprobe ip_queue
# Iptables-I OUTPUT-p tcp -- sport <port>-j QUEUE
# Intercept

4. Start tcpcopy on the test server

1
# Tcpcopy-I <packet capture file address>-x <port>-<local ip address >:< port>

Example image:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.