2011年7月8日 星期五

2011-07-08 電腦概論

Quagga Routing Suite  (動態路由)


vm1


eth0 : LAN1 192.168.X.6/29

eth1 : LAN2 192.168.X.14/29

eth2 : LAN3 192.168.X.25/29



vm2

eth0 : LAN4 192.168.X.22/29

eth1 : LAN3 192.168.X.26/29

eth2 : LAN5 192.168.X.41/29



vm3

eth0 : LAN6 192.168.X.38/29

eth1 : LAN5 192.168.X.42/29

eth2 : 橋接介面卡 192.168.51.X/24



vm3

$su -

安裝路由協定的套件

#yum install quagga -y

#setup 關閉防火牆



初始化所有網路卡NIC

#ifconfig eth0 0.0.0.0 up

#ifconfig eth1 0.0.0.0 up

#ifconfig eth2 0.0.0.0 up



複製設定檔

#cd /etc/quagga

查看該目錄下的檔案

#ls

#cp ripd.conf.sample ripd.conf

#cp ospfd.conf.sample ospfd.conf



啟動zebra & rip 的服務

切換到 /etc/init.d 目錄

#cd /etc/init.d

查看一下目錄下的檔案, 此檔案下的所有檔案都是可執行的程式 (服務)

#ls

zebra 是負責 ip 層設定的服務

#/etc/init.d/zebra start

ripd 是負責 動態路由 RIP 協動的服務

#/etc/init.d/ripd start



正式進入 quagga 的整合模式, exit 回上一層, Ctrl+Z 直接回到第一層

#vtysh

進入 模組 模式

localhost.localdomain#config t

(config)#hostname vm3

進入網路介面卡 eth0 設定 IP 位址並啟動

vm3(config)#interface eth0

vm3(config-if)#ip address 192.168.X.38/29

vm3(config-if)#no shutdown

vm3(config-if)#exit



vm3(config)#interface eth1

vm3(config-if)#ip address 192.168.X.42/29

vm3(config-if)#no shutdown

vm3(config-if)#exit



vm3(config)#interface eth2

vm3(config-if)#ip address 192.168.51.X/24

vm3(config-if)#no shutdown

vm3(config-if)#exit



啟動 forwarding 的功能

vm3(config)#ip forwarding

vm3(config)#exit



查看剛剛所設定的資訊(目前的狀態)

vm3#show running-config?

查看開機時設定的資訊(就是看 zebra.conf & ripd.conf 的內容)

vm3#show startup-config

查看路由表

vm3#show ip route



啟動 RIPv2 的路由協定

vm3#config t

vm3(config)#router rip

vm3(config-router)#version 2

vm3(config-router)#network 192.168.51.0/24

vm3(config-router)#network 192.168.X.32/29

vm3(config-router)#network 192.168.X.40/29

vm3(config-router)#Ctrl+Z

vm3#show ip route

沒有留言:

張貼留言