IPB

Добро пожаловать, гость ( Вход | Регистрация )

 
Reply to this topicStart new topic
> Простой Perl-сценарий для переключения маршрутов на резервный канал
Leo
Jun 9 2009, 10:36 PM
Сообщение #1


Administrator
***

Группа: Root Admin
Сообщений: 128
Регистрация: 29-April 07
Пользователь №: 1



Сценарий для переключения маршрутов на резервный канал, если основной шлюз перестал отвечать на пинг. Умеет проверять несколько шлюзов, каждому набору шлюзов может быть назначено несколько подсетей. Вызывается через cron. Проверен на FreeBSD и на Linux c iproute2. Команды проверки и переключения при желании можно переопределять в файле настроек.

Fallback gateways
Fallback-gw is a little Perl script to be called via cron
that checks availibility of neighbor routers using ping
and activates backup routing on ping failure.

It can be used as stupid replacement for BGP/OSPF in multihomed environment.

Tested platforms are FreeBSD and Linux/iproute2.

Download version 2009.05.01

Contact author: ilya.evseev/gmail.com

Usage: fallback-gw [--dry] [--verbose] [/path/to/config]

Config example #1: simple
<destination2gateway inet>
destination 0.0.0.0/0
gateway 1.1.1.1
gateway 2.2.2.2
</destination2gateway>

Config example #2: complete
<commands>
change_default_route = /usr/local/sbin/change_default_route
</commands>

<gateway first_isp>
gateway 1.1.1.1
</gateway>

<gateway second_isp>
gateway 2.2.2.2
</gateway>

<destination first_nets>
destination 1.1.0.0/16
destination 3.3.3.0/24
</destination>

<destination second_nets>
destination 2.2.0.0/16
destination 4.4.4.0/24
</destination>

<destination2gateway first>
gateway first_isp
destination first_nets
</destination2gateway>

<destination2gateway second>
gateway second_isp
destination second_nets
</destination2gateway>

<destination2gateway inet>
destination 0.0.0.0/0
gateway first_isp
gateway second_isp
</destination2gateway>

Enjoy! :-)


Прикрепленные файлы
Прикрепленный файл  fallback_gw.pl.txt ( 8.6 кб ) Количество скачиваний: 62
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 чел. читают эту тему (гостей: 2, скрытых пользователей: 0)
Пользователей: 0 -

 






HitUA.net