Ubuntu下安装fragroute

最近在学习ip分片重组,需要安装fragroute,可是网上可用的资料很少,且安装过程很麻烦,所以将自己的经验分享出来,供大家参考。

下载fragroute:https://www.monkey.org/~dugsong/fragroute/

将下载下来的压缩包解压,进入解压目录:

1:执行./configure命令:结果会报错not installed libevent、、、(原因是需要依赖这个库)

 解决办法:下载libevent库http://libevent.org/,解压,进入解压目录分别执行(./configure;make,sudo make install命令)。

2:再次执行./configure命令结果如下:

sean@ubuntu:~/Software/Fragroute$ cd fragroute-1.2/
sean@ubuntu:~/Software/Fragroute/fragroute-1.2$ ./configure
loading cache ./config.cache
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal... missing
checking for working autoconf... missing
checking for working automake... missing
checking for working autoheader... missing
checking for working makeinfo... missing
checking for mawk... mawk
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for a BSD compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for ranlib... ranlib
checking for Cygwin environment... no
checking for gethostbyname... yes
checking for socket... yes
checking for putmsg in -lstr... no
checking for libevent... yes
checking for libpcap... no
configure: error: libpcap not found
sean@ubuntu:~/Software/Fragroute/fragroute-1.2$ 
解决办法:同理,下载安装libpcap库http://www.tcpdump.org/

但是会报错:

configure: error: Neither flex nor lex was found.
sean@ubuntu:~/Software/Fragroute/libpcap-1.8.1$ 
安装flax
sean@ubuntu:~$ sudo apt-get install flex
再次安装libpcap(./configure)

configure: error: yacc is insufficient to compile libpcap.
 libpcap requires Bison, Berkeley YACC, or another YACC compatible with them.
安装bison:

sean@ubuntu:~$ sudo apt-get install bison
再次尝试安装libpcap成功。

3:再次安装fragroute(./configure)

configure: error: libdnet not found
再次下载安装libdnet库:http://libdnet.sourceforge.net/
4: 再次安装fragroute(./configure,)

又会报错:

fragroute.o: In function `fragroute_signal':
/home/sean/Software/Fragroute/fragroute-1.2/fragroute.c:151: undefined reference to `event_gotsig'
fragroute.o: In function `fragroute_init':
/home/sean/Software/Fragroute/fragroute-1.2/fragroute.c:181: undefined reference to `event_sigcb'
collect2: error: ld returned 1 exit status
Makefile:236: recipe for target 'fragroute' failed
make[2]: *** [fragroute] Error 1
make[2]: Leaving directory '/home/sean/Software/Fragroute/fragroute-1.2'
Makefile:313: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/sean/Software/Fragroute/fragroute-1.2'
Makefile:458: recipe for target 'all-recursive-am' failed
make: *** [all-recursive-am] Error 2
查了好久都不知道什么问题,后来换了一个低版本(1.4.14)的libevent库就可以了。

下载地址:http://libevent.org/

5:安装fragroute成功。

6:运行时报错:

fragroute: error while loading shared libraries: libpcap.so.1: cannot open shared object file: No such file or directory
sean@ubuntu:~/Software/Fragroute/fragroute-1.2$ fragroute
将usr/local/lib中和libpcap.so.1相关的文件拷贝到usr/lib中即可。同理可解决:

fragroute: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory

7:至此已可成功运行fragroute.


  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值