From 7510834a1e0c3f32a7f4c5bb4a2917196033da55 Mon Sep 17 00:00:00 2001 From: daxi20 Date: Sat, 8 Nov 2025 21:38:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0INET=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E6=A0=88=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bird/net/inet.conf | 17 +++++++++++++++-- bird/peers/inet/ebgp.conf | 9 +++++++++ bird/peers/inet/ibgp.conf | 7 ++++++- bird/peers/unet/ebgp.conf | 9 +++++++++ bird/peers/unet/ibgp.conf | 2 +- update.sh | 6 ++---- 6 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 bird/peers/inet/ebgp.conf create mode 100644 bird/peers/unet/ebgp.conf diff --git a/bird/net/inet.conf b/bird/net/inet.conf index d631211..976f67e 100644 --- a/bird/net/inet.conf +++ b/bird/net/inet.conf @@ -1,4 +1,4 @@ -template bgp tpl_bgp_up { +template bgp tpl_inet4_up { graceful restart; local as LOCAL_ASN; ipv4 { @@ -19,6 +19,11 @@ template bgp tpl_bgp_up { accept; }; }; +} + +template bgp tpl_inet6_up { + graceful restart; + local as LOCAL_ASN; ipv6 { table inet6; import filter { @@ -39,7 +44,7 @@ template bgp tpl_bgp_up { }; } -template bgp tpl_ibgp { +template bgp tpl_inet4_ibgp { graceful restart; local as LOCAL_ASN; med metric; @@ -61,6 +66,13 @@ template bgp tpl_ibgp { accept; }; }; +} + +template bgp tpl_inet6_ibgp { + graceful restart; + local as LOCAL_ASN; + med metric; + direct; ipv6 { table inet6; next hop self; @@ -79,4 +91,5 @@ template bgp tpl_ibgp { }; }; } + include "/etc/bird/peers/inet/*"; \ No newline at end of file diff --git a/bird/peers/inet/ebgp.conf b/bird/peers/inet/ebgp.conf new file mode 100644 index 0000000..5c33d24 --- /dev/null +++ b/bird/peers/inet/ebgp.conf @@ -0,0 +1,9 @@ +protocol bgp bgp_int_44324_v4 from tpl_inet4_up { + source address 10.188.6.1; + neighbor 10.188.6.2 as 44324; +} + +protocol bgp bgp_int_44324_v6 from tpl_inet6_up { + source address fe80:1::2; + neighbor fe80:1::1%wg_40005 as 44324; +} \ No newline at end of file diff --git a/bird/peers/inet/ibgp.conf b/bird/peers/inet/ibgp.conf index 9a2a954..55f835a 100644 --- a/bird/peers/inet/ibgp.conf +++ b/bird/peers/inet/ibgp.conf @@ -1,4 +1,9 @@ -protocol bgp int_ibgp_zj1 from tpl_ibgp { +protocol bgp ibgp_int_zj1_v6 from tpl_inet6_ibgp { source address fe80:1::2; neighbor fe80:1::1%wg_40005 as LOCAL_ASN; +} + +protocol bgp ibgp_int_zj1_v4 from tpl_inet4_ibgp { + source address 10.188.1.1; + neighbor 10.188.1.2 as LOCAL_ASN; } \ No newline at end of file diff --git a/bird/peers/unet/ebgp.conf b/bird/peers/unet/ebgp.conf new file mode 100644 index 0000000..1341dff --- /dev/null +++ b/bird/peers/unet/ebgp.conf @@ -0,0 +1,9 @@ +protocol bgp bgp_unet_hk2 from unet_bgp_up0 { + source address fe80:15:3376:3::2:2; + neighbor fe80:15:3376:3::3:2%pccw1 as 4218818801; +} + +protocol bgp bgp_unet_hk3 from unet_bgp_up1 { + source address fe80:15:3376:3::2:2; + neighbor fe80:15:3376:3::3:2%pccw1 as 4218818802; +} \ No newline at end of file diff --git a/bird/peers/unet/ibgp.conf b/bird/peers/unet/ibgp.conf index f02aa48..20d8cbe 100644 --- a/bird/peers/unet/ibgp.conf +++ b/bird/peers/unet/ibgp.conf @@ -1,4 +1,4 @@ -protocol bgp unet_ibgp_hk1 from unet_ibgp { +protocol bgp ibgp_unet_hk1 from unet_ibgp { source address fe80:15:3376:3::2:2; neighbor fe80:15:3376:3::3:2%pccw1 as UNET_ASN; } \ No newline at end of file diff --git a/update.sh b/update.sh index bf211ea..7293c65 100644 --- a/update.sh +++ b/update.sh @@ -1,13 +1,11 @@ #!/bin/bash -rm /etc/bird/net/unet.conf -curl https://git.nia.ink/brnet/bird_config/raw/branch/master/bird/net/unet.conf > /etc/bird/net/unet.conf - rm /etc/bird/net/inet.conf curl https://git.nia.ink/brnet/bird_config/raw/branch/master/bird/net/inet.conf > /etc/bird/net/inet.conf chmod -R 755 /etc/bird -birdc c +echo "请更新peers/inet的全部配置信息,再birdc c" + cd rm update.sh \ No newline at end of file