Compare commits
4 Commits
5dac863b90
...
efb3c3506d
Author | SHA1 | Date |
---|---|---|
graffen | efb3c3506d | |
graffen | d447df80a6 | |
graffen | 60e88aac72 | |
graffen | e5c4ec7119 |
|
@ -0,0 +1,37 @@
|
|||
template bgp dnpeers {
|
||||
local as OWNAS;
|
||||
table T_BGP4;
|
||||
|
||||
# metric is the number of hops between us and the peer
|
||||
path metric 1;
|
||||
|
||||
# this line allows debugging filter rules
|
||||
# filtered routes can be looked up in birdc using the "show route filtered" command
|
||||
import keep filtered on;
|
||||
|
||||
import all;
|
||||
export all;
|
||||
#source address 172.20.170.192;
|
||||
};
|
||||
|
||||
protocol pipe {
|
||||
table master;
|
||||
peer table T_BGP4;
|
||||
import filter {
|
||||
# accept every subnet, except our own advertised subnet
|
||||
# filtering is important, because some guys try to advertise routes like 0.0.0$
|
||||
if is_valid_network() && !is_self_net() then {
|
||||
accept;
|
||||
}
|
||||
reject;
|
||||
};
|
||||
# import limit 1000 action block;
|
||||
|
||||
export filter {
|
||||
# here we export the whole net
|
||||
if is_valid_network() then {
|
||||
accept;
|
||||
}
|
||||
reject;
|
||||
};
|
||||
};
|
37
bird.conf
37
bird.conf
|
@ -1,9 +1,12 @@
|
|||
log syslog { debug, trace, info, remote, warning, error, auth, fatal, bug };
|
||||
table T_BGP4;
|
||||
table T_OSPF;
|
||||
|
||||
protocol device {
|
||||
scan time 10;
|
||||
}
|
||||
|
||||
protocol static {
|
||||
route 172.20.0.0/14 via 172.20.170.192;
|
||||
route 172.20.170.192/27 reject;
|
||||
import all;
|
||||
export none;
|
||||
|
@ -21,8 +24,8 @@ protocol kernel {
|
|||
scan time 20;
|
||||
metric 64; # Use explicit kernel route metric to avoid collisions
|
||||
# with non-BIRD routes in the kernel routing table
|
||||
import keep filtered;
|
||||
import none;
|
||||
#export all; # Actually insert routes into the kernel routing table
|
||||
export filter {
|
||||
if source = RTS_STATIC then reject;
|
||||
krt_prefsrc = OWNIP;
|
||||
|
@ -31,33 +34,5 @@ protocol kernel {
|
|||
}
|
||||
|
||||
include "/etc/bird/ospf.conf";
|
||||
|
||||
template bgp dnpeers {
|
||||
local as OWNAS;
|
||||
# metric is the number of hops between us and the peer
|
||||
path metric 1;
|
||||
# this lines allows debugging filter rules
|
||||
# filtered routes can be looked up in birdc using the "show route filtered" command
|
||||
import keep filtered;
|
||||
import filter {
|
||||
# accept every subnet, except our own advertised subnet
|
||||
# filtering is important, because some guys try to advertise routes like 0.0.0.0
|
||||
if is_valid_network() && !is_self_net() then {
|
||||
accept;
|
||||
}
|
||||
reject;
|
||||
};
|
||||
|
||||
export filter {
|
||||
# here we export the whole net
|
||||
if is_valid_network() then {
|
||||
accept;
|
||||
}
|
||||
reject;
|
||||
};
|
||||
|
||||
import limit 1000 action block;
|
||||
#source address 172.20.170.192;
|
||||
};
|
||||
|
||||
include "/etc/bird/bgp.conf";
|
||||
include "/etc/bird/peers4/*";
|
||||
|
|
41
bird6.conf
41
bird6.conf
|
@ -1,3 +1,5 @@
|
|||
table T_BGP6;
|
||||
|
||||
protocol device {
|
||||
scan time 10;
|
||||
}
|
||||
|
@ -36,23 +38,34 @@ protocol static {
|
|||
}
|
||||
|
||||
template bgp dnpeers {
|
||||
table T_BGP6;
|
||||
local as 4242423934;
|
||||
path metric 1;
|
||||
import keep filtered;
|
||||
import filter {
|
||||
if is_valid_network() && !is_self_net() then {
|
||||
accept;
|
||||
}
|
||||
reject;
|
||||
};
|
||||
|
||||
export filter {
|
||||
if is_valid_network() then {
|
||||
accept;
|
||||
}
|
||||
reject;
|
||||
};
|
||||
import all;
|
||||
export all;
|
||||
import limit 1000 action block;
|
||||
}
|
||||
|
||||
protocol pipe {
|
||||
peer table T_BGP6;
|
||||
import filter {
|
||||
# accept every subnet, except our own advertised subnet
|
||||
# filtering is important, because some guys try to advertise routes like 0.0.0$
|
||||
if is_valid_network() && !is_self_net() then {
|
||||
accept;
|
||||
}
|
||||
reject;
|
||||
};
|
||||
|
||||
export filter {
|
||||
# here we export the whole net
|
||||
if is_valid_network() then {
|
||||
accept;
|
||||
}
|
||||
reject;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
include "/etc/bird/peers6/*";
|
||||
|
|
|
@ -5,7 +5,7 @@ define OWNIP = 172.20.170.192;
|
|||
define DN42_REGION = 41;
|
||||
|
||||
function is_self_net() {
|
||||
return net ~ [172.20.170.192/27+];
|
||||
return net ~ [172.20.170.192/27];
|
||||
}
|
||||
|
||||
function is_valid_network() {
|
||||
|
|
22
ospf.conf
22
ospf.conf
|
@ -1,13 +1,7 @@
|
|||
filter filter_OSPF {
|
||||
ospf_metric1 = 1000;
|
||||
if source = RTS_STATIC then accept;
|
||||
else reject;
|
||||
};
|
||||
|
||||
|
||||
protocol ospf {
|
||||
table T_OSPF;
|
||||
import all;
|
||||
export filter filter_OSPF;
|
||||
export all;
|
||||
|
||||
area 0 {
|
||||
interface "wg-ospf-*" {
|
||||
|
@ -18,3 +12,15 @@ protocol ospf {
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
filter filter_OSPF {
|
||||
ospf_metric1 = 1000;
|
||||
if source = RTS_STATIC then accept;
|
||||
else reject;
|
||||
};
|
||||
|
||||
protocol pipe {
|
||||
peer table T_OSPF;
|
||||
import all;
|
||||
export filter filter_OSPF;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue