Quagga(zebra)安装配置

来源:互联网 发布:沈阳seo搜索优化软件 编辑:程序博客网 时间:2024/05/09 01:53

Zebra编译

以下是在ubuntu12.04实验并编译通过(理论上适用ubuntu10.04)

一、安装编译需要的工具

1. ./configure 报错

configure: error: GNU awk is required for lib/memtype.h made by memtypes.awk.

BSD awk complains: awk: gensub doesn't support backreferences (subst "\1") 

$ sudo apt-get install gawk

2.configure: error: vtysh needs libreadline but was not found and usable on your system.

$ sudo apt-get install libreadline5 libreadline5-dev

如果readline5装不了,装readline6

$ sudo apt-get install libreadline6 libreadline6-dev

3.WARNING: `automake-1.11' is missing on your system.  You should only need it if

         you modified `Makefile.am', `acinclude.m4' or `configure.ac'.

         You might want to install the `Automake' and `Perl' packages.

         Grab them from any GNU archive site.

 

$ sudo apt-get install automake perl

 

二、编译配置

添加build.sh脚本

#!/bin/bash

export PATH=$PATH:/home/kevin/Documents/mips-tools/usr/bin:/home/kevin/Documents/mips-tools/bin

mkdir Output

./configure \

CC=mips_4KC-gcc \

--host=mipsel-linux \

--prefix=/home/huahuan/zebra/Output \

--enable-usr=root \

--enable-group=root

make

make install

 

configure配置文件解释

--build:执行代码编译的主机,正常的话就是你的主机系统。这个参数一般由config.guess来猜就可以。当然自己指定也可以。
--host:
编译出来的二进制程序所执行的主机,因为绝大多数是如果本机编译,本机执行。所以这个值就等于build。只有交叉编译的时候(也就是本机编译,其他系统机器执行)才会buildhost不同。用host指定运行主机。
--target:
这个选项只有在建立交叉编译环境的时候用到,正常编译和交叉编译都不会用到。他用build主机上的编译器,编译一个新的编译器(binutils, gcc,gdb等),这个新的编译器将来编译出来的其他程序将运行在target指定的系统上。

--prefix 指定安装目录(这个目录有两个用途,一个是用来存放编译的输出文件,一个是程序在目标板上运行时,这个目录会作为工作目录,所以目标板上需要创建相同的目录)

 

注:

1.编译时要根据自己的交叉编译目录修改PATH变量和--prefix

2.编译时,缺少了一个宏定义,在/zebos/debra/rt_netlink.c 516行,为编译通过临时注掉

//case ARPHRD_IEEE802154: return ZEBRA_LLT_IEEE802154;

三、目标板上执行

1.将输出的目录Output整体复制到目标板上,放到前面—prefix指定的目录

需要创建这个目录/home/huahuan/zebra/Output

2. 文件夹下Output/etc有一个zebra.conf.sample文件,需将该文件copy一份

cp zebra.conf.samplezebra.conf

3.执行./zebra -d -u root -groot

该步骤会查找/home/huahuan/zebra/Output/etc下是否有zebra.conf文件,如报错检查—prefix指定的目录与当前目录是否一致

执行完后可以ps看一下是否起来了

4.telnet localhost 2601

默认密码zebra

 

0 0
原创粉丝点击