Linux

Linux上的冗餘路由(主動/備份)

  • February 21, 2014

我目前正在嘗試在 RHEL 5 上設置冗餘路由。目標是擁有到子網的主路由和到該子網的備份路由,僅在主路由的網關無法訪問時使用。

知道如何實現這一目標嗎?與標準 RHEL 文件的集成是一個加分項:)

提前致謝,

您可以使用 quagga 和 OSPF

# yum info quagga
Loaded plugins: changelog, fastestmirror, presto, security, versionlock
Loading mirror speeds from cached hostfile
* base: ftp.colocall.net
* epel: ftp.colocall.net
* extras: ftp.colocall.net
* ius: ius.cu.be
* rpmforge: ftp.colocall.net
* updates: ftp.colocall.net
Available Packages
Name        : quagga
Arch        : x86_64
Version     : 0.99.15
Release     : 7.el6_3.2
Size        : 1.1 M
Repo        : base
Summary     : Routing daemon
URL         : http://www.quagga.net
License     : GPLv2+
Description : Quagga is a free software that manages TCP/IP based routing
           : protocol. It takes multi-server and multi-thread approach to resolve
           : the current complexity of the Internet.
           :
           : Quagga supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
           :
           : Quagga is intended to be used as a Route Server and a Route Reflector. It is
           : not a toolkit, it provides full routing power under a new architecture.
           : Quagga by design has a process for each protocol.
           :
           : Quagga is a fork of GNU Zebra.

並為每個網關使用不同的權重(成本)

router1.example.net# conf t
router1.example.net(config)# int tun0
router1.example.net(config-if)# ip ospf authentication message-digest
router1.example.net(config-if)# ip ospf message-digest-key 1 md5 SHdJLapbQ1
router1.example.net(config-if)# ip ospf cost 10
router1.example.net(config-if)# write
Configuration saved to /etc/quagga/ospfd.conf

router1.example.net# conf t
router1.example.net(config)# int tun1
router1.example.net(config-if)# ip ospf authentication message-digest
router1.example.net(config-if)# ip ospf message-digest-key 1 md5 SHdJLapbQ1
router1.example.net(config-if)# ip ospf cost 20
router1.example.net(config-if)# write
Configuration saved to /etc/quagga/ospfd.conf

引用自:https://serverfault.com/questions/577058