master #2
@@ -31,7 +31,22 @@ protocol kernel {
|
|||||||
krt_prefsrc = UNET_V4_kernel;
|
krt_prefsrc = UNET_V4_kernel;
|
||||||
accept;
|
accept;
|
||||||
}
|
}
|
||||||
|
reject;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# echo "102 ipv4_pub" >> /etc/iproute2/rt_tables
|
||||||
|
protocol kernel {
|
||||||
|
scan time 20;
|
||||||
|
kernel table 102;
|
||||||
|
ipv4 {
|
||||||
|
table inet4;
|
||||||
|
import none;
|
||||||
|
export filter {
|
||||||
|
if source = RTS_STATIC then reject;
|
||||||
if !is_bogon_prefix() then {
|
if !is_bogon_prefix() then {
|
||||||
|
if bgp_large_community ~ [(LOCAL_ASN, 3,*)] then reject;
|
||||||
krt_prefsrc = LOCAL_V4_kernel;
|
krt_prefsrc = LOCAL_V4_kernel;
|
||||||
accept;
|
accept;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,15 +15,15 @@ protocol pipe inet6_sync {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protocol pipe inet4_sync {
|
#protocol pipe inet4_sync {
|
||||||
table inet4;
|
# table inet4;
|
||||||
peer table master4;
|
# peer table master4;
|
||||||
import none;
|
# import none;
|
||||||
export filter {
|
# export filter {
|
||||||
if bgp_large_community ~ [(LOCAL_ASN, 3,*)] then reject;
|
# if bgp_large_community ~ [(LOCAL_ASN, 3,*)] then reject;
|
||||||
accept;
|
# accept;
|
||||||
};
|
# };
|
||||||
}
|
#}
|
||||||
|
|
||||||
protocol pipe unet4_sync {
|
protocol pipe unet4_sync {
|
||||||
table unet4;
|
table unet4;
|
||||||
|
|||||||
22
update.sh
Normal file
22
update.sh
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
TABLE_NAME="ipv4_pub"
|
||||||
|
TABLE_ID=102
|
||||||
|
RT_TABLES="/etc/iproute2/rt_tables"
|
||||||
|
|
||||||
|
if ! grep -q "^${TABLE_ID}[[:space:]]\+${TABLE_NAME}" "$RT_TABLES"; then
|
||||||
|
echo "添加路由表 $TABLE_NAME(编号$TABLE_ID)..."
|
||||||
|
echo "${TABLE_ID} ${TABLE_NAME}" >> "$RT_TABLES"
|
||||||
|
else
|
||||||
|
echo "路由表 $TABLE_NAME 已存在,无需创建"
|
||||||
|
fi
|
||||||
|
|
||||||
|
git clone git@ssh.git.nia.ink:brnet/bird_config.git
|
||||||
|
rm /etc/bird/bird.conf
|
||||||
|
rm /etc/bird/function/tables.conf
|
||||||
|
|
||||||
|
mv bird_config/bird.conf /etc/bird/bird.conf
|
||||||
|
mv bird_config/function/tables.conf /etc/bird/function/tables.conf
|
||||||
|
rm -rf bird_config
|
||||||
|
|
||||||
|
birdc c
|
||||||
Reference in New Issue
Block a user