环境:三台redhat6.5(VM虚拟机) 一、ospf协议 OSPF(Open Shortest Path First开放式最短路径优先)是一个内部网关协议(Interior Gateway Protocol,简称IGP),用于在单一自治系统(autonomous system,AS)
环境:三台redhat6.5(VM虚拟机)
一、ospf协议
OSPF(Open Shortest Path First开放式最短路径优先)是一个内部网关协议(Interior Gateway Protocol,简称IGP),用于在单一自治系统(autonomous system,AS)内决策路由。是对链路状态路由协议的一种实现,隶属内部网关协议(IGP),故运作于自治系统内部。
PS:这里不过多讲解ospf协议,可在网上自行查找学习
二、配置
首先下载安装软件包,其他yum源以及网络配置就不再介绍了,三台配置也是一样的
下载地址:http://download.openpkg.org/components/cache/quagga/
本人这里使用的版本是quagga-0.99.17.tar.gz
相关依赖包:gcc readline readline-devel
#tar zxf quagga-0.99.17.tar.gz #yum install -y gcc readline readline-devel #cd quagga-0.99.17 #进入目录进行源码编译安装 #./configure --enable-vtysh--enable-user=root --enable-group=root --enable-vty-group=root # make && make install
修改配置文件:
在/etc/services文件里面添加以下内容:
# vim /etc/services zebrasrv 2600/tcp # zebra service zebra 2601/tcp # zebra vty ripd 2602/tcp # RIPd vty ripngd 2603/tcp # RIPngd vty ospfd 2604/tcp # OSPFd vty bgpd 2605/tcp # BGPd vty ospf6d 2606/tcp # OSPF6d vty ospfapi 2607/tcp # ospfapi isid 2608/tcp # ISISd vty
修改quagga的配置文件:
# mkdir /usr/local/etc/sample # mv /usr/local/etc/*.sample/usr/local/etc/sample/ # mv /usr/local/etc/bgpd.conf.sample2/usr/local/etc/sample/ # cp /usr/local/etc/sample/bgpd.conf.sample/usr/local/etc/bgpd.conf # cp/usr/local/etc/sample/ospfd.conf.sample /usr/local/etc/ospfd.conf # cp/usr/local/etc/sample/ospf6d.conf.sample /usr/local/etc/ospf6d.conf # cp /usr/local/etc/sample/ripd.conf.sample/usr/local/etc/ripd.conf # cp /usr/local/etc/sample/vtysh.conf.sample/usr/local/etc/vtysh.conf # cp/usr/local/etc/sample/ripngd.conf.sample /usr/local/etc/ripngd.conf # cp/usr/local/etc/sample/zebra.conf.sample /usr/local/etc/zebra.conf
修改ospfd的配置文件:
# vim /usr/local/etc/ospfd.conf ! -*- ospf -*- ! ! OSPFd sample configuration file ! ! hostname ospfd password zebra enable password please-set-at-here router ospf network 10.235.117.0/24 area 0 #将网段宣告进ospf中 log stdout
三、启动验证
接下来启动即可:
# /usr/local/sbin/ospfd -d # /usr/local/sbin/zebra -d # vtysh Hello, this is Quagga (version 0.99.17). Copyright 1996-2005 Kunihiro Ishiguro, etal. test.xiaomi.com# show running-config Building configuration... Current configuration: hostname Router hostname ospfd log stdout password zebra enable password zebra enable password please-set-at-here interface eth0 ipv6nd suppress-ra interface lo router ospf network 10.235.117.0/24 area 0.0.0.0 line vty end test.xiaomi.com# show ip ospf database OSPF Router with ID (10.235.117.22) Router Link States (Area0.0.0.0) Link ID ADV Router Age Seq# CkSum Link count 10.235.117.22 10.235.117.22 3 0x80000003 0x0735 1 10.235.117.27 10.235.117.27 9 0x80000005 0xf832 1 10.235.117.28 10.235.117.28 10 0x80000005 0xf631 1 Net Link States (Area0.0.0.0) Link ID ADV Router Age Seq# CkSum 10.235.117.28 10.235.117.28 10 0x80000003 0xe5cfvtysh是quagga进入模拟路由的,进去可以像正常路由器上面命令一样去查看信息。
我这里是启动了三台ospfd进程,配置都是一样的,重复上面步骤即可,赶紧get起来吧!!!