how can i dynamically change the gateway?
Brandon Zhi
Brandon at huize.asia
Sun Sep 4 04:48:37 CEST 2022
Hi,
I'm trying to understand the thing that you want to do. So if the
GW is down, then babel is down too. Maybe you could announce 0.0.0.0/0
by babel when babel is down, the GW will change.
On Thu, 1 Sept 2022 at 22:28, Michele Salerno <mikysal78 at gmail.com> wrote:
> Hi, I have this script that configures routes for me between different
> routers and servers.
> I have a few routers that have down in the wan and connect with the mesh
> network.
> How can I dynamically change the gateway?
> Example: if the wan drops, use the mesh as the gateway.
>
>
> # Configure logging
> log syslog all;
> log "/var/log/bird.log" all;
> log stderr all;
> router id from "br-lan";
>
> # Sync bird routing table with kernel
> protocol kernel kernel4 {
> description "Kernel protocol for IPv4";
> metric 50;
> ipv4 {
> table master4;
> export filter {
> if proto = "lan" then reject;
> accept;
> };
> import all;
> };
> };
>
> protocol kernel kernel6 {
> description "Kernel protocol for IPv6";
> metric 300;
> ipv6 {
> table master6;
> export filter {
> if proto = "lan" then reject;
> accept;
> };
> import all;
> };
> };
>
> protocol device {
> description "Device protocol";
> };
>
> protocol direct lan {
> description "LAN protocol";
> ipv4;
> ipv6;
> interface "br-lan";
> check link;
> }
> protocol babel ninux {
> description "Babel protocol for NINUX network";
> ipv4 {
> export where (source = RTS_DEVICE) || (source = RTS_BABEL);
> };
> ipv6 {
> export where (source = RTS_DEVICE) || (source = RTS_BABEL);
> };
> interface "vpnbas" {
> check link;
> };
> ## Used to connect with other neighbours on the same layer 2 network.
> ## Decomment the config to use it, not this comments of course!
> ## Use the correct name interface, not the logical openwrt/(l)uci one.
> ## You can define more interfaces maches using * in regex (like "ifnet*")
> ## or "ifnet1", "ifnet2", "ifnetN", "otherifnetnames" form.
> ## You can also define more interfaces with other parameters, please refer to:
> ## https://bird.network.cz/?get_doc&v=20&f=bird-6.html#ss6.1
> ## After, reload the bird daemon with: /etc/init.d/bird reload
> ## or if you perefer, reastart with: /etc/init.d/bird restart
> interface "mesh" {
> type wireless; # or wired
> check link;
> };
> }
>
>
--
*Brandon Zhi*
HUIZE LTD
www.huize.asia <https://huize.asia/>| www.ixp.su | Twitter
This e-mail and any attachments or any reproduction of this e-mail in
whatever manner are confidential and for the use of the addressee(s) only.
HUIZE LTD can’t take any liability and guarantee of the text of the email
message and virus.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20220904/d3e3256d/attachment.htm>
More information about the Bird-users
mailing list