首页 > 代码库 > 安装Quagga路由软件

安装Quagga路由软件

>
#!/bin/bash
要先下载好软件:quagga-0.99.19.tar.gz
	cp /etc/yum.conf /etc/yum.conf.lnmp
	sed -i ‘s:exclude=.*:exclude=:g‘ /etc/yum.conf
	for packages in gcc gcc-c++ ncurses-devel libxml2-devel openssl-devel curl-devel libjpeg-devel libpng-devel autoconf pcre-devel libtool-libs freetype-devel gd zlib-devel zip unzip wget crontabs iptables file bison cmake patch mlocate flex diffutils automake make  readline-devel  glibc-devel glibc-static glib2-devel  bzip2-devel gettext-devel libcap-devel logrotate telnet openssl expect; do 
		echo "[${packages} Installing] ***************************** >>";
		yum -y install $packages; 
	done;
	mv -f /etc/yum.conf.lnmp /etc/yum.conf;
		tar zxvf quagga-0.99.19.tar.gz;
		cd quagga-0.99.19
		./configure --prefix=/usr/local/quagga                 --sysconfdir=/etc/quagga                  --localstatedir=/var/run/quagga                  --enable-vtysh                 --enable-user=‘test‘                 --enable-group=‘test‘                  --enable-vty-group=‘test‘
		make;
		make install;
		groupadd test;
		useradd test -g test;
		mkdir /var/run/quagga;
		chown test:test /var/run/quagga;
		chmod 777 /var/run/quagga;
		chown test:test /etc/quagga;
		chmod 777 /etc/quagga/*
		makedir  /var/log/quagga/
		touch /var/log/quagga/zebra.log
		chmod 777 /var/log/quagga/zebra.log
		cp /etc/quagga/zebra.conf.sample /etc/quagga/zebra.conf
		cp /etc/quagga/ripd.conf.sample /etc/quagga/ripd.conf
		cp /etc/quagga/ospfd.conf.sample /etc/quagga/ospfd.conf
		echo "log file  /var/log/quagga/zebra.log"  >> /etc/quagga/zebra.conf
		cp /etc/services  /etc/services.bak
		echo ‘zebrasrv    2600/tcp     # zebra service‘ >> /etc/services
            	echo ‘zebra         2601/tcp    # zebra vty‘    >> /etc/services
            	echo ‘ripd           2602/tcp    # RIPd vty‘    >> /etc/services
            	echo ‘ripngd       2603/tcp    # RIPngd vty‘   >> /etc/services
            	echo ‘ospfd        2604/tcp    # OSPFd vty‘    >> /etc/services
            	echo ‘bgpd         2605/tcp    # BGPd vty‘     >> /etc/services
            	echo ‘ospf6d      2606/tcp    # OSPF6d vty‘    >> /etc/services
            	echo ‘ospfapi     2607/tcp    # ospfapi‘      >> /etc/services
            	echo ‘isid           2608/tcp   ‘             >> /etc/services
		
		/etc/init.d/iptables stop;
#/usr/local/quagga/sbin/zebra -d	
#/usr/local/quagga/sbin/ripd -d
#/usr/local/quagga/sbin/ospfd -d
#telnet  localhost  ripd