summaryrefslogtreecommitdiff
path: root/doc/bird.conf.example2
blob: 6e8988b9f55e7adaa013568edfd719a6e4bb2a4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
/*
 *	This is an example configuration file for MB-BGP setting
 */


log "bird.log" all;
# debug protocols all;

router id 192.168.1.1;

ipv4 table master4;
ipv6 table master6;

ipv4 table mcast4;
ipv6 table mcast6;

flow4 table flowtab4;
flow6 table flowtab6;


protocol device {
	scan time 10;
}

protocol kernel kernel4 {
	scan time 20;

	ipv4 {
		export all;
	};
}

protocol kernel kernel6 {
	scan time 20;

	ipv6 {
		export all;
	};
}


protocol static static4 {
	ipv4;

	route 10.10.0.0/24 via 192.168.1.2;
	route 10.10.1.0/24 via 192.168.1.2 { bgp_large_community.add((10,20,30)); bgp_large_community.add((10,(20*3),10)); };
}

protocol static static6 {
	ipv6;

	route 2001:db8:10:10::/64 via 2001:db8:1:1::10;
	route 2001:db8:10:11::/64 via 2001:db8:1:1::10;

	route 2001:db8:1:1::/64 via fe80::ec9b:67ff:fe60:fd5d % ve1;
}

# RFC 5575 flow specification
protocol static flowstat4 {
	flow4;

	route flow4 {
		dst 10.0.0.0/8;
		proto = 23;
		dport > 24 && < 30 || 40..50,60..70,80;
		sport > 24 && < 30 || = 40 || 50,60..70,80;
		icmp type 80;
		icmp code 90;
		tcp flags 0x03/0x0f;
		length 2048..65535;
		dscp = 63;
		fragment dont_fragment, is_fragment || !first_fragment;
	} drop;

	route flow4 {
		dst 11.0.0.0/8;
		proto = 0x12;
		sport > 0x5678 && < 0x9abc || 0xdef0 || 0x1234,0x5678,0x9abc..0xdef0;
		dport = 50;
		tcp flags 0xabcd/0xbbdd;
	} drop;

	route flow4 {
		dst 12.0.0.0/32;
		tcp flags ! 0 / 0x9999;
	} drop;

	route flow4 {
		dst 220.0.254.0/24;
		tcp flags 0x99 / 0x9999;
	} drop;

	route flow4 {
		dst 220.0.254.192/28;
		tcp flags !0xffff / 0xFFFF;
	} drop;

	route flow4 {
		dst 15.0.0.0/8;
		tcp flags !0x9999/0x9999;
	} drop;
}

protocol static flowstat6 {
	flow6;

	route flow6 {
		dst fec0:1122:3344:5566::1/128;
		src 0000:0000:0000:0001:1234:5678:9800:0000/101 offset 63;
		next header = 23;
		sport 24..30, 42 || 50,60,70..80;
		dport = 50;
		tcp flags 0x03/0x0f, !0/0xff || 0x33/0x33;
		fragment !is_fragment || !first_fragment;
		label 0xaaaa/0xaaaa && 0x33/0x33;
	} drop;

	route flow6 {
		dst fec0:1122:3344:5566::1/128;
		src ::1:1234:5678:9800:0/101 offset 63;
		next header = 23;
		dport = 50;
		sport > 24 && < 30 || = 40 || = 50 || = 60 || >= 70 && <= 80;
		tcp flags 0x3/0x3 && 0x0/0xc;
	} drop;
}


protocol pipe {
	table master4;
	peer table mcast4;
	import none;
	export where source = RTS_OSPF;
}

protocol pipe {
	table master6;
	peer table mcast6;
	import none;
	export where source = RTS_OSPF;
}

protocol ospf2 ospf4 {
#	ecmp;

	ipv4 {
		import all;
#		export where source = RTS_STATIC;
	};

	area 0 {
		interface "ve0" { stub; };
		interface "ve1" { hello 5; type ptp; };
		interface "ve2" { hello 5; type bcast; ttl security; };
		interface "ve3" { hello 5; type bcast; ttl security; };
	};
}


protocol ospf3 ospf6 {
#	ecmp;

	ipv6 {
		import all;
#		export where source = RTS_STATIC;
	};

	area 0 {
		interface "ve0" { stub; };
		interface "ve1" { hello 5; type ptp; };
		interface "ve2" { hello 5; type bcast; };
	};
}

protocol bgp {
	local 192.168.11.1 as 1000;
	neighbor 192.168.11.2 as 2000;
#	local 192.168.1.1 as 1000;
#	neighbor 192.168.2.1 as 2000;
#	multihop;
#	rr client;
#	strict bind;
#	debug all;

	# regular IPv4 unicast (1/1)
	ipv4 {
		# connects to master4 table by default
		import all;
		export where source ~ [ RTS_STATIC, RTS_BGP ];
	};

	# regular IPv6 unicast (2/1)
	ipv6 {
		# connects to master6 table by default
		import all;
		export where source ~ [ RTS_STATIC, RTS_BGP ];
#		next hop address 2001:db8:1:1::1;
	};

	# IPv4 multicast topology (1/2)
	ipv4 multicast {
		# explicit IPv4 table
		table mcast4;
		import all;
		export all;
	};

	# IPv6 multicast topology (2/2)
	ipv6 multicast {
		# explicit IPv6 table
		table mcast6;
		import all;
		export all;
#		next hop address 2001:db8:1:1::1;
	};

	# IPv4 Flowspec (1/133)
	flow4 {
		# connects to flowtab4 table by default
		import all;
		export all;
	};

	# IPv6 Flowspec (2/133)
	flow6 {
		# connects to flowtab6 table by default
		import all;
		export all;
	};
}

protocol bgp {
	local 192.168.1.1 as 1000;
	neighbor 192.168.3.1 as 1000;
	multihop;
	rr client;

	ipv4 {
		import all;
		export where source ~ [ RTS_STATIC, RTS_BGP ];
	};

	ipv6 {
		import all;
		export where source ~ [ RTS_STATIC, RTS_BGP ];
		next hop address 2001:db8:1:1::1;
	};
}

protocol bgp {
	local 2001:db8:1:1::1 as 1000;
	neighbor 2001:db8:4:1::1 as 1000;
	multihop;
	rr client;

	ipv4 {
		import all;
		export where source ~ [ RTS_STATIC, RTS_BGP ];
		next hop address 192.168.4.1;
	};

	ipv6 {
		import all;
		export where source ~ [ RTS_STATIC, RTS_BGP ];
	};
}