diff --git a/bird/filter/inet_upstream1.conf b/bird/filter/inet_upstream1.conf index c4d978d..805ae1b 100644 --- a/bird/filter/inet_upstream1.conf +++ b/bird/filter/inet_upstream1.conf @@ -4,18 +4,17 @@ function function_inet_bgp_export_to_upstream1() { if source !~ [RTS_STATIC, RTS_BGP] then return false; if is_bogon_prefix() then return false; - if bgp_large_community !~ [(LOCAL_ASN, 200, 0)] then return false; # 100禁止性过滤 if bgp_large_community ~ [(LOCAL_ASN, 100, 100)] then return false; if bgp_large_community ~ [(LOCAL_ASN, 100, 200)] then return false; if bgp_large_community ~ [(LOCAL_ASN, 200, 202)] then return false; - if source !~ [RTS_STATIC] then { + if source =RTS_STATIC then { # 静态路由,允许 200,[0 2] if bgp_large_community ~ [(LOCAL_ASN, 200, 0)] then return true; if bgp_large_community ~ [(LOCAL_ASN, 200, 2)] then return true; if bgp_large_community ~ [(LOCAL_ASN, 200, 1)] then return false; } - if source !~ [RTS_BGP] then { + if source = RTS_BGP then { # BGP路由,允许 300,0 if bgp_large_community ~ [(LOCAL_ASN, 300, 0)] then return true; } diff --git a/bird/function/inet.conf b/bird/function/inet.conf index e4b310b..1dc7e3d 100644 --- a/bird/function/inet.conf +++ b/bird/function/inet.conf @@ -2,6 +2,6 @@ function is_self_net() { case net.type { NET_IP4: return net ~ is_inet_self_IPv4; NET_IP6: return net ~ is_inet_self_IPv6; - else: print "is_dn42_prefix: unexpected net.type ", net.type, " ", net; return false; + else: print "is_inet_prefix: unexpected net.type ", net.type, " ", net; return false; } } \ No newline at end of file diff --git a/update.sh b/update.sh index 93a3aa7..93adf1b 100644 --- a/update.sh +++ b/update.sh @@ -3,24 +3,15 @@ cd git clone https://git.nia.ink/brnet/bird_config.git -cp /etc/bird/ /etc/bird.old/ -r +rm /etc/bird.old/ -r -rm /etc/bird/filter -rf -mv ./bird_config/bird/filter /etc/bird/filter +rm /etc/bird/filter/inet_upstream1.conf +mv ./bird_config/bird/filter/inet_upstream1.conf /etc/bird/filter/inet_upstream1.conf -rm /etc/bird/whitelist -rf -mv ./bird_config/bird/whitelist /etc/bird/whitelist +rm /etc/bird/function/inet.conf +mv ./bird_config/bird/function/inet.conf /etc/bird/function/inet.conf -rm /etc/bird/template -rf -mv ./bird_config/bird/template /etc/bird/template - -rm /etc/bird/function -rf -mv ./bird_config/bird/function /etc/bird/function - -chmod -R 755 /etc/bird -chmod +x /etc/bird/whitelist/downmyip.sh - -# birdc c +birdc c cd rm -rf bird_config