From 9ea90865a85db0e8e4a4744cc3fef30d01795d30 Mon Sep 17 00:00:00 2001 From: Myer921 Date: Mon, 24 Aug 2020 16:34:50 +0800 Subject: [PATCH 01/25] push ip (icecat->cain) --- route/AS4201270005.toml | 5 ----- route/AS4201270017.toml | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/route/AS4201270005.toml b/route/AS4201270005.toml index aed54e7..a0ece05 100644 --- a/route/AS4201270005.toml +++ b/route/AS4201270005.toml @@ -3,11 +3,6 @@ type = "subnet" name = "Icecat Residential network occupation address" description = "For Mobile device internal network segment for testing connectivity quality, No SLA(=172.24.5.0/24)" -["10.127.236.0/24"] -type = "subnet" -name = "MagicNeko VPN" -description = "For Magicneko Explosion Network Interworking address, No SLA" - ["fd10:127:0233:1c3c::/64"] type = "subnet" name = "icecat" diff --git a/route/AS4201270017.toml b/route/AS4201270017.toml index 1747852..d37358f 100644 --- a/route/AS4201270017.toml +++ b/route/AS4201270017.toml @@ -8,6 +8,11 @@ type = "subnet" name = "Icecat Global Tunnel Address (OpenVPN)" description = "For Magicneko Explosion Network Interworking address, No SLA" +["10.127.236.0/24"] +type = "subnet" +name = "MagicNeko VPN" +description = "For Magicneko Explosion Network Interworking address, No SLA" + ["fd10:127:0234::/48"] type = "subnet" name = "CainSakura-home-devices" From 804f4e37317604fcae77f9ef54d970d412a87094 Mon Sep 17 00:00:00 2001 From: SteveYi Date: Sat, 29 Aug 2020 22:35:45 +0800 Subject: [PATCH 02/25] Create AS4242421214.toml --- asn/AS4242421214.toml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 asn/AS4242421214.toml diff --git a/asn/AS4242421214.toml b/asn/AS4242421214.toml new file mode 100644 index 0000000..ffc3bf1 --- /dev/null +++ b/asn/AS4242421214.toml @@ -0,0 +1,2 @@ +name = "Yi-Network" +owner = "SteveYi" From 0476e0b9363379c8714c4f7aa233640356389ef5 Mon Sep 17 00:00:00 2001 From: SteveYi Date: Sat, 29 Aug 2020 22:36:27 +0800 Subject: [PATCH 03/25] Create AS4242421214.toml --- route/AS4242421214.toml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 route/AS4242421214.toml diff --git a/route/AS4242421214.toml b/route/AS4242421214.toml new file mode 100644 index 0000000..08efbd2 --- /dev/null +++ b/route/AS4242421214.toml @@ -0,0 +1,4 @@ +["10.127.124.0/29"] +type = "subnet" +name = "Yi Global VPN" +description = "SteveYi's VPS IP, for JP,TW,US...and more country's vps" From b34b031ce6d27fe1f6dbdb78f58592202268df5d Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 29 Aug 2020 23:22:55 +0800 Subject: [PATCH 04/25] roa.py: allow same net different asns, as long as those asns are owned by the same entity dns-reverse-generator.py: add newline --- scripts/dns-reverse-generator.py | 2 +- scripts/roa.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/dns-reverse-generator.py b/scripts/dns-reverse-generator.py index 9b18e5b..d7aa65e 100755 --- a/scripts/dns-reverse-generator.py +++ b/scripts/dns-reverse-generator.py @@ -29,7 +29,7 @@ def main(): if isinstance(address, IPv4Address): pointer = address.reverse_pointer.replace(".127.10.in-addr.arpa", "") records.append("%s\tIN\tPTR\t%s.neo." % (pointer, name)) - RESOLVE_FILE.write_text("\n".join(records)) + RESOLVE_FILE.write_text("\n".join(records)+"\n") if __name__ == "__main__": diff --git a/scripts/roa.py b/scripts/roa.py index 2566941..c2b3876 100755 --- a/scripts/roa.py +++ b/scripts/roa.py @@ -122,7 +122,8 @@ def route_to_roa(asn_table: dict): ): if not net1["prefix"].overlaps(net2["prefix"]): continue - assert net1["prefix"] != net2["prefix"] + entity_from_net = lambda net: asn_table.get(net["asn"])["owner"] + assert net1["prefix"] != net2["prefix"] or (net1['asn'] != net2['asn'] and entity_from_net(net1) == entity_from_net(net2)) assert net1["prefix"].supernet_of(net2["prefix"]) s1net, s2net = (net1["supernet"], net2["supernet"]) assert s2net # please include supernet = in your route From 9793b64b1a6842d965ad94fa4c0fa63c90f232ca Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 29 Aug 2020 23:32:03 +0800 Subject: [PATCH 05/25] roa.py: fix --- scripts/roa.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/roa.py b/scripts/roa.py index c2b3876..78e3ed8 100755 --- a/scripts/roa.py +++ b/scripts/roa.py @@ -123,7 +123,11 @@ def route_to_roa(asn_table: dict): if not net1["prefix"].overlaps(net2["prefix"]): continue entity_from_net = lambda net: asn_table.get(net["asn"])["owner"] - assert net1["prefix"] != net2["prefix"] or (net1['asn'] != net2['asn'] and entity_from_net(net1) == entity_from_net(net2)) + try: + assert net1["prefix"] != net2["prefix"] + except AssertionError: + assert net1['asn'] != net2['asn'] and entity_from_net(net1) == entity_from_net(net2) + continue assert net1["prefix"].supernet_of(net2["prefix"]) s1net, s2net = (net1["supernet"], net2["supernet"]) assert s2net # please include supernet = in your route From 692237a99c2eef6d51bfaeac92335c2e53772910 Mon Sep 17 00:00:00 2001 From: Septs Date: Sat, 29 Aug 2020 23:40:10 +0800 Subject: [PATCH 06/25] replace `.scripts` to `scripts` --- .github/workflows/roa.yml | 6 +++--- .github/workflows/test-your-pr.yml | 4 ++-- .scripts | 1 - scripts/generate-roa.sh | 16 ++++++++-------- 4 files changed, 13 insertions(+), 14 deletions(-) delete mode 120000 .scripts diff --git a/.github/workflows/roa.yml b/.github/workflows/roa.yml index 2349c25..b433206 100644 --- a/.github/workflows/roa.yml +++ b/.github/workflows/roa.yml @@ -26,13 +26,13 @@ jobs: python-version: 3.x architecture: x64 - - run: pip install -r .scripts/requirements.txt + - run: pip install -r scripts/requirements.txt - - run: .scripts/generate-roa.sh + - run: scripts/generate-roa.sh - run: git -C generated diff README.md - - run: .scripts/push-to-roa.sh + - run: scripts/push-to-roa.sh - uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/test-your-pr.yml b/.github/workflows/test-your-pr.yml index 84cb7e9..a17b536 100644 --- a/.github/workflows/test-your-pr.yml +++ b/.github/workflows/test-your-pr.yml @@ -24,9 +24,9 @@ jobs: python-version: 3.x architecture: x64 - - run: pip install -r .scripts/requirements.txt + - run: pip install -r scripts/requirements.txt - - run: .scripts/generate-roa.sh + - run: scripts/generate-roa.sh - run: git -C generated diff README.md diff --git a/.scripts b/.scripts deleted file mode 120000 index 528dc4e..0000000 --- a/.scripts +++ /dev/null @@ -1 +0,0 @@ -scripts \ No newline at end of file diff --git a/scripts/generate-roa.sh b/scripts/generate-roa.sh index 9b1d6d8..251e3ce 100755 --- a/scripts/generate-roa.sh +++ b/scripts/generate-roa.sh @@ -11,13 +11,13 @@ export MAX_LEN_6=64 mkdir -p generated mkdir -p generated/dns -.scripts/dns-reverse-generator.py +scripts/dns-reverse-generator.py cp -R dns/* generated/dns -.scripts/roa.py -m "$MAX_LEN_4" -M "$MAX_LEN_6" -o generated/roa46_bird2.conf -.scripts/roa.py -m "$MAX_LEN_4" -M "$MAX_LEN_6" -4 -o generated/roa4_bird2.conf -.scripts/roa.py -m "$MAX_LEN_4" -M "$MAX_LEN_6" -6 -o generated/roa6_bird2.conf -.scripts/roa.py -m "$MAX_LEN_4" -M "$MAX_LEN_6" -j -o generated/roa46.json -.scripts/roa.py -m "$MAX_LEN_4" -M "$MAX_LEN_6" -e -o generated/neonetwork.json -.scripts/roa.py -m "$MAX_LEN_4" -M "$MAX_LEN_6" -r -o generated/rfc8416.json -.scripts/roa.py --summary --output generated/README.md +scripts/roa.py -m "$MAX_LEN_4" -M "$MAX_LEN_6" -o generated/roa46_bird2.conf +scripts/roa.py -m "$MAX_LEN_4" -M "$MAX_LEN_6" -4 -o generated/roa4_bird2.conf +scripts/roa.py -m "$MAX_LEN_4" -M "$MAX_LEN_6" -6 -o generated/roa6_bird2.conf +scripts/roa.py -m "$MAX_LEN_4" -M "$MAX_LEN_6" -j -o generated/roa46.json +scripts/roa.py -m "$MAX_LEN_4" -M "$MAX_LEN_6" -e -o generated/neonetwork.json +scripts/roa.py -m "$MAX_LEN_4" -M "$MAX_LEN_6" -r -o generated/rfc8416.json +scripts/roa.py --summary --output generated/README.md From 795bbf37a685199034410855ca1b761eee379963 Mon Sep 17 00:00:00 2001 From: Jerry Date: Mon, 14 Sep 2020 17:31:37 +0800 Subject: [PATCH 07/25] add jerryxiao-school --- route/AS4201270006.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/route/AS4201270006.toml b/route/AS4201270006.toml index d018061..9e75395 100644 --- a/route/AS4201270006.toml +++ b/route/AS4201270006.toml @@ -8,6 +8,11 @@ type = "subnet" name = "JerryXiao-Home" description = "For home" +["10.127.8.64/26"] +type = "subnet" +name = "JerryXiao-School" +description = "For school" + ["10.127.255.53/32"] type = "loopback" name = "JerryXiao-Anycast" From 3e41d17c5930f38f88efbd547049c3f80906142b Mon Sep 17 00:00:00 2001 From: "Staph. aureus" Date: Fri, 18 Sep 2020 23:27:39 -0400 Subject: [PATCH 08/25] Update ROA Tries to also provide 10.127.255.2 DNS service --- route/AS4201270007.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/route/AS4201270007.toml b/route/AS4201270007.toml index b0db468..ba4925a 100644 --- a/route/AS4201270007.toml +++ b/route/AS4201270007.toml @@ -8,6 +8,11 @@ type = "subnet" name = "AOSCNet" description = "AOSC BuildBot Interconnection" +["10.127.255.2/32"] +type = "loopback" +name = "staphdns" +description = "Bind9 DNS" + ["fd10:127:7::/51"] type = "subnet" name = "Staph_v6" From 626607b3b6568bf10df2c3f03760a0170a852665 Mon Sep 17 00:00:00 2001 From: "Staph. aureus" Date: Fri, 18 Sep 2020 23:32:41 -0400 Subject: [PATCH 09/25] Temporarily change ROA neovax has been modified to 53 so I can take 2 while sorting out how to get ROA working with Anycast --- route/AS4201270000.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/route/AS4201270000.toml b/route/AS4201270000.toml index 86e62bc..2db491a 100644 --- a/route/AS4201270000.toml +++ b/route/AS4201270000.toml @@ -27,7 +27,7 @@ type = "loopback" name = "NeoPDP-11" description = "FreeBSD/frr" -["10.127.255.2/32"] +["10.127.255.53/32"] type = "loopback" name = "ucbvax" description = "Arch Linux/frr" From 404417b35a85134337f2571c2e2220449ec2c029 Mon Sep 17 00:00:00 2001 From: "Staph. aureus" Date: Fri, 18 Sep 2020 23:40:04 -0400 Subject: [PATCH 10/25] Still trying to fix the ROA --- route/AS4201270000.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/route/AS4201270000.toml b/route/AS4201270000.toml index 2db491a..b26dc79 100644 --- a/route/AS4201270000.toml +++ b/route/AS4201270000.toml @@ -27,7 +27,7 @@ type = "loopback" name = "NeoPDP-11" description = "FreeBSD/frr" -["10.127.255.53/32"] +["10.127.255.50/32"] type = "loopback" name = "ucbvax" description = "Arch Linux/frr" From 22e7d81a96374c2c68486c375e2a34152723d1ec Mon Sep 17 00:00:00 2001 From: "Staph. aureus" Date: Fri, 18 Sep 2020 23:43:53 -0400 Subject: [PATCH 11/25] Attempt with Anycast ROA --- route/AS4201270007.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/route/AS4201270007.toml b/route/AS4201270007.toml index ba4925a..83dbd84 100644 --- a/route/AS4201270007.toml +++ b/route/AS4201270007.toml @@ -13,6 +13,11 @@ type = "loopback" name = "staphdns" description = "Bind9 DNS" +["10.127.255.53/32"] +type = "anycast" +name = "staphdns" +description = "Bind9 DNS" + ["fd10:127:7::/51"] type = "subnet" name = "Staph_v6" From a35b5b2bab3be5ce0f808d582459787f839913f1 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 19 Sep 2020 12:45:50 +0800 Subject: [PATCH 12/25] [skip ci] update nodes.svg --- nodes.dot | 3 +- nodes.svg | 579 +++++++++++++++++++++++++++--------------------------- 2 files changed, 287 insertions(+), 295 deletions(-) diff --git a/nodes.dot b/nodes.dot index 81bb371..a88dde4 100644 --- a/nodes.dot +++ b/nodes.dot @@ -29,7 +29,7 @@ digraph "NeoNetwork Nodes" JerryXiao_HK02 [label="jerryxiao-hk02\n(10.127.8.196)"] septs [label="bgp.septs.me\n(AS4201270001)"] lantian [label="lantian\n(AS4201270010)"] - dfceaef [label="dfceaef\n(10.127.8.64/26)\n(AS4242420140)"] + dfceaef [label="dfceaef\n(10.127.12.0/24)\n(AS4242420140)"] SUNNET [label="SUNNET\n(10.127.11.0/24)\n(AS4242423088)"] santost12 [label="Santost12\n(10.127.69.1)\n(AS4201270009)"] frank_hsinchu [label="Frank_Hsinchu\n(10.127.255.56)\n(AS4201270004)"] @@ -82,7 +82,6 @@ digraph "NeoNetwork Nodes" } JerryXiao -> ucbvax [dir=both] - JerryXiao -> septs [dir=both] JerryXiao_SH01 -> dfceaef [dir=both] magicneko_JP03 -> JerryXiao [dir=both] lantian -> septs [dir=both] diff --git a/nodes.svg b/nodes.svg index a165937..465004c 100644 --- a/nodes.svg +++ b/nodes.svg @@ -1,627 +1,620 @@ - - - + + NeoNetwork Nodes - -NeoNetwork Nodes + +NeoNetwork Nodes cluster_AS4201270000 - -NeoNetwork (AS4201270000) + +NeoNetwork (AS4201270000) cluster_4201270008 - -MagicNeko Network Internet exchange (AS4201270008) + +MagicNeko Network Internet exchange (AS4201270008) cluster_4201270006 - -Jerry Network (4201270006) + +Jerry Network (4201270006) c - -caasih.neocloud.tw -(10.127.0.1) + +caasih.neocloud.tw +(10.127.0.1) staph - -s.aureus.ga -(10.127.8.185 -fd10:127:7::1) -(AS4201270007) + +s.aureus.ga +(10.127.8.185 +fd10:127:7::1) +(AS4201270007) c->staph - - - + + + ucbvax - -router.neocloud.tw -(10.127.255.2) + +router.neocloud.tw +(10.127.255.2) ucbvax->c - - - + + + chenx97 - -chenx97.neocloud.tw -(10.127.89.3) -(fd10:127:1919:810::893) -(AS4201270003) + +chenx97.neocloud.tw +(10.127.89.3) +(fd10:127:1919:810::893) +(AS4201270003) ucbvax->chenx97 - - - + + + septs - -bgp.septs.me -(AS4201270001) + +bgp.septs.me +(AS4201270001) - + ucbvax->septs - - - + + + np11 - -NeoPDP-11 -(10.127.255.1, -10.127.1.1) + +NeoPDP-11 +(10.127.255.1, +10.127.1.1) np11->c - - + + np11->ucbvax - - + + pan - -r2.neocloud.tw -(10.127.3.1) + +r2.neocloud.tw +(10.127.3.1) np11->pan - - + + ns - -NeoSystem -(10.127.255.80) + +NeoSystem +(10.127.255.80) ns->ucbvax - - + + ns->pan - - + + megumiLHS - -megumi.yukipedia.cf -(AS4242421037) + +megumi.yukipedia.cf +(AS4242421037) megumiLHS->ucbvax - - - + + + - + megumiLHS->septs - - - + + + pan->ucbvax - - - + + + magicneko_JP03 - -M-JP3 -(10.127.4.15, -fd10:127:0233:7170:2021::10.127.4.15) + +M-JP3 +(10.127.4.15, +fd10:127:0233:7170:2021::10.127.4.15) - + pan->magicneko_JP03 - - - + + + icecat_Explosion - -MagicNeko P2P network interconnection + +MagicNeko P2P network interconnection icecat_Notebook - -NextMoe Group Access Network -(4201270005) -(10.127.233.1, -fd10:127:0233:1c3c::1) + +NextMoe Group Access Network +(4201270005) +(10.127.233.1, +fd10:127:0233:1c3c::1) magicneko_HK01 - -M-HK1 -(10.127.4.1, -fd10:127:0233:7170:2021::10.127.4.1) + +M-HK1 +(10.127.4.1, +fd10:127:0233:7170:2021::10.127.4.1) - + icecat_Notebook->magicneko_HK01 - - + + magicneko_JP02 - -M-JP2 -(10.127.4.13, -fd10:127:0233:7170:2021::10.127.4.13) + +M-JP2 +(10.127.4.13, +fd10:127:0233:7170:2021::10.127.4.13) - + icecat_Notebook->magicneko_JP02 - - + + magicneko_RU01 - -M-RU1 -(10.127.4.14, -fd10:127:0233:7170:2021::10.127.4.14) + +M-RU1 +(10.127.4.14, +fd10:127:0233:7170:2021::10.127.4.14) - + icecat_Notebook->magicneko_RU01 - - + + - + icecat_Notebook->magicneko_JP03 - - + + magicneko_CN01 - -M-CN1 -(10.127.4.101, -fd10:127:0233:7170:2021::10.127.4.101) + +M-CN1 +(10.127.4.101, +fd10:127:0233:7170:2021::10.127.4.101) - + icecat_Notebook->magicneko_CN01 - - + + magicneko_HK01->icecat_Explosion - - + + magicneko_HK02 - -M-HK2 -(10.127.4.10, -fd10:127:0233:7170:2021::10.127.4.10) + +M-HK2 +(10.127.4.10, +fd10:127:0233:7170:2021::10.127.4.10) magicneko_HK02->ucbvax - - - + + + magicneko_HK02->icecat_Explosion - - + + SUNNET - -SUNNET -(10.127.11.0/24) -(AS4242423088) + +SUNNET +(10.127.11.0/24) +(AS4242423088) - + magicneko_HK02->SUNNET - - - + + + magicneko_JP01 - -M-JP1 -(10.127.4.11, -fd10:127:0233:7170:2021::10.127.4.11) + +M-JP1 +(10.127.4.11, +fd10:127:0233:7170:2021::10.127.4.11) magicneko_JP01->icecat_Explosion - - + + magicneko_HK03 - -M-HK3 -(10.127.4.12, -fd10:127:0233:7170:2021::10.127.4.12) + +M-HK3 +(10.127.4.12, +fd10:127:0233:7170:2021::10.127.4.12) magicneko_HK03->icecat_Explosion - - + + magicneko_JP02->icecat_Explosion - - + + magicneko_RU01->icecat_Explosion - - + + - + magicneko_RU01->staph - - - + + + - + magicneko_RU01->septs - - - + + + - + magicneko_JP03->megumiLHS - - - + + + magicneko_JP03->icecat_Explosion - - + + - + magicneko_JP03->chenx97 - - - + + + JerryXiao - -jpn.neo.jerryxiao.cc -(10.127.8.193) + +jpn.neo.jerryxiao.cc +(10.127.8.193) - + magicneko_JP03->JerryXiao - - - + + + - + magicneko_JP03->septs - - - + + + frank_hsinchu - -Frank_Hsinchu -(10.127.255.56) -(AS4201270004) + +Frank_Hsinchu +(10.127.255.56) +(AS4201270004) - + magicneko_JP03->frank_hsinchu - - - + + + magicneko_CN01->icecat_Explosion - - + + staph_CN - -cnhome.aureus.ga -(10.127.8.187 -fd10:127:7::3) -(AS4201270007) + +cnhome.aureus.ga +(10.127.8.187 +fd10:127:7::3) +(AS4201270007) staph->staph_CN - - + + - + staph->septs - - - + + + santost12 - -Santost12 -(10.127.69.1) -(AS4201270009) + +Santost12 +(10.127.69.1) +(AS4201270009) - + staph->santost12 - - - + + + JerryXiao->ucbvax - - - + + + JerryXiao_SH01 - -jerryxiao-sh01 -(10.127.8.195) + +jerryxiao-sh01 +(10.127.8.195) JerryXiao->JerryXiao_SH01 - - - + + + JerryXiao_HK01 - -jerryxiao-hk01 -(10.127.8.194) + +jerryxiao-hk01 +(10.127.8.194) JerryXiao->JerryXiao_HK01 - - - - - - -JerryXiao->septs - - - + + + JerryXiao_SH01->JerryXiao_HK01 - - - + + + dfceaef - -dfceaef -(10.127.8.64/26) -(AS4242420140) + +dfceaef +(10.127.12.0/24) +(AS4242420140) - + JerryXiao_SH01->dfceaef - - - + + + JerryXiao_HK02 - -jerryxiao-hk02 -(10.127.8.196) + +jerryxiao-hk02 +(10.127.8.196) JerryXiao_HK01->JerryXiao_HK02 - - - + + + - + septs->frank_hsinchu - - - + + + lantian - -lantian -(AS4201270010) + +lantian +(AS4201270010) - + lantian->JerryXiao - - - + + + - + lantian->septs - - - + + + - + santost12->magicneko_JP03 - - + + NNPCC - -NNPCC + +NNPCC NNPCC->np11 - - - + + + NeoBOX - -NeoBOX + +NeoBOX NeoBOX->np11 - - - + + + cklvax - -cklvax + +cklvax cklvax->np11 - - - + + + NeoStorage - -NeoStorage + +NeoStorage NeoStorage->np11 - - - + + + From 3af70f3627230421a83e91c85fe1e4b5a87e3819 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 19 Sep 2020 13:18:14 +0800 Subject: [PATCH 13/25] [skip ci] skip all loopback checks --- scripts/roa.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/roa.py b/scripts/roa.py index 78e3ed8..9a96961 100755 --- a/scripts/roa.py +++ b/scripts/roa.py @@ -120,6 +120,8 @@ def route_to_roa(asn_table: dict): for net1, net2 in combinations( sorted(entities, key=lambda net: net["prefix"].prefixlen), 2 ): + if net1["type"] == net2["type"] == "loopback": + continue if not net1["prefix"].overlaps(net2["prefix"]): continue entity_from_net = lambda net: asn_table.get(net["asn"])["owner"] From 879a5619ce7215cb3184c1089e103f3eceb4f9b5 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 19 Sep 2020 13:20:14 +0800 Subject: [PATCH 14/25] fix sunnet --- route/AS140936.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/route/AS140936.toml b/route/AS140936.toml index 6e9b348..176c561 100644 --- a/route/AS140936.toml +++ b/route/AS140936.toml @@ -1,4 +1,4 @@ ["10.127.11.0/24"] -type = "SUNNET" +type = "subnet" name = "SUNNET" description = "SUNNET" From 61e98c7e954f5bd62aff0733c22ebba6bedacfb3 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 19 Sep 2020 13:28:31 +0800 Subject: [PATCH 15/25] ??? --- scripts/roa.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/roa.py b/scripts/roa.py index 9a96961..bcc055d 100755 --- a/scripts/roa.py +++ b/scripts/roa.py @@ -243,7 +243,7 @@ def make_rfc8416(roa4, roa6): def make_roa_records(roa4, roa6): records = [ - "route {asn} max {prefix} as {maxLength};".format_map(roa) + "route {prefix} max {maxLength} as {asn};".format_map(roa) for roa in (*roa4, *roa6) ] return "\n".join(["# NeoNetwork ROA tool", "", *records]) From 3cf25c73e6bc02798b614e2e4b346be042feed46 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 19 Sep 2020 13:30:52 +0800 Subject: [PATCH 16/25] fix dns --- route/AS4201270000.toml | 2 +- route/AS4201270006.toml | 5 +++++ route/AS4201270007.toml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/route/AS4201270000.toml b/route/AS4201270000.toml index b26dc79..86e62bc 100644 --- a/route/AS4201270000.toml +++ b/route/AS4201270000.toml @@ -27,7 +27,7 @@ type = "loopback" name = "NeoPDP-11" description = "FreeBSD/frr" -["10.127.255.50/32"] +["10.127.255.2/32"] type = "loopback" name = "ucbvax" description = "Arch Linux/frr" diff --git a/route/AS4201270006.toml b/route/AS4201270006.toml index 9e75395..79bf300 100644 --- a/route/AS4201270006.toml +++ b/route/AS4201270006.toml @@ -18,6 +18,11 @@ type = "loopback" name = "JerryXiao-Anycast" description = "Anycast Recursive DNS" +["10.127.255.2/32"] +type = "loopback" +name = "JerryXiao-Anycast" +description = "Anycast Recursive DNS" + ["fd10:127:53::/48"] type = "subnet" name = "JerryXiao6" diff --git a/route/AS4201270007.toml b/route/AS4201270007.toml index 83dbd84..8990c50 100644 --- a/route/AS4201270007.toml +++ b/route/AS4201270007.toml @@ -14,7 +14,7 @@ name = "staphdns" description = "Bind9 DNS" ["10.127.255.53/32"] -type = "anycast" +type = "loopback" name = "staphdns" description = "Bind9 DNS" From 3efa90fff59998ba8f76a4f8f7e46d3b12243138 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 19 Sep 2020 13:41:42 +0800 Subject: [PATCH 17/25] add v6 anycast dns --- route/AS4201270006.toml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/route/AS4201270006.toml b/route/AS4201270006.toml index 79bf300..3f13f05 100644 --- a/route/AS4201270006.toml +++ b/route/AS4201270006.toml @@ -13,17 +13,22 @@ type = "subnet" name = "JerryXiao-School" description = "For school" -["10.127.255.53/32"] -type = "loopback" -name = "JerryXiao-Anycast" -description = "Anycast Recursive DNS" - -["10.127.255.2/32"] -type = "loopback" -name = "JerryXiao-Anycast" -description = "Anycast Recursive DNS" - ["fd10:127:53::/48"] type = "subnet" name = "JerryXiao6" description = "JerryNet6" + +["10.127.255.2/32"] +type = "loopback" +name = "JerryXiao-Anycast4-legacy" +description = "Anycast Recursive DNS" + +["10.127.255.53/32"] +type = "loopback" +name = "JerryXiao-Anycast4" +description = "Anycast Recursive DNS" + +["fd10:127:ffff:53::/64"] +type = "loopback" +name = "JerryXiao-Anycast6" +description = "Anycast Recursive DNS" From bd1c8ba0d451291abedf4f8246f4bdbee2da8713 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 19 Sep 2020 13:46:19 +0800 Subject: [PATCH 18/25] dns-reverse-generator.py: cannot take ipv6 --- scripts/dns-reverse-generator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/dns-reverse-generator.py b/scripts/dns-reverse-generator.py index d7aa65e..aa4e23e 100755 --- a/scripts/dns-reverse-generator.py +++ b/scripts/dns-reverse-generator.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 import sys -from ipaddress import IPv4Address, ip_network +from ipaddress import IPv4Address, ip_network, IPv4Network from pathlib import Path import toml @@ -16,7 +16,7 @@ def iter_route(route_type: str): items.extend( (entity["name"], ip_network(route).network_address) for route, entity in routes.items() - if entity["type"] == route_type + if entity["type"] == route_type and isinstance(ip_network(route), IPv4Network) ) return sorted(items, key=lambda item: item[1]) From ea940d5279b6699e25721dc82cf2eae8b512af10 Mon Sep 17 00:00:00 2001 From: "Staph. aureus" Date: Sat, 19 Sep 2020 01:51:19 -0400 Subject: [PATCH 19/25] Add anycast dns for ipv6 --- route/AS4201270007.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/route/AS4201270007.toml b/route/AS4201270007.toml index 8990c50..c4539a2 100644 --- a/route/AS4201270007.toml +++ b/route/AS4201270007.toml @@ -57,3 +57,8 @@ description = "Staph-infected reserved net for future use" type = "subnet" name = "StaphPeer" description = "Staph infection network that would not be broadcasted in BGP" + +["fd10:127:ffff:53::/64"] +type = "loopback" +name = "staphdns" +description = "Bind9 DNS" From 61224360ebc018e5f63a5e4a26f4e9caf6425f92 Mon Sep 17 00:00:00 2001 From: "Staph. aureus" Date: Sat, 19 Sep 2020 02:34:33 -0400 Subject: [PATCH 20/25] Update DNS address --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 89fdbde..1897c3f 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ and [route6](https://github.com/NeoCloud/NeoNetwork/tree/master/route6) for allo ## DNS -There's a bind9 server on dns.neocloud.tw (`10.127.255.2` and `fd10:127:5f37:59df::255:2`), all domain names are under ".neo". +DNS Anycast is currently on `10.127.255.53` for IPv4 and `fd10:127:ffff:53::` for IPv6. All domain names are under ".neo". ## Connection Graph From 47cfb85f58978cc80f3adfa39c37c203e501cc8b Mon Sep 17 00:00:00 2001 From: Jerry Date: Wed, 23 Sep 2020 14:41:36 +0800 Subject: [PATCH 21/25] rfc2317 script --- dns/db.10.127 | 269 +++++++++++++++++++------------ dns/rfc2317.toml | 8 + scripts/dns-reverse-generator.py | 25 ++- scripts/rfc2317.py | 26 +++ 4 files changed, 226 insertions(+), 102 deletions(-) create mode 100644 dns/rfc2317.toml create mode 100755 scripts/rfc2317.py diff --git a/dns/db.10.127 b/dns/db.10.127 index 4b9400e..edce17e 100644 --- a/dns/db.10.127 +++ b/dns/db.10.127 @@ -36,71 +36,6 @@ $TTL 604800 2.8 IN PTR blog.librehs.neo. ; DELEGATED ZONES -192/26.8 IN NS ns1.jerry.neo. -192.8 IN CNAME 192.192/26.8 -193.8 IN CNAME 193.192/26.8 -194.8 IN CNAME 194.192/26.8 -195.8 IN CNAME 195.192/26.8 -196.8 IN CNAME 196.192/26.8 -197.8 IN CNAME 197.192/26.8 -198.8 IN CNAME 198.192/26.8 -199.8 IN CNAME 199.192/26.8 -200.8 IN CNAME 200.192/26.8 -201.8 IN CNAME 201.192/26.8 -202.8 IN CNAME 202.192/26.8 -203.8 IN CNAME 203.192/26.8 -204.8 IN CNAME 204.192/26.8 -205.8 IN CNAME 205.192/26.8 -206.8 IN CNAME 206.192/26.8 -207.8 IN CNAME 207.192/26.8 -208.8 IN CNAME 208.192/26.8 -209.8 IN CNAME 209.192/26.8 -210.8 IN CNAME 210.192/26.8 -211.8 IN CNAME 211.192/26.8 -212.8 IN CNAME 212.192/26.8 -213.8 IN CNAME 213.192/26.8 -214.8 IN CNAME 214.192/26.8 -215.8 IN CNAME 215.192/26.8 -216.8 IN CNAME 216.192/26.8 -217.8 IN CNAME 217.192/26.8 -218.8 IN CNAME 218.192/26.8 -219.8 IN CNAME 219.192/26.8 -220.8 IN CNAME 220.192/26.8 -221.8 IN CNAME 221.192/26.8 -222.8 IN CNAME 222.192/26.8 -223.8 IN CNAME 223.192/26.8 -224.8 IN CNAME 224.192/26.8 -225.8 IN CNAME 225.192/26.8 -226.8 IN CNAME 226.192/26.8 -227.8 IN CNAME 227.192/26.8 -228.8 IN CNAME 228.192/26.8 -229.8 IN CNAME 229.192/26.8 -230.8 IN CNAME 230.192/26.8 -231.8 IN CNAME 231.192/26.8 -232.8 IN CNAME 232.192/26.8 -233.8 IN CNAME 233.192/26.8 -234.8 IN CNAME 234.192/26.8 -235.8 IN CNAME 235.192/26.8 -236.8 IN CNAME 236.192/26.8 -237.8 IN CNAME 237.192/26.8 -238.8 IN CNAME 238.192/26.8 -239.8 IN CNAME 239.192/26.8 -240.8 IN CNAME 240.192/26.8 -241.8 IN CNAME 241.192/26.8 -242.8 IN CNAME 242.192/26.8 -243.8 IN CNAME 243.192/26.8 -244.8 IN CNAME 244.192/26.8 -245.8 IN CNAME 245.192/26.8 -246.8 IN CNAME 246.192/26.8 -247.8 IN CNAME 247.192/26.8 -248.8 IN CNAME 248.192/26.8 -249.8 IN CNAME 249.192/26.8 -250.8 IN CNAME 250.192/26.8 -251.8 IN CNAME 251.192/26.8 -252.8 IN CNAME 252.192/26.8 -253.8 IN CNAME 253.192/26.8 -254.8 IN CNAME 254.192/26.8 -255.8 IN CNAME 255.192/26.8 9 IN NS ns1.jerry.neo. 12 IN NS ns1.yangfl.dn42. @@ -113,49 +48,183 @@ $TTL 604800 10 IN NS ns5.lantian.neo. 7 IN NS ns1.staph.neo. -160/27.8 IN NS ns1.staph.neo. -160.8 IN CNAME 160.160/27.8 -161.8 IN CNAME 161.160/27.8 -162.8 IN CNAME 162.160/27.8 -163.8 IN CNAME 163.160/27.8 -164.8 IN CNAME 164.160/27.8 -165.8 IN CNAME 165.160/27.8 -166.8 IN CNAME 166.160/27.8 -167.8 IN CNAME 167.160/27.8 -168.8 IN CNAME 168.160/27.8 -169.8 IN CNAME 169.160/27.8 -170.8 IN CNAME 170.160/27.8 -171.8 IN CNAME 171.160/27.8 -172.8 IN CNAME 172.160/27.8 -173.8 IN CNAME 173.160/27.8 -174.8 IN CNAME 174.160/27.8 -175.8 IN CNAME 175.160/27.8 -176.8 IN CNAME 176.160/27.8 -177.8 IN CNAME 177.160/27.8 -178.8 IN CNAME 178.160/27.8 -179.8 IN CNAME 179.160/27.8 -180.8 IN CNAME 180.160/27.8 -181.8 IN CNAME 181.160/27.8 -182.8 IN CNAME 182.160/27.8 -183.8 IN CNAME 183.160/27.8 -184.8 IN CNAME 184.160/27.8 -185.8 IN CNAME 185.160/27.8 -186.8 IN CNAME 186.160/27.8 -187.8 IN CNAME 187.160/27.8 -188.8 IN CNAME 188.160/27.8 -189.8 IN CNAME 189.160/27.8 -190.8 IN CNAME 190.160/27.8 -191.8 IN CNAME 191.160/27.8 + ; DO NOT MANUALLY EDIT THE FOLLOWING LINES ; AUTOGENERATED ; Loopback Addresses -3.89 IN PTR chenx97-conoha.neo. 1.255 IN PTR NeoPDP-11.neo. 2.255 IN PTR ucbvax.neo. 4.255 IN PTR pan.neo. -53.255 IN PTR JerryXiao-Anycast.neo. +53.255 IN PTR JerryXiao-Anycast4.neo. 56.255 IN PTR frank-hsinchu-1.neo. 80.255 IN PTR NeoSystem.neo. 117.255 IN PTR magicneko-tw.neo. + +; rfc2317 +64/26.8 IN NS ns1.jerry.neo. +64.8 IN CNAME 64.64/26.8 +65.8 IN CNAME 65.64/26.8 +66.8 IN CNAME 66.64/26.8 +67.8 IN CNAME 67.64/26.8 +68.8 IN CNAME 68.64/26.8 +69.8 IN CNAME 69.64/26.8 +70.8 IN CNAME 70.64/26.8 +71.8 IN CNAME 71.64/26.8 +72.8 IN CNAME 72.64/26.8 +73.8 IN CNAME 73.64/26.8 +74.8 IN CNAME 74.64/26.8 +75.8 IN CNAME 75.64/26.8 +76.8 IN CNAME 76.64/26.8 +77.8 IN CNAME 77.64/26.8 +78.8 IN CNAME 78.64/26.8 +79.8 IN CNAME 79.64/26.8 +80.8 IN CNAME 80.64/26.8 +81.8 IN CNAME 81.64/26.8 +82.8 IN CNAME 82.64/26.8 +83.8 IN CNAME 83.64/26.8 +84.8 IN CNAME 84.64/26.8 +85.8 IN CNAME 85.64/26.8 +86.8 IN CNAME 86.64/26.8 +87.8 IN CNAME 87.64/26.8 +88.8 IN CNAME 88.64/26.8 +89.8 IN CNAME 89.64/26.8 +90.8 IN CNAME 90.64/26.8 +91.8 IN CNAME 91.64/26.8 +92.8 IN CNAME 92.64/26.8 +93.8 IN CNAME 93.64/26.8 +94.8 IN CNAME 94.64/26.8 +95.8 IN CNAME 95.64/26.8 +96.8 IN CNAME 96.64/26.8 +97.8 IN CNAME 97.64/26.8 +98.8 IN CNAME 98.64/26.8 +99.8 IN CNAME 99.64/26.8 +100.8 IN CNAME 100.64/26.8 +101.8 IN CNAME 101.64/26.8 +102.8 IN CNAME 102.64/26.8 +103.8 IN CNAME 103.64/26.8 +104.8 IN CNAME 104.64/26.8 +105.8 IN CNAME 105.64/26.8 +106.8 IN CNAME 106.64/26.8 +107.8 IN CNAME 107.64/26.8 +108.8 IN CNAME 108.64/26.8 +109.8 IN CNAME 109.64/26.8 +110.8 IN CNAME 110.64/26.8 +111.8 IN CNAME 111.64/26.8 +112.8 IN CNAME 112.64/26.8 +113.8 IN CNAME 113.64/26.8 +114.8 IN CNAME 114.64/26.8 +115.8 IN CNAME 115.64/26.8 +116.8 IN CNAME 116.64/26.8 +117.8 IN CNAME 117.64/26.8 +118.8 IN CNAME 118.64/26.8 +119.8 IN CNAME 119.64/26.8 +120.8 IN CNAME 120.64/26.8 +121.8 IN CNAME 121.64/26.8 +122.8 IN CNAME 122.64/26.8 +123.8 IN CNAME 123.64/26.8 +124.8 IN CNAME 124.64/26.8 +125.8 IN CNAME 125.64/26.8 +126.8 IN CNAME 126.64/26.8 +127.8 IN CNAME 127.64/26.8 + +192/26.8 IN NS ns1.jerry.neo. +192.8 IN CNAME 192.192/26.8 +193.8 IN CNAME 193.192/26.8 +194.8 IN CNAME 194.192/26.8 +195.8 IN CNAME 195.192/26.8 +196.8 IN CNAME 196.192/26.8 +197.8 IN CNAME 197.192/26.8 +198.8 IN CNAME 198.192/26.8 +199.8 IN CNAME 199.192/26.8 +200.8 IN CNAME 200.192/26.8 +201.8 IN CNAME 201.192/26.8 +202.8 IN CNAME 202.192/26.8 +203.8 IN CNAME 203.192/26.8 +204.8 IN CNAME 204.192/26.8 +205.8 IN CNAME 205.192/26.8 +206.8 IN CNAME 206.192/26.8 +207.8 IN CNAME 207.192/26.8 +208.8 IN CNAME 208.192/26.8 +209.8 IN CNAME 209.192/26.8 +210.8 IN CNAME 210.192/26.8 +211.8 IN CNAME 211.192/26.8 +212.8 IN CNAME 212.192/26.8 +213.8 IN CNAME 213.192/26.8 +214.8 IN CNAME 214.192/26.8 +215.8 IN CNAME 215.192/26.8 +216.8 IN CNAME 216.192/26.8 +217.8 IN CNAME 217.192/26.8 +218.8 IN CNAME 218.192/26.8 +219.8 IN CNAME 219.192/26.8 +220.8 IN CNAME 220.192/26.8 +221.8 IN CNAME 221.192/26.8 +222.8 IN CNAME 222.192/26.8 +223.8 IN CNAME 223.192/26.8 +224.8 IN CNAME 224.192/26.8 +225.8 IN CNAME 225.192/26.8 +226.8 IN CNAME 226.192/26.8 +227.8 IN CNAME 227.192/26.8 +228.8 IN CNAME 228.192/26.8 +229.8 IN CNAME 229.192/26.8 +230.8 IN CNAME 230.192/26.8 +231.8 IN CNAME 231.192/26.8 +232.8 IN CNAME 232.192/26.8 +233.8 IN CNAME 233.192/26.8 +234.8 IN CNAME 234.192/26.8 +235.8 IN CNAME 235.192/26.8 +236.8 IN CNAME 236.192/26.8 +237.8 IN CNAME 237.192/26.8 +238.8 IN CNAME 238.192/26.8 +239.8 IN CNAME 239.192/26.8 +240.8 IN CNAME 240.192/26.8 +241.8 IN CNAME 241.192/26.8 +242.8 IN CNAME 242.192/26.8 +243.8 IN CNAME 243.192/26.8 +244.8 IN CNAME 244.192/26.8 +245.8 IN CNAME 245.192/26.8 +246.8 IN CNAME 246.192/26.8 +247.8 IN CNAME 247.192/26.8 +248.8 IN CNAME 248.192/26.8 +249.8 IN CNAME 249.192/26.8 +250.8 IN CNAME 250.192/26.8 +251.8 IN CNAME 251.192/26.8 +252.8 IN CNAME 252.192/26.8 +253.8 IN CNAME 253.192/26.8 +254.8 IN CNAME 254.192/26.8 +255.8 IN CNAME 255.192/26.8 + +160/27.8 IN NS ns1.staph.neo. +160.8 IN CNAME 160.160/27.8 +161.8 IN CNAME 161.160/27.8 +162.8 IN CNAME 162.160/27.8 +163.8 IN CNAME 163.160/27.8 +164.8 IN CNAME 164.160/27.8 +165.8 IN CNAME 165.160/27.8 +166.8 IN CNAME 166.160/27.8 +167.8 IN CNAME 167.160/27.8 +168.8 IN CNAME 168.160/27.8 +169.8 IN CNAME 169.160/27.8 +170.8 IN CNAME 170.160/27.8 +171.8 IN CNAME 171.160/27.8 +172.8 IN CNAME 172.160/27.8 +173.8 IN CNAME 173.160/27.8 +174.8 IN CNAME 174.160/27.8 +175.8 IN CNAME 175.160/27.8 +176.8 IN CNAME 176.160/27.8 +177.8 IN CNAME 177.160/27.8 +178.8 IN CNAME 178.160/27.8 +179.8 IN CNAME 179.160/27.8 +180.8 IN CNAME 180.160/27.8 +181.8 IN CNAME 181.160/27.8 +182.8 IN CNAME 182.160/27.8 +183.8 IN CNAME 183.160/27.8 +184.8 IN CNAME 184.160/27.8 +185.8 IN CNAME 185.160/27.8 +186.8 IN CNAME 186.160/27.8 +187.8 IN CNAME 187.160/27.8 +188.8 IN CNAME 188.160/27.8 +189.8 IN CNAME 189.160/27.8 +190.8 IN CNAME 190.160/27.8 +191.8 IN CNAME 191.160/27.8 diff --git a/dns/rfc2317.toml b/dns/rfc2317.toml new file mode 100644 index 0000000..bb6fe80 --- /dev/null +++ b/dns/rfc2317.toml @@ -0,0 +1,8 @@ +["10.127.8.64/26"] +ns = ["ns1.jerry.neo."] + +["10.127.8.192/26"] +ns = ["ns1.jerry.neo."] + +["10.127.8.160/27"] +ns = ["ns1.staph.neo."] diff --git a/scripts/dns-reverse-generator.py b/scripts/dns-reverse-generator.py index aa4e23e..8dd3b03 100755 --- a/scripts/dns-reverse-generator.py +++ b/scripts/dns-reverse-generator.py @@ -4,10 +4,11 @@ from ipaddress import IPv4Address, ip_network, IPv4Network from pathlib import Path import toml +from rfc2317 import gen_reverse_pointers RESOLVE_FILE = Path("dns", "db.10.127") ROUTE_FILE = Path("route") - +RFC2317_FILE = Path("dns", "rfc2317.toml") def iter_route(route_type: str): items = [] @@ -18,8 +19,22 @@ def iter_route(route_type: str): for route, entity in routes.items() if entity["type"] == route_type and isinstance(ip_network(route), IPv4Network) ) + routes = [] + remove = [] + for item in items[::-1]: + if item[1] in routes: + remove.append(item) + else: + routes.append(item[1]) + for i in remove: + items.remove(i) return sorted(items, key=lambda item: item[1]) +def iter_rfc2317_entry(): + entries = toml.loads(RFC2317_FILE.read_text()) + for (route, attributes) in entries.items(): + ns = attributes.get('ns') + yield(route, ns) def main(): orignal = RESOLVE_FILE.read_text() @@ -29,7 +44,13 @@ def main(): if isinstance(address, IPv4Address): pointer = address.reverse_pointer.replace(".127.10.in-addr.arpa", "") records.append("%s\tIN\tPTR\t%s.neo." % (pointer, name)) - RESOLVE_FILE.write_text("\n".join(records)+"\n") + + records.extend(("", "; rfc2317")) + for route, ns in iter_rfc2317_entry(): + records.extend(gen_reverse_pointers(route, ns)) + records.append("") + + RESOLVE_FILE.write_text("\n".join(records)) if __name__ == "__main__": diff --git a/scripts/rfc2317.py b/scripts/rfc2317.py new file mode 100755 index 0000000..bf3b6dd --- /dev/null +++ b/scripts/rfc2317.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 + +import ipaddress + +ZONE = '.127.10.in-addr.arpa' +def truncate(rev: str) -> str: + assert rev.endswith(ZONE) + rev = rev[:-len(ZONE)] + return rev + +def gen_reverse_pointers(network: str, ns: list) -> list: + buf = list() + net = ipaddress.IPv4Network(network, strict=True) + assert net.prefixlen > 24 + netrev = truncate(net.reverse_pointer) + for _ns in ns: + buf.append(f"{netrev:<10s} IN NS {_ns}") + + for addr in net: + cnamefr = truncate(addr.reverse_pointer) + cnameto = f"{int.from_bytes(addr.packed, byteorder='big', signed=False) & 0xff}.{netrev}" + buf.append(f"{cnamefr:<10s} IN CNAME {cnameto}") + return buf + +if __name__ == "__main__": + print("\n".join(gen_reverse_pointers('10.127.8.64/26', ['ns1.jerry.neo.']))) From 8c19922a0fd22c0fb344179f04045cc02e8b6cc3 Mon Sep 17 00:00:00 2001 From: Jerry Date: Wed, 23 Sep 2020 16:00:58 +0800 Subject: [PATCH 22/25] [revert when fixed] disable anycast routes for now --- route/AS4201270007.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/route/AS4201270007.toml b/route/AS4201270007.toml index c4539a2..182301f 100644 --- a/route/AS4201270007.toml +++ b/route/AS4201270007.toml @@ -9,12 +9,12 @@ name = "AOSCNet" description = "AOSC BuildBot Interconnection" ["10.127.255.2/32"] -type = "loopback" +type = "loopback?" name = "staphdns" description = "Bind9 DNS" ["10.127.255.53/32"] -type = "loopback" +type = "loopback?" name = "staphdns" description = "Bind9 DNS" @@ -59,6 +59,6 @@ name = "StaphPeer" description = "Staph infection network that would not be broadcasted in BGP" ["fd10:127:ffff:53::/64"] -type = "loopback" +type = "loopback?" name = "staphdns" description = "Bind9 DNS" From 65fec852c00e2d73f50fe84c2823a3356bc295b2 Mon Sep 17 00:00:00 2001 From: Jerry Date: Thu, 24 Sep 2020 17:13:05 +0800 Subject: [PATCH 23/25] remove 10.127.255.2/32 for 4201270006 --- route/AS4201270006.toml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/route/AS4201270006.toml b/route/AS4201270006.toml index 3f13f05..e247c05 100644 --- a/route/AS4201270006.toml +++ b/route/AS4201270006.toml @@ -18,11 +18,6 @@ type = "subnet" name = "JerryXiao6" description = "JerryNet6" -["10.127.255.2/32"] -type = "loopback" -name = "JerryXiao-Anycast4-legacy" -description = "Anycast Recursive DNS" - ["10.127.255.53/32"] type = "loopback" name = "JerryXiao-Anycast4" From 2ee5d3380f612c82f0a0c5cba9e486d5a981a445 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sun, 27 Sep 2020 14:22:22 +0800 Subject: [PATCH 24/25] jerryxiao: new dns route --- route/AS4201270006.toml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/route/AS4201270006.toml b/route/AS4201270006.toml index e247c05..78a6fad 100644 --- a/route/AS4201270006.toml +++ b/route/AS4201270006.toml @@ -20,10 +20,20 @@ description = "JerryNet6" ["10.127.255.53/32"] type = "loopback" -name = "JerryXiao-Anycast4" -description = "Anycast Recursive DNS" +name = "anycast-auth-4" +description = "Anycast authoritative DNS" + +["10.127.255.54/32"] +type = "loopback" +name = "anycast-recur-4" +description = "Anycast recursive DNS" ["fd10:127:ffff:53::/64"] type = "loopback" -name = "JerryXiao-Anycast6" -description = "Anycast Recursive DNS" +name = "anycast-auth-6" +description = "Anycast authoritative DNS" + +["fd10:127:53:53::/64"] +type = "loopback" +name = "anycast-recur-6" +description = "Anycast recursive DNS" From 42eb451b3a394acf1c9298d5b3f97f0eefb0b3b3 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sun, 27 Sep 2020 14:24:02 +0800 Subject: [PATCH 25/25] oops --- route/AS4201270006.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/route/AS4201270006.toml b/route/AS4201270006.toml index 78a6fad..c3d97a6 100644 --- a/route/AS4201270006.toml +++ b/route/AS4201270006.toml @@ -37,3 +37,4 @@ description = "Anycast authoritative DNS" type = "loopback" name = "anycast-recur-6" description = "Anycast recursive DNS" +supernet = "fd10:127:53::/48"