From 8ed9e13f2bfc78c4fe00ca88b43b3372ade466d2 Mon Sep 17 00:00:00 2001 From: daxi20 Date: Wed, 26 Nov 2025 20:25:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86=E7=BC=93=E5=86=B2?= =?UTF-8?q?=E5=8C=BA=E8=AE=BE=E7=BD=AE=E9=80=89=E9=A1=B9=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E9=83=A8=E5=88=86=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bird/bird.conf | 9 +++++++-- bird/net/inet4.conf | 2 ++ bird/net/inet6.conf | 2 +- bird/net/ospf.conf | 2 ++ bird/net/unet.conf | 2 ++ update.sh | 14 +++++--------- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/bird/bird.conf b/bird/bird.conf index ea0ec3b..930bcec 100644 --- a/bird/bird.conf +++ b/bird/bird.conf @@ -2,12 +2,16 @@ include "/etc/bird/vars.conf"; include "/etc/bird/function/*.conf"; include "/etc/bird/conf/*.conf"; +log "/var/log/bird.log" {info, warning, error}; + protocol device { scan time 10; -} +}; protocol kernel { scan time 20; + merge paths yes limit 4; + netlink rx buffer 8388608; ipv6 { import none; export filter { @@ -23,11 +27,12 @@ protocol kernel { protocol kernel { scan time 20; + merge paths yes limit 4; ipv4 { import none; export filter { if source = RTS_STATIC then reject; - if unet_is_valid_network_v4() then { # 检查UNET自有网段 + if unet_is_valid_network_v4() then { krt_prefsrc = UNET_V4_kernel; accept; } diff --git a/bird/net/inet4.conf b/bird/net/inet4.conf index 873c96e..6e1031b 100644 --- a/bird/net/inet4.conf +++ b/bird/net/inet4.conf @@ -1,6 +1,8 @@ protocol kernel { scan time 20; kernel table 102; + merge paths yes limit 4; + netlink rx buffer 8388608; ipv4 { table inet4; import none; diff --git a/bird/net/inet6.conf b/bird/net/inet6.conf index 69c94dd..9d00e1e 100644 --- a/bird/net/inet6.conf +++ b/bird/net/inet6.conf @@ -1,9 +1,9 @@ protocol pipe inet6_sync { table inet6; peer table master6; - import none; export filter { if bgp_large_community ~ [(LOCAL_ASN, 3,*)] then reject; accept; }; + import none; } \ No newline at end of file diff --git a/bird/net/ospf.conf b/bird/net/ospf.conf index 03b56e2..e178521 100644 --- a/bird/net/ospf.conf +++ b/bird/net/ospf.conf @@ -5,6 +5,7 @@ protocol pipe ospf4_sync { if bgp_large_community ~ [(UNET_ASN, 3,*)] then reject; accept; }; + import none; } protocol pipe ospf6_sync { @@ -14,6 +15,7 @@ protocol pipe ospf6_sync { if bgp_large_community ~ [(UNET_ASN, 3,*)] then reject; accept; }; + import none; } include "/etc/bird/peers/ospf/*.conf"; diff --git a/bird/net/unet.conf b/bird/net/unet.conf index ad13d58..75fa550 100644 --- a/bird/net/unet.conf +++ b/bird/net/unet.conf @@ -5,6 +5,7 @@ protocol pipe unet4_sync { if bgp_large_community ~ [(UNET_ASN, 3,*)] then reject; accept; }; + import none; } protocol pipe unet6_sync { table unet6; @@ -13,4 +14,5 @@ protocol pipe unet6_sync { if bgp_large_community ~ [(UNET_ASN, 3,*)] then reject; accept; }; + import none; } \ No newline at end of file diff --git a/update.sh b/update.sh index 339edda..b771b4b 100644 --- a/update.sh +++ b/update.sh @@ -2,18 +2,14 @@ cd git clone https://git.nia.ink/brnet/bird_config.git -mv /etc/bird /etc/bird.old -mv bird_config/bird /etc/ -rm -rf /etc/bird/peers -cp -r /etc/bird.old/peers /etc/bird/ -rm -rf /etc/bird/conf -cp -r /etc/bird.old/conf /etc/bird/ -rm /etc/bird/vars.conf -cp /etc/bird.old/vars.conf /etc/bird/vars.conf.dis +rm -rf /etc/bird/net +mv bird_config/bird/net /etc/bird/ +rm -rf /etc/bird/bird.conf +mv bird_config/bird/bird.conf /etc/bird/ chmod -R 755 /etc/bird -echo "请务必检查配置文件,修改vars文件名,并重新启动bird" +birdc c cd rm -rf bird_config