2018-03-21 02:28:26 +08:00
|
|
|
# This is a basic configuration file, which contains boilerplate options and
|
|
|
|
# some basic examples. It allows the BIRD daemon to start but will not cause
|
|
|
|
# anything else to happen.
|
|
|
|
#
|
|
|
|
# Please refer to the BIRD User's Guide documentation, which is also available
|
|
|
|
# online at http://bird.network.cz/ in HTML format, for more information on
|
|
|
|
# configuring BIRD and adding routing protocols.
|
1998-11-28 03:39:16 +08:00
|
|
|
|
2000-05-09 06:33:50 +08:00
|
|
|
# Configure logging
|
2018-03-21 02:28:26 +08:00
|
|
|
log syslog all;
|
|
|
|
# log "/var/log/bird.log" { debug, trace, info, remote, warning, error, auth, fatal, bug };
|
1999-12-06 21:45:56 +08:00
|
|
|
|
2018-03-21 02:28:26 +08:00
|
|
|
# Set router ID. It is a unique identification of your router, usually one of
|
|
|
|
# IPv4 addresses of the router. It is recommended to configure it explicitly.
|
|
|
|
# router id 198.51.100.1;
|
1998-11-28 05:09:57 +08:00
|
|
|
|
2018-03-21 02:28:26 +08:00
|
|
|
# Turn on global debugging of all protocols (all messages or just selected classes)
|
|
|
|
# debug protocols all;
|
|
|
|
# debug protocols { events, states };
|
1998-11-28 05:32:45 +08:00
|
|
|
|
2018-03-21 02:28:26 +08:00
|
|
|
# Turn on internal watchdog
|
|
|
|
# watchdog warning 5 s;
|
|
|
|
# watchdog timeout 30 s;
|
2000-05-09 06:33:50 +08:00
|
|
|
|
2018-03-21 02:28:26 +08:00
|
|
|
# You can define your own constants
|
|
|
|
# define my_asn = 65000;
|
|
|
|
# define my_addr = 198.51.100.1;
|
1999-03-17 22:31:26 +08:00
|
|
|
|
2018-03-21 02:28:26 +08:00
|
|
|
# Tables master4 and master6 are defined by default
|
|
|
|
# ipv4 table master4;
|
|
|
|
# ipv6 table master6;
|
2011-09-12 03:21:47 +08:00
|
|
|
|
2018-03-21 02:28:26 +08:00
|
|
|
# Define more tables, e.g. for policy routing or as MRIB
|
|
|
|
# ipv4 table mrib4;
|
|
|
|
# ipv6 table mrib6;
|
1999-05-18 04:14:52 +08:00
|
|
|
|
2018-03-21 02:28:26 +08:00
|
|
|
# The Device protocol is not a real routing protocol. It does not generate any
|
|
|
|
# routes and it only serves as a module for getting information about network
|
|
|
|
# interfaces from the kernel. It is necessary in almost any configuration.
|
|
|
|
protocol device {
|
|
|
|
}
|
1998-11-30 06:03:58 +08:00
|
|
|
|
2018-03-21 02:28:26 +08:00
|
|
|
# The direct protocol is not a real routing protocol. It automatically generates
|
|
|
|
# direct routes to all network interfaces. Can exist in as many instances as you
|
|
|
|
# wish if you want to populate multiple routing tables with direct routes.
|
|
|
|
protocol direct {
|
|
|
|
disabled; # Disable by default
|
|
|
|
ipv4; # Connect to default IPv4 table
|
|
|
|
ipv6; # ... and to default IPv6 table
|
|
|
|
}
|
1998-12-07 01:40:42 +08:00
|
|
|
|
2018-03-21 02:28:26 +08:00
|
|
|
# The Kernel protocol is not a real routing protocol. Instead of communicating
|
|
|
|
# with other routers in the network, it performs synchronization of BIRD
|
|
|
|
# routing tables with the OS kernel. One instance per table.
|
1998-12-07 01:40:42 +08:00
|
|
|
protocol kernel {
|
2018-03-21 02:28:26 +08:00
|
|
|
ipv4 { # Connect protocol to IPv4 table by channel
|
|
|
|
# table master4; # Default IPv4 table is master4
|
|
|
|
# import all; # Import to table, default is import all
|
|
|
|
export all; # Export to protocol. default is export none
|
|
|
|
};
|
|
|
|
# learn; # Learn alien routes from the kernel
|
|
|
|
# kernel table 10; # Kernel table to synchronize with (default: main)
|
1998-12-07 01:40:42 +08:00
|
|
|
}
|
1998-12-07 02:21:23 +08:00
|
|
|
|
2018-03-21 02:28:26 +08:00
|
|
|
# Another instance for IPv6, skipping default options
|
|
|
|
protocol kernel {
|
|
|
|
ipv6 { export all; };
|
1999-03-27 05:44:38 +08:00
|
|
|
}
|
|
|
|
|
2018-03-21 02:28:26 +08:00
|
|
|
# Static routes (Again, there can be multiple instances, for different address
|
|
|
|
# families and to disable/enable various groups of static routes on the fly).
|
1998-12-07 02:21:23 +08:00
|
|
|
protocol static {
|
2018-03-21 02:28:26 +08:00
|
|
|
ipv4; # Again, IPv4 channel with default options
|
|
|
|
|
|
|
|
# route 0.0.0.0/0 via 198.51.100.10;
|
|
|
|
# route 192.0.2.0/24 blackhole;
|
2012-11-27 09:08:04 +08:00
|
|
|
# route 10.0.0.0/8 unreachable;
|
2018-03-21 02:28:26 +08:00
|
|
|
# route 10.2.0.0/24 via "eth0";
|
|
|
|
# # Static routes can be defined with optional attributes
|
|
|
|
# route 10.1.1.0/24 via 198.51.100.3 { rip_metric = 3; };
|
|
|
|
# route 10.1.2.0/24 via 198.51.100.3 { ospf_metric1 = 100; };
|
|
|
|
# route 10.1.3.0/24 via 198.51.100.4 { ospf_metric2 = 100; };
|
1998-12-07 02:21:23 +08:00
|
|
|
}
|
1999-08-04 03:34:26 +08:00
|
|
|
|
2018-03-21 02:28:26 +08:00
|
|
|
# Pipe protocol connects two routing tables. Beware of loops.
|
|
|
|
# protocol pipe {
|
|
|
|
# table master4; # No ipv4/ipv6 channel definition like in other protocols
|
|
|
|
# peer table mrib4;
|
|
|
|
# import all; # Direction peer table -> table
|
|
|
|
# export all; # Direction table -> peer table
|
|
|
|
# }
|
|
|
|
|
|
|
|
# RIP example, both RIP and RIPng are supported
|
|
|
|
# protocol rip {
|
|
|
|
# ipv4 {
|
|
|
|
# # Export direct, static routes and ones from RIP itself
|
|
|
|
# import all;
|
|
|
|
# export where source ~ [ RTS_DEVICE, RTS_STATIC, RTS_RIP ];
|
2010-02-21 04:09:40 +08:00
|
|
|
# };
|
2018-03-21 02:28:26 +08:00
|
|
|
# interface "eth*" {
|
|
|
|
# update time 10; # Default period is 30
|
|
|
|
# timeout time 60; # Default timeout is 180
|
|
|
|
# authentication cryptographic; # No authentication by default
|
|
|
|
# password "hello" { algorithm hmac sha256; }; # Default is MD5
|
|
|
|
# };
|
|
|
|
# }
|
2000-05-09 06:33:50 +08:00
|
|
|
|
2018-03-21 02:28:26 +08:00
|
|
|
# OSPF example, both OSPFv2 and OSPFv3 are supported
|
|
|
|
# protocol ospf v3 {
|
|
|
|
# ipv6 {
|
|
|
|
# import all;
|
|
|
|
# export where source = RTS_STATIC;
|
|
|
|
# };
|
|
|
|
# area 0 {
|
2000-06-06 05:09:03 +08:00
|
|
|
# interface "eth*" {
|
2018-03-21 02:28:26 +08:00
|
|
|
# type broadcast; # Detected by default
|
|
|
|
# cost 10; # Interface metric
|
|
|
|
# hello 5; # Default hello perid 10 is too long
|
2000-06-06 05:09:03 +08:00
|
|
|
# };
|
2018-03-21 02:28:26 +08:00
|
|
|
# interface "tun*" {
|
|
|
|
# type ptp; # PtP mode, avoids DR selection
|
|
|
|
# cost 100; # Interface metric
|
|
|
|
# hello 5; # Default hello perid 10 is too long
|
2000-06-06 08:21:06 +08:00
|
|
|
# };
|
2018-03-21 02:28:26 +08:00
|
|
|
# interface "dummy0" {
|
|
|
|
# stub; # Stub interface, just propagate it
|
2000-06-06 05:09:03 +08:00
|
|
|
# };
|
|
|
|
# };
|
|
|
|
#}
|
2015-03-02 16:41:14 +08:00
|
|
|
|
2018-03-21 02:28:26 +08:00
|
|
|
# Define simple filter as an example for BGP import filter
|
|
|
|
# See https://gitlab.labs.nic.cz/labs/bird/wikis/BGP_filtering for more examples
|
|
|
|
# filter rt_import
|
|
|
|
# {
|
|
|
|
# if bgp_path.first != 64496 then accept;
|
|
|
|
# if bgp_path.len > 64 then accept;
|
|
|
|
# if bgp_next_hop != from then accept;
|
|
|
|
# reject;
|
|
|
|
# }
|
|
|
|
|
|
|
|
# BGP example, explicit name 'uplink1' is used instead of default 'bgp1'
|
|
|
|
# protocol bgp uplink1 {
|
2010-02-21 04:09:40 +08:00
|
|
|
# description "My BGP uplink";
|
2018-03-21 02:28:26 +08:00
|
|
|
# local 198.51.100.1 as 65000;
|
|
|
|
# neighbor 198.51.100.10 as 64496;
|
|
|
|
# hold time 90; # Default is 240
|
2010-02-21 04:09:40 +08:00
|
|
|
# password "secret"; # Password used for MD5 authentication
|
2018-03-21 02:28:26 +08:00
|
|
|
#
|
|
|
|
# ipv4 { # regular IPv4 unicast (1/1)
|
|
|
|
# import filter rt_import;
|
|
|
|
# export where source ~ [ RTS_STATIC, RTS_BGP ];
|
|
|
|
# };
|
|
|
|
#
|
|
|
|
# ipv6 { # regular IPv6 unicast (2/1)
|
|
|
|
# import filter rt_import;
|
|
|
|
# export filter { # The same as 'where' expression above
|
|
|
|
# if source ~ [ RTS_STATIC, RTS_BGP ]
|
|
|
|
# then accept;
|
|
|
|
# else reject;
|
|
|
|
# };
|
|
|
|
# };
|
|
|
|
#
|
|
|
|
# ipv4 multicast { # IPv4 multicast topology (1/2)
|
|
|
|
# table mrib4; # explicit IPv4 table
|
|
|
|
# import filter rt_import;
|
|
|
|
# export all;
|
2000-05-09 06:33:50 +08:00
|
|
|
# };
|
2015-03-02 16:41:14 +08:00
|
|
|
#
|
2018-03-21 02:28:26 +08:00
|
|
|
# ipv6 multicast { # IPv6 multicast topology (2/2)
|
|
|
|
# table mrib6; # explicit IPv6 table
|
|
|
|
# import filter rt_import;
|
|
|
|
# export all;
|
|
|
|
# };
|
|
|
|
#}
|
|
|
|
|
|
|
|
# Template example. Using templates to define IBGP route reflector clients.
|
|
|
|
# template bgp rr_clients {
|
|
|
|
# local 10.0.0.1 as 65000;
|
|
|
|
# neighbor as 65000;
|
2011-11-07 07:31:23 +08:00
|
|
|
# rr client;
|
|
|
|
# rr cluster id 1.0.0.1;
|
|
|
|
#
|
2018-03-21 02:28:26 +08:00
|
|
|
# ipv4 {
|
|
|
|
# import all;
|
|
|
|
# export where source = RTS_BGP;
|
|
|
|
# };
|
|
|
|
#
|
|
|
|
# ipv6 {
|
|
|
|
# import all;
|
|
|
|
# export where source = RTS_BGP;
|
|
|
|
# };
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
# protocol bgp client1 from rr_clients {
|
|
|
|
# neighbor 10.0.1.1;
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
# protocol bgp client2 from rr_clients {
|
|
|
|
# neighbor 10.0.2.1;
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
# protocol bgp client3 from rr_clients {
|
|
|
|
# neighbor 10.0.3.1;
|
|
|
|
# }
|