一、先安装zebra
#rpm -ivh zebra-0.93a-3.i386.rpm
二、使用RIP路由选择协议搭建动态路由器的全过程:
1、启动RIPD和ZEBRA
#cd /etc/zebra
#touch ripd.conf
#service ripd start
#service zebra start
2、这里用电脑来代替路由器,必须要有两块网卡。(可先虚拟一块网卡,设置成两个不同网段的IP地址)
#ifconfig eth0 192.168.1.100 netmask 255.255.255.0
#ifconfig eth0:0 192.168.2.100 netmask 255.255.255.0
3、登陆路由器,进行配置
#vtysh
输入“?”,显色帮助
>enable
#c onfigure terminal
(config)#interface eth0 (配置第一块网卡)
(config-if)#ip address 192.168.1.100/24
(config-if)#no shutdown (激活该网卡)
(config-if)#exit
(config)#interface eth0:0 (配置第二块网卡)
(config-if)#ip address 192.168.2.100/24
(config-if)#no shutdown (激活该网卡)
4、配置路由选择协议
(config)#router rip
(config-router)#network 192.168.1.0/24
(config-router)#network 192.168.2.0/24
(config-router)#version 2 (选择版本)
#end
#copy running-config startup-config
#show running-config
三、OSPF路由选择协议是基于区域化的,下面介绍一下它的配置全过程:
1、先停止RIPD,再启动OSPFD
#service ripd stop
#cd /etc/zebra
#touch ospfd.conf
#service ospfd start
#service zebra start
2、配置两块网卡(同上)
#ifconfig eth0 192.168.1.100 netmask 255.255.255.0
#ifconfig eth0:0 192.168.2.100 netmask 255.255.255.0
3、登陆路由器,进行配置
#vtysh
输入“?”,显色帮助
>enable
#c onfigure terminal
(config)#interface eth0 (配置第一块网卡)
(config-if)#ip address 192.168.1.100/24
(config-if)#no shutdown (激活该网卡)
(config-if)#exit
(config)#interface eth0:0 (配置第二块网卡)
(config-if)#ip address 192.168.2.100/24
(config-if)#no shutdown (激活该网卡)
4、配置路由选择协议
(config)#router ospf
(config-router)#network 192.168.1.0/24 area 1
(config-router)#network 192.168.2.0/24 area 1
#end
#copy running-config startup-config
#show running-config
#show ip route (查看路由)
--------------------next---------------------
阅读(468) | 评论(0) | 转发(0) |