更新IXP配置
This commit is contained in:
@@ -1,9 +1,3 @@
|
|||||||
function is_self_net() {
|
|
||||||
return net ~ [
|
|
||||||
44.32.191.0/24
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
protocol static route_int_export_v4 {
|
protocol static route_int_export_v4 {
|
||||||
route 44.32.191.0/24 reject;
|
route 44.32.191.0/24 reject;
|
||||||
ipv4 {
|
ipv4 {
|
||||||
@@ -18,12 +12,6 @@ protocol static route_int_export_v4 {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_self_net_v6() {
|
|
||||||
return net ~ [
|
|
||||||
2406:840:e600::/44{44,48}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
protocol static route_int_export_v6 {
|
protocol static route_int_export_v6 {
|
||||||
route 2406:840:e602::/48 reject;
|
route 2406:840:e602::/48 reject;
|
||||||
route 2406:840:e604::/48 reject;
|
route 2406:840:e604::/48 reject;
|
||||||
|
|||||||
13
bird/conf/inet_func.conf
Normal file
13
bird/conf/inet_func.conf
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
function is_self_net() {
|
||||||
|
return net ~ [
|
||||||
|
44.32.191.0/24
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function is_self_net_v6() {
|
||||||
|
return net ~ [
|
||||||
|
2406:840:e600::/44{44,48},
|
||||||
|
2a0f:1cc5:10::/44{44,48}
|
||||||
|
];
|
||||||
|
}
|
||||||
13
bird/conf/inet_ixp.conf
Normal file
13
bird/conf/inet_ixp.conf
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
protocol static route_int_export_ixp_v6 {
|
||||||
|
route 2406:840:e600::/44 reject;
|
||||||
|
ipv6 {
|
||||||
|
table inet6;
|
||||||
|
import filter {
|
||||||
|
bgp_large_community.add((LOCAL_ASN,3,0));
|
||||||
|
bgp_large_community.add((LOCAL_ASN,1,0));
|
||||||
|
bgp_large_community.add((LOCAL_ASN,200,1));
|
||||||
|
accept;
|
||||||
|
};
|
||||||
|
export none;
|
||||||
|
};
|
||||||
|
}
|
||||||
21
bird/template/inet_ixp.conf
Normal file
21
bird/template/inet_ixp.conf
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
template bgp tpl_inet6_ixp {
|
||||||
|
graceful restart;
|
||||||
|
local as LOCAL_ASN;
|
||||||
|
ipv6 {
|
||||||
|
table inet6;
|
||||||
|
import filter {
|
||||||
|
if is_self_net_v6() then reject;
|
||||||
|
if is_bogon_prefix() || (bgp_path.len > 100) then reject;
|
||||||
|
accept;
|
||||||
|
};
|
||||||
|
export filter {
|
||||||
|
if !is_self_net_v6() then reject;
|
||||||
|
if is_bogon_prefix() || (bgp_path.len > 100) then reject;
|
||||||
|
if bgp_large_community !~ [(LOCAL_ASN, 200,1)] then reject;
|
||||||
|
bgp_large_community.delete((LOCAL_ASN,3,*));
|
||||||
|
bgp_large_community.delete((LOCAL_ASN,1,*));
|
||||||
|
bgp_large_community.delete((LOCAL_ASN,200,*));
|
||||||
|
accept;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -2,14 +2,13 @@
|
|||||||
|
|
||||||
cd
|
cd
|
||||||
git clone https://git.nia.ink/brnet/bird_config.git
|
git clone https://git.nia.ink/brnet/bird_config.git
|
||||||
rm -rf /etc/bird/net
|
mv bird_config/bird/conf/inet_func.conf /etc/bird/conf/
|
||||||
mv bird_config/bird/net /etc/bird/
|
mv bird_config/bird/conf/inet_ixp.conf /etc/bird/conf/
|
||||||
rm -rf /etc/bird/bird.conf
|
mv bird_config/bird/template/inet_ixp.confbird.conf /etc/bird/template
|
||||||
mv bird_config/bird/bird.conf /etc/bird/
|
|
||||||
|
|
||||||
chmod -R 755 /etc/bird
|
chmod -R 755 /etc/bird
|
||||||
|
|
||||||
echo "如有需要,可以birdc c"
|
echo "老规矩哈"
|
||||||
cd
|
cd
|
||||||
rm -rf bird_config
|
rm -rf bird_config
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user