IPIP Mesh/Encap.txt: Difference between revisions

From 44Net Wiki
W6JMK (talk | contribs)
m add links
Organize IPIP Mesh documentation and navigation
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
An encap.txt file lists [[Gateway|AMPRNet gateways]], in a format like this:
{{Section nav|hub=IPIP Mesh|title=IPIP Mesh|category=IPIP Mesh}}
 
An encap.txt file lists [[IPIP Mesh/Gateways|AMPRNet gateways]], in a format like this:


  <nowiki># This is a comment
  <nowiki># This is a comment
Line 5: Line 7:
route addprivate 44.100.129.0/24 encap 176.140.10.22</nowiki>
route addprivate 44.100.129.0/24 encap 176.140.10.22</nowiki>


Originally formatted for JNOS systems, it is often parsed with a "[[munge script]]" to update Linux system routing tables.
Originally formatted for JNOS systems, it is often parsed with a "[[IPIP Mesh/Munge script|munge script]]" to update Linux system routing tables.


== Portal ==
== Portal ==
Line 15: Line 17:
  <nowiki>curl -s -H "Authorization: Bearer $APItoken" -H "Accept: application/json" https://portal.ampr.org/api/v2/encap/routes | jq -r '.encap[] | select(.encapType == "IPIP") | "route addprivate \(.network)/\(.cidr) encap \(.gatewayIP)"'</nowiki>
  <nowiki>curl -s -H "Authorization: Bearer $APItoken" -H "Accept: application/json" https://portal.ampr.org/api/v2/encap/routes | jq -r '.encap[] | select(.encapType == "IPIP") | "route addprivate \(.network)/\(.cidr) encap \(.gatewayIP)"'</nowiki>


A more complete example is in [[Encap.txt/get-encap]].
A more complete example is in [[IPIP Mesh/Encap.txt/get-encap|Encap.txt/get-encap]].


If something goes wrong, the result won't be a complete list.
If something goes wrong, the result won't be a complete list.
Line 23: Line 25:
== HTTP ==
== HTTP ==


Previously, a complete encap.txt file was available from the portal as a web page.
Previously, a complete encap.txt file was available from the Portal as a web page.
This is no longer supported.
This is no longer supported.
[[Category:Reference]]
[[Category:Infrastructure]]

Latest revision as of 19:08, 29 September 2026

← Back to IPIP Mesh

An encap.txt file lists AMPRNet gateways, in a format like this:

# This is a comment
route addprivate 44.10.0.100/32 encap 136.115.52.224
route addprivate 44.100.129.0/24 encap 176.140.10.22

Originally formatted for JNOS systems, it is often parsed with a "munge script" to update Linux system routing tables.

Portal

To get an encap.txt file that lists all current gateways, request all routes from the Portal API and convert the response from JSON to text. For example (using API version 2):

curl -s -H "Authorization: Bearer $APItoken" -H "Accept: application/json" https://portal.ampr.org/api/v2/encap/routes | jq -r '.encap[] | select(.encapType == "IPIP") | "route addprivate \(.network)/\(.cidr) encap \(.gatewayIP)"'

A more complete example is in Encap.txt/get-encap.

If something goes wrong, the result won't be a complete list. Before using it to update routing tables, it's worth checking whether it has the right syntax and it's reasonably long. An empty list or a list that's much shorter than a previous version is probably erroneous.

HTTP

Previously, a complete encap.txt file was available from the Portal as a web page. This is no longer supported.