{"id":15865870,"url":"https://github.com/mafredri/ipv6rd","last_synced_at":"2025-07-27T01:07:53.574Z","repository":{"id":65230309,"uuid":"588760838","full_name":"mafredri/ipv6rd","owner":"mafredri","description":"Calculate 6RD prefixes from DHCP (IPv4) OPTION_6RD (212)","archived":false,"fork":false,"pushed_at":"2023-03-17T18:06:23.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T20:45:56.808Z","etag":null,"topics":["6rd","dhclient","ipv6"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mafredri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-13T23:34:39.000Z","updated_at":"2023-01-13T23:38:42.000Z","dependencies_parsed_at":"2024-06-19T13:32:18.834Z","dependency_job_id":"50927317-4bc1-47a1-b667-5c5c0ffc0aa7","html_url":"https://github.com/mafredri/ipv6rd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mafredri/ipv6rd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mafredri%2Fipv6rd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mafredri%2Fipv6rd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mafredri%2Fipv6rd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mafredri%2Fipv6rd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mafredri","download_url":"https://codeload.github.com/mafredri/ipv6rd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mafredri%2Fipv6rd/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267278854,"owners_count":24063270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["6rd","dhclient","ipv6"],"created_at":"2024-10-05T23:02:08.247Z","updated_at":"2025-07-27T01:07:53.551Z","avatar_url":"https://github.com/mafredri.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ipv6rd\n\nCalculate 6RD prefixes from DHCP (IPv4) OPTION_6RD (212).\n\nEither use this library or the included `6rdcalc` command.\n\n## `6rdcalc`\n\nThis tool is useful for scripting, e.g. when used in a dhclient hook.\n\nThere's `ipv6calc`, why create a new tool? This tool is written in Go, so it's easily portable to multiple architectures. Since it also does `OPTION_6RD` parsing, it saves you from calculating the initial prefix in sh/ash/Bash and lets you easily create new `/64` prefixes for your networks (LAN, device, docker, etc.).\n\n### Installation\n\n```shell\ngo install github.com/mafredri/ipv6rd/cmd/6rdcalc@latest\n```\n\nOther platforms:\n\n```shell\ngit clone https://github.com/mafredri/ipv6rd.git\ncd ipv6rd\nGOOS=linux GOARCH=mips go build ./cmd/6rdcalc\nscp 6rdcalc unifi-security-gateway.local:\nssh ubnt@unifi-security-gateway.local\nubnt@unifi-security-gateway:~$ ./6rdcalc\n```\n\n### Tunnel configuration\n\nGenerating the tunnel configuration from the given 6RD configuration:\n\n```shell\n6rdcalc tunnel 84.240.100.100 \"14 38 8193 8195 62464 0 0 0 0 0 84.251.255.254\"\n```\n\nThe value for `IP` comes from `$new_ip_address` and the value for `OPTION 6RD` comes from `$new_option_6rd`, both available in a dhclient hook.\n\nExample output:\n\n```\nPREFIX=\"2001:2003:f400::/38\"\nRELAY_PREFIX=\"84.240.0.0/14\"\nBORDER_RELAY=\"::84.251.255.254\"\nDELEGATED_PREFIX=\"2001:2003:f464:6400::/56\"\nTUNNEL_ADDRESS=\"2001:2003:f464:6400::/128\"\n```\n\nUsage in scripts:\n\n```shell\neval \"$(6rdcalc tunnel 84.240.100.100 \"14 38 8193 8195 62464 0 0 0 0 0 84.251.255.254\")\"\necho \"$DELEGATED_PREFIX\"\n```\n\n### Network configuration\n\nUse the network subcommand to slice a `/64` out of your delegated prefix.\n\n```shell\n6rdcalc network 2001:2003:f464:6400::/56 0:0:0:10::1/64\n```\n\nThe `DELEGATED PREFIX` comes from the tunnel configuration and the `IP` is the wanted network IP in CIDR notation, without the delegated prefix.\n\nExample output:\n\n```shell\nNETWORK=\"2001:2003:f464:6410::/64\"\nADDRESS=\"2001:2003:f464:6410::1/64\"\nIP=\"2001:2003:f464:6410::1\"\n```\n\nUsage in scripts:\n\n```shell\neval \"$(6rdcalc network 2001:2003:f464:6400::/56 0:0:0:10::1/64)\"\necho \"$IP\"\n```\n\n### Verification\n\nUse the `contains` subcommand to figure out if your existing configuration needs updating.\n\n```shell\nDELEGATED_PREFIX=\"2001:2003:f464:6400::/56\"\nADDRESS=\"2001:2003:f464:6410::1/64\"\nIP=\"2001:2003:f464:6410::1\"\n\n$ 6rdcalc contains \"$DELEGATED_PREFIX\" \"$IP\"\ntrue\n$ 6rdcalc contains \"$DELEGATED_PREFIX\" \"$ADDRESS\"\ntrue\n6rdcalc contains \"$DELEGATED_PREFIX\" \"2001:2003:f464:0000::1\"\nfalse\n```\n\n## Configuration of dhclient\n\n```\noption option-6rd code 212 = { integer 8, integer 8, ip6-address, array of ip-address };\n# OR\noption option-6rd code 212 = {\n\tinteger 8, integer 8,\n\tunsigned integer 16, unsigned integer 16, unsigned integer 16, unsigned integer 16,\n\tunsigned integer 16, unsigned integer 16, unsigned integer 16, unsigned integer 16,\n\tarray of ip-address\n};\n\ninterface \"eth0\" {\n\talso request option-6rd;\n}\n```\n\n## Resources\n\n- [RFC5969 - IPv6 Rapid Deployment on IPv4 Infrastructures (6rd)](https://tools.ietf.org/html/rfc5969)\n- [bonan/dhcp6rd](https://github.com/bonan/dhcp6rd)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmafredri%2Fipv6rd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmafredri%2Fipv6rd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmafredri%2Fipv6rd/lists"}