MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "batchcomplete": "",
    "continue": {
        "gapcontinue": "Ross",
        "continue": "gapcontinue||"
    },
    "query": {
        "pages": {
            "135": {
                "pageid": 135,
                "ns": 0,
                "title": "Replacing JNOS with Linux",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "When we think about packet radio and TCP/IP, most of us think of JNOS.  The efforts of all current and past developers has given us a \"swiss army knife\" of packet programs.  No other software package comes close to providing as many services as JNOS.  The cost of offering so many options is the ability to have feature rich components.  While no component of JNOS is bad, the prospect of being able choose what flavor of services can be an attractive one.  This article is intended to a somewhat seasoned Linux veteran.  It assumes you are capable of setting up LinuxNode and any other network daemons such as Postfix (SMTP), Apache (HTTP), etc.  As time permits, we will try to add additional setup steps.\n\nOut of the box, LinuxNode can support AXIP and AXUDP connections, support KISS type TNCs and can even be setup to accept telnet sessions (with help if (x)inetd).  The other component of JNOS which is used heavily in our installations is the ability to encapsulate AMPRNet (44.x.x.x) traffic into normal IP frames.  This is often used to bridge \"pockets\" of AMPRNet traffic across Internet links.  Fortunately, Linux can natively handle this as well, but the documentation and examples we found seemed confusing.  With a bit of research and some trial and error, we discovered that what takes one line in JNOS, takes 3 lines in Linux.\n\nFor those of you who subscribe to the AMPRNet robot provided by http://www.ampr-gateways.org, you are probably receiving encap.txt files in the format of\n\nroute addprivate 44.x.x.x/nn encap internet.ip.of.gateway <br>\n\nJNOS can happily accept this syntax, but Linux needs it to be broken apart into 3 steps.\n\n<nowiki>#</nowiki> This creates the interface with the destination gateway.  Only one of these is needed per gateway <br>\n\nip tunnel add <interfacename> mode ipip remote internet.ip.of.gateway local local.ip.of.linux\n\n<nowiki>#</nowiki> This sets the IP address on the interface.  We've used the AMPRNet address.  We will use 44.128.0.1 for this example.<br>\n\nifconfig <interfacename> 44.128.0.1 netmask 255.255.255.255\n\n<nowiki>#</nowiki> Lastly, we must create a route to the target AMPRNet host or network via the newly created interface (which implies the gateway).  We will use 44.128.1.0/24 for this example. <br>\n\nroute add 44.128.1.0/24 dev <interfacename>\n\nThe union of these 3 commands will produce the same IPIP encapsulation that JNOS uses.  The next hurdle is how to convert the encap.txt to a format that will work within Linux.  One solution is the following bash script.  It will\n\n1) Read the native formatted encap.txt and translate it into the Linux command set <br>\n2) Create a tunnel interface per remote gateway (starts with ampr0 and adds additional per gateway)  The limit of interface is not limited to 255, in our testing we've had 512 without any trouble. <br>\n3) Replace empty octets of the target IP address with zeros (required by route command) <br>\n4) Perform sanity checking for incorrect network addresses (some entries in encap.txt don't have the correct network address for a given subnet, if fed directly, the Linux route command will fail). <br>\n5) Remove any preexisting tunnels (if you kernel has the ipip compiled in a module) <br>\n6) It will error out if it encounters any issue with any command.  This is useful to ensure everything is running before it gets added to crontab. <br>\n\n\n----\n\n<nowiki>#</nowiki>!/bin/bash  <br>\nIPIPLOAD=$(lsmod | grep -c ipip) <br>\nif [ ${IPIPLOAD} != \"0\" ]; <br>\nthen <br>\nrmmod ipip <br>\nfi <br>\nmodprobe ipip <br>\nENCAP=encap.txt <br>\nLOCALENCAP=$(/sbin/ifconfig eth0 | grep 'inet addr:' | awk '{print $2}' | awk -F ':' '{print $2}') <br>\nLOCALAMPR=44.128.0.1 <br>\nENCAPGW=$(cat $ENCAP | grep -v '#' | awk '{print $5}' | sort | uniq) <br>\nfor gw in $ENCAPGW <br>\ndo <br>\n\nAMPRIFCHK=$(/sbin/ifconfig | grep -c ampr) <br>\n<nowiki>#</nowiki> This will assign the next available interface, we're calling these amprN <br>\nif [ ${AMPRIFCHK} = \"0\" ] <br>\nthen <br>\nDEVICE=ampr0 <br>\nelse <br>\nDEVNUMBER=$(expr $(/sbin/ifconfig | grep ampr | awk '{print $1}' | tail -n 1 |  sed s/'ampr'//g) + 1) <br>\nDEVICE=ampr${DEVNUMBER} <br>\nfi <br>\n\niptunnel add $DEVICE mode ipip remote $gw local $LOCALENCAP <br>\nRETVAL=$? <br>\nif [ ${RETVAL} != \"0\" ]; <br>\nthen <br>\nexit 1 <br>\nfi <br>\nifconfig $DEVICE $LOCALAMPR netmask 255.255.255.255 <br>\n\nRETVAL=$? <br>\nif [ ${RETVAL} != \"0\" ]; <br>\nthen <br>\nexit 1 <br>\nfi <br>\n\nfor net in $(cat $ENCAP | grep $gw | awk '{print $3}') <br>\ndo <br>\n\n<nowiki>#</nowiki> We need to omit -net to route when it is a host record (CIDR = 32) <br>\n<nowiki>#</nowiki> If no CIDR is specified, host is assumed, set CIDR to 32 <br>\n\nCIDR=$(echo $net | awk -F '/' '{print $2}') <br>\nif [ -z $CIDR ]; <br>\nthen <br>\nCIDR=32 <br>\nfi <br>\n\n<nowiki>#</nowiki> We need a host route <br>\nif [ ${CIDR} = \"32\" ] <br>\nthen <br>\nroute add $net dev $DEVICE <br>\n\nRETVAL=$? <br>\nif [ ${RETVAL} != \"0\" ]; <br>\nthen <br>\nexit 1 <br>\nfi <br>\n\nelse <br>\n<nowiki>#</nowiki> We need a network route <br>\nOCTET1=$(echo $net | awk -F '.' '{print $1}' | awk -F '/' '{print $1}') <br>\nOCTET2=$(echo $net | awk -F '.' '{print $2}' | awk -F '/' '{print $1}') <br>\nOCTET3=$(echo $net | awk -F '.' '{print $3}' | awk -F '/' '{print $1}') <br>\nOCTET4=$(echo $net | awk -F '.' '{print $4}' | awk -F '/' '{print $1}') <br>\n\n<nowiki>#</nowiki> Check to see if octets are empty, if they are, insert 0 <br>\nif [ -z $OCTET1 ]; <br>\nthen <br>\nOCTET1=0 <br>\nfi <br>\n\nif [ -z $OCTET2 ]; <br>\nthen <br>\nOCTET2=0 <br>\nfi <br>\n\nif [ -z $OCTET3 ]; <br>\nthen <br>\nOCTET3=0 <br>\nfi <br>\n\nif [ -z $OCTET4 ]; <br>\nthen <br>\nOCTET4=0 <br>\nfi <br>\n\nnet=\"${OCTET1}.${OCTET2}.${OCTET3}.${OCTET4}/${CIDR}\" <br>\n\n<nowiki>#</nowiki> In some cases, the target network has an incorrect network number <br>\n<nowiki>#</nowiki> This causes the route addition to fail. <br>\n<nowiki>#</nowiki> <br>\n<nowiki>#</nowiki> Fortunately, ipcalc can handle the calculation of the correct network <br>\n<nowiki>#</nowiki> Just to be safe, we will pass all networks through ipcalc to verify <br>\n<nowiki>#</nowiki> their accuracy. <br>\n<nowiki>#</nowiki> <br>\nNETSCRUB=$net <br>\n\nnet=$(ipcalc --nocolor $NETSCRUB | grep Network | awk '{print $2}') <br>\n\nroute add -net $net dev $DEVICE <br>\n\nRETVAL=$? <br>\nif [ ${RETVAL} != \"0\" ]; <br>\nthen <br>\nexit 1 <br>\nfi <br>\n\nfi <br>\n\necho \"Adding route to $net via $gw on $DEVICE\" <br>\n\ndone <br>\ndone <br>\n----\n\n\nThe end result is an output of routes, their gateways and device names\n\nAdding route to 44.x.x.x/32 via <internet.ip.of.gateway147> on ampr147 <br>\nAdding route to 44.x.x.y/32 via <internet.ip.of.gateway148>  on ampr148 <br>\nAdding route to 44.x.x.z/32 via <internet.ip.of.gateway149>  on ampr149 <br>\n\nIt is recommended that the system run iptables with sensible rules to restrict access to certain services.  We will try to add this information as time permits.\n\nPlease [mailto:kb8uvn@ohiopacket.org contact us] with any questions or comments"
                    }
                ]
            },
            "79": {
                "pageid": 79,
                "ns": 0,
                "title": "Richland",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "'''Richland County Packet Nodes'''\n\n----\n'''Nodecall:''' XX8YY-1<br>\n'''Nodealias:''' ALIAS<br>\n'''Software:''' TheNet Plus 2.11st, TheNet X-1J4, G8BPQ v4.08a, K-Net v1.0, MSYS<br>\n'''Operating Frequencies/Baudrates:'''<br>\n145.010 MHz 1200 Baud<br>\n'''Location:''' Somewhere, Ohio<br>\n'''Contact:''' <br>\nFirstname, CALLSIGN<br>\nCALLSIGN@BBSCALL.#XXX.OH.USA.NOAM<br>\nuser@email.address<br>\n'''Additional notes:'''<br>\n----"
                    }
                ]
            }
        }
    }
}