diff --git a/bird/conf/mynet.conf b/bird/conf/mynet.conf index 4c9f064..4fc6c90 100644 --- a/bird/conf/mynet.conf +++ b/bird/conf/mynet.conf @@ -1,61 +1,18 @@ -function is_self_net() { - return net ~ [ - 44.32.191.0/24 - ]; -} - -protocol static route_int_export_v4 { - route 44.32.191.0/24 reject; - ipv4 { - table inet4; - 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,0)); - accept; - }; - export none; - }; -} - -function is_self_net_v6() { - return net ~ [ - 2406:840:e600::/44{44,48}, - 2a14:7580:9600::/40{40,48} - ]; -} - -protocol static route_int_export_v6 { - route 2406:840:e600::/48 reject; - route 2406:840:e601::/48 reject; - route 2406:840:e608::/46 reject; - route 2a14:7580:9600::/47 reject; - route 2a14:7580:9603::/48 reject; - route 2a14:7580:9604::/48 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,0)); - accept; - }; - export none; - }; -} - function unet_is_self_net() { return net ~ [ - 10.188.2.0/23+, - 10.188.11.0/24, - 172.20.21.0/29 + 10.188.6.0/23+, + 10.188.5.124/30, + 44.32.191.16/28, + 44.32.191.7/32 ]; } protocol static route_unet_export_v4 { - route 10.188.2.0/23 reject; - route 10.188.11.0/24 reject; + route 10.188.6.0/23 reject; + route 10.188.5.124/30 reject; + route 44.32.191.16/28 reject; + route 44.32.191.7/32 reject; ipv4 { table unet4; import filter { @@ -71,12 +28,14 @@ protocol static route_unet_export_v4 { function unet_is_self_net_v6() { return net ~ [ - 2406:840:e601::/48{48,56} + 2406:840:e603::/48{48,56}, + 2406:840:e60e::/56 ]; } protocol static route_unet_export_v6 { - route 2406:840:e601::/48 reject; + route 2406:840:e603::/48 reject; + route 2406:840:e60e::/56 reject; ipv6 { table unet6; import filter { diff --git a/bird/conf/pub.conf b/bird/conf/pub.conf new file mode 100644 index 0000000..4951250 --- /dev/null +++ b/bird/conf/pub.conf @@ -0,0 +1,41 @@ +function is_self_net() { + return net ~ [ + 44.32.191.0/24 + ]; +} + +protocol static route_int_export_v4 { + route 44.32.191.0/24 reject; + ipv4 { + table inet4; + 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,0)); + accept; + }; + export none; + }; +} + +function is_self_net_v6() { + return net ~ [ + 2406:840:e600::/44{44,48} + ]; +} + +protocol static route_int_export_v6 { + route 2406:840:e602::/48 reject; + route 2406:840:e604::/48 reject; + route 2406:840:e606::/48 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,0)); + accept; + }; + export none; + }; +} \ No newline at end of file diff --git a/bird/net/ospf.conf b/bird/net/ospf.conf.disable similarity index 100% rename from bird/net/ospf.conf rename to bird/net/ospf.conf.disable diff --git a/bird/peers/inet/ibgp.conf b/bird/peers/inet/ibgp.conf index 0171c30..9a2a954 100644 --- a/bird/peers/inet/ibgp.conf +++ b/bird/peers/inet/ibgp.conf @@ -1,4 +1,4 @@ -protocol bgp int_ibgp_hk1 from tpl_ibgp { - source address fe80:15:3376:3::2:1; - neighbor fe80:15:3376:3::3:1%pccw1 as LOCAL_ASN; +protocol bgp int_ibgp_zj1 from tpl_ibgp { + source address fe80:1::2; + neighbor fe80:1::1%wg_40005 as LOCAL_ASN; } \ No newline at end of file diff --git a/bird/vars.conf b/bird/vars.conf index 9d4c024..b041e01 100644 --- a/bird/vars.conf +++ b/bird/vars.conf @@ -1,8 +1,8 @@ define LOCAL_ASN = 153376; -define LOCAL_V4_kernel = 10.188.2.3; -define LOCAL_V6_kernel = 2406:840:e601:1::1; +define LOCAL_V4_kernel = 44.32.191.7; +define LOCAL_V6_kernel = 2406:840:e603::1; -define UNET_ASN = 4218818804; -define UNET_V4_kernel = 10.188.2.3; +define UNET_ASN = 4218818801; +define UNET_V4_kernel = 10.188.6.2; -router id 154.37.212.38; \ No newline at end of file +router id 10.188.6.2; \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..242cab7 --- /dev/null +++ b/readme.md @@ -0,0 +1,28 @@ +# 这里是UNET推荐使用的bird配置文件 + +## 目录格式 + + -- bird + -- bird/var.conf # 配置节点基本信息 + -- bird/bird.conf + -- bird/envvars + -- bird/conf/ # 存放节点宣告IP机制 + -- bird/function/ # 存放基本函数、表配置项和其他公共部分 + -- bird/net/ # 定义网络模板 + -- bird/peers/ # 存放对等体的配置信息 + +## 公共配置目录 + + -- bird/function/ + -- bird/net/ # (可按需要disable) + -- bird/bird.conf + +## 快速应用 + + cd + git clone https://git.nia.ink/brnet/bird_config.git + rm -rf /etc/bird + mv bird_config/bird /etc/ + +## 注意 +请务必修改下在输入birdc c \ No newline at end of file