1#LyX 2.3 created this file. For more info see http://www.lyx.org/ 2\lyxformat 544 3\begin_document 4\begin_header 5\save_transient_properties true 6\origin unavailable 7\textclass docbook 8\use_default_options false 9\maintain_unincluded_children false 10\language english 11\language_package default 12\inputencoding auto 13\fontencoding global 14\font_roman "default" "default" 15\font_sans "default" "default" 16\font_typewriter "default" "default" 17\font_math "auto" "auto" 18\font_default_family default 19\use_non_tex_fonts false 20\font_sc false 21\font_osf false 22\font_sf_scale 100 100 23\font_tt_scale 100 100 24\use_microtype false 25\use_dash_ligatures true 26\graphics default 27\default_output_format default 28\output_sync 0 29\bibtex_command default 30\index_command default 31\paperfontsize default 32\spacing single 33\use_hyperref false 34\papersize default 35\use_geometry false 36\use_package amsmath 1 37\use_package amssymb 1 38\use_package cancel 1 39\use_package esint 0 40\use_package mathdots 1 41\use_package mathtools 1 42\use_package mhchem 1 43\use_package stackrel 1 44\use_package stmaryrd 1 45\use_package undertilde 1 46\cite_engine basic 47\cite_engine_type default 48\biblio_style plain 49\use_bibtopic false 50\use_indices false 51\paperorientation portrait 52\suppress_date false 53\justification true 54\use_refstyle 0 55\use_minted 0 56\index Index 57\shortcut idx 58\color #008000 59\end_index 60\secnumdepth 3 61\tocdepth 3 62\paragraph_separation indent 63\paragraph_indentation default 64\is_math_indent 0 65\math_numbering_side default 66\quotes_style english 67\dynamic_quotes 0 68\papercolumns 1 69\papersides 1 70\paperpagestyle default 71\tracking_changes false 72\output_changes false 73\html_math_output 0 74\html_css_as_file 0 75\html_be_strict false 76\end_header 77 78\begin_body 79 80\begin_layout Title 81The ipv6calc Homepage 82\end_layout 83 84\begin_layout Standard 85\begin_inset ERT 86status collapsed 87 88\begin_layout Plain Layout 89 90<author><firstname>Peter</firstname><surname>Bieringer</surname><affiliation><ad 91dress>pb at bieringer dot de</address></affiliation></author> 92\end_layout 93 94\end_inset 95 96 97\end_layout 98 99\begin_layout Standard 100\begin_inset ERT 101status collapsed 102 103\begin_layout Plain Layout 104 105<revhistory> 106\end_layout 107 108\end_inset 109 110 111\end_layout 112 113\begin_layout Standard 114\begin_inset ERT 115status open 116 117\begin_layout Plain Layout 118 119<revision> <revnumber>10.2</revnumber> <date>2021-07-14</date> <authorinitials>PB 120</authorinitials></revision> 121\end_layout 122 123\end_inset 124 125 126\end_layout 127 128\begin_layout Standard 129\begin_inset ERT 130status collapsed 131 132\begin_layout Plain Layout 133 134</revhistory> 135\end_layout 136 137\end_inset 138 139 140\end_layout 141 142\begin_layout Section 143General 144\end_layout 145 146\begin_layout Standard 147ipv6calc is a small utility written in programming language C to manipulate 148 (not only) IPv6 addresses and is able to do other tricky things. 149 Intentions were convering a given IPv6 address into compressed format, 150 convering a given IPv6 address into the same format like shown in 151\shape italic 152/proc/net/if_inet6 153\shape default 154 and (because it was not difficulty) migrating the Perl program 155\shape italic 156ip6_int 157\shape default 158 into. 159 Now only one utiltity is needed to do a lot. 160\end_layout 161 162\begin_layout Standard 163This utility was also used in the past to extend features on network-functions-i 164pv6 library, used by initscripts-ipv6. 165\end_layout 166 167\begin_layout Standard 168Note: this tool got also its 169\begin_inset CommandInset href 170LatexCommand href 171name "freecode.com (former freshmeat, now also EOL) / ipv6calc" 172target "http://freecode.com/projects/ipv6calc/" 173literal "false" 174 175\end_inset 176 177 page (but this is not maintained by the author) 178\end_layout 179 180\begin_layout Subsection 181Latest version 182\end_layout 183 184\begin_layout Standard 185Latest version since last update of this page is 3.2.0 186\end_layout 187 188\begin_layout Subsection 189Included programs 190\end_layout 191 192\begin_layout Itemize 193\begin_inset Quotes eld 194\end_inset 195 196ipv6calc 197\begin_inset Quotes erd 198\end_inset 199 200: the main utility 201\end_layout 202 203\begin_layout Itemize 204\begin_inset Quotes eld 205\end_inset 206 207ipv6calcweb 208\begin_inset Quotes erd 209\end_inset 210 211: CGI wrapper for ipv6calc's address information output 212\end_layout 213 214\begin_layout Itemize 215\begin_inset Quotes eld 216\end_inset 217 218ipv6logconv 219\begin_inset Quotes erd 220\end_inset 221 222: log converter (IPv4/IPv6) 223\end_layout 224 225\begin_layout Itemize 226\begin_inset Quotes eld 227\end_inset 228 229ipv6loganon 230\begin_inset Quotes erd 231\end_inset 232 233: log anonymizer (IPv4/IPv6) 234\end_layout 235 236\begin_layout Itemize 237\begin_inset Quotes eld 238\end_inset 239 240ipv6logstats 241\begin_inset Quotes erd 242\end_inset 243 244: log statistic generator (IPv4/IPv6) 245\end_layout 246 247\begin_layout Itemize 248\begin_inset Quotes eld 249\end_inset 250 251mod_ipv6calc 252\begin_inset Quotes erd 253\end_inset 254 255: Apache module 256\end_layout 257 258\begin_layout Subsection 259Included databases 260\end_layout 261 262\begin_layout Standard 263If not disabled during compiling of the tool, following databases are statically 264 included, since version 0.95.0 internally mentioned as 265\begin_inset Quotes eld 266\end_inset 267 268BuiltIn 269\begin_inset Quotes erd 270\end_inset 271 272: 273\end_layout 274 275\begin_layout Itemize 276IEEE IAB, OUI, OUI-28, OUI-36 databases (for decoding vendor part of MAC/EUI-48/ 277EUI-64) 278\end_layout 279 280\begin_layout Itemize 281IPv4 assignment databases from IANA, ARIN, RIPENCC, APNIC, LACNIC, AFRINIC 282 (for selecting proper registry in ipv6calcweb.cgi and IPv4 anonymization) 283\end_layout 284 285\begin_layout Itemize 286IPv6 assignment databases from IANA, ARIN, RIPENCC, APNIC, LACNIC, AFRINIC 287 (for selecting proper registry in ipv6calcweb.cgi and IPv6 anonymization) 288\end_layout 289 290\begin_layout Itemize 291ASN assignment databases from IANA, ARIN, RIPENCC, APNIC, LACNIC, AFRINIC 292 (for IPv4/IPv6 anonymization) 293\end_layout 294 295\begin_layout Itemize 296LISP assignment database for supplying extra info 297\end_layout 298 299\begin_layout Subsection 300Possible external databases 301\end_layout 302 303\begin_layout Standard 304If enabled during compiling the tool, following external (but local stored) 305 databases can be used 306\end_layout 307 308\begin_layout Itemize 309\begin_inset CommandInset href 310LatexCommand href 311name "GeoIP" 312target "http://www.maxmind.com/" 313literal "false" 314 315\end_inset 316 317 318\begin_inset Separator latexpar 319\end_inset 320 321 322\end_layout 323 324\begin_deeper 325\begin_layout Itemize 326IPv4 327\begin_inset Quotes eld 328\end_inset 329 330legacy 331\begin_inset Quotes erd 332\end_inset 333 334 (since 0.61.0, released 2006 until 3.0.0 released 2020) 335\end_layout 336 337\begin_layout Itemize 338IPv6 339\begin_inset Quotes eld 340\end_inset 341 342legacy 343\begin_inset Quotes erd 344\end_inset 345 346 (since 0.90.0, released 2011, req. 347 GeoIP >= 1.4.5 until 3.0.0 released 2020) 348\end_layout 349 350\begin_layout Itemize 351GeoIP2 (native MaxMindDB file support since 2.0.0, release 2019) 352\end_layout 353 354\end_deeper 355\begin_layout Itemize 356\begin_inset CommandInset href 357LatexCommand href 358name "IP2Location" 359target "http://www.ip2location.com/" 360literal "false" 361 362\end_inset 363 364 365\begin_inset Separator latexpar 366\end_inset 367 368 369\end_layout 370 371\begin_deeper 372\begin_layout Itemize 373IPv4 (since 0.60.0, released 2006) 374\end_layout 375 376\begin_layout Itemize 377IPv6 (since 0.70.0, released 2007, 378\begin_inset CommandInset href 379LatexCommand href 380name "IP2Location LITE IPv6 Databases" 381target "http://lite.ip2location.com/" 382literal "false" 383 384\end_inset 385 386 since 0.99.0, released 2015) 387\end_layout 388 389\begin_layout Itemize 390release 0.99.0 is tested against IP2Location >= 4.0.2 391\end_layout 392 393\begin_layout Itemize 394release >= 2.0.0 && < 3.0.0 is only working with IP2Location >= 7.0.1 395\end_layout 396 397\begin_layout Itemize 398release >= 3.0.0 is only working with IP2Location >= 8.2.0 399\end_layout 400 401\end_deeper 402\begin_layout Itemize 403\begin_inset CommandInset href 404LatexCommand href 405name "DB-IP.com" 406target "http://www.db-ip.com/" 407literal "false" 408 409\end_inset 410 411 412\end_layout 413 414\begin_deeper 415\begin_layout Itemize 416(since 0.98.0, released 2015 until 3.0.0 released 2020) based on local Berkeley 417 DB files generated from downloaded CSV files 418\end_layout 419 420\begin_layout Itemize 421native MaxMindDB files (support since 2.0.0, released 2019) 422\end_layout 423 424\end_deeper 425\begin_layout Itemize 426\begin_inset Quotes eld 427\end_inset 428 429External 430\begin_inset Quotes erd 431\end_inset 432 433 (since 0.98.0, released 2015), based on local Berkeley DB files, generated 434 from downloaded TXT/XML files (registries assignment databases). 435 Supporting IPv4/IPv6 to Registries and IPv4/IPv6 to CountryCode. 436 If newer, overruling the related included databases. 437\end_layout 438 439\begin_layout Standard 440Since version 0.95.0 the tool can be compiled to use dynamically loading of 441 library, means the binaries can be also used on systems where IP2Location 442 or GeoIP libraries are not existing. 443 On such system, the support is simply disabled then and some capabilities/featu 444res which requires the databases are disabled. 445\end_layout 446 447\begin_layout Standard 448Since version 0.97.4 also fallback code for GeoIP and IP2Location is included 449 in the source package, means that support of dynamically loading of library 450 can be included during compilation without having related development sources 451 on the system. 452\end_layout 453 454\begin_layout Standard 455Since version 2.0.0 MaxMindDB is supported (linked or dynamically loaded) 456\end_layout 457 458\begin_layout Standard 459Since version 3.0.0 GeoIP(legacy) and db-ip.com(BerkeleyDB) is remoed 460\end_layout 461 462\begin_layout Section 463License 464\end_layout 465 466\begin_layout Standard 467The program is published under the GNU GPL version 2. 468\end_layout 469 470\begin_layout Section 471Copyright 472\end_layout 473 474\begin_layout Standard 475(C) 2001 - 2021 by Dr. 476 Peter Bieringer 477\end_layout 478 479\begin_layout Section 480Author 481\end_layout 482 483\begin_layout Standard 484The author of ipv6calc is 485\end_layout 486 487\begin_layout Itemize 488\begin_inset CommandInset href 489LatexCommand href 490name "Dr. Peter Bieringer" 491target "mailto:pb@bieringer.de" 492literal "false" 493 494\end_inset 495 496 with some minor contribution by others 497\end_layout 498 499\begin_layout Section 500Where to get sources or binaries 501\end_layout 502 503\begin_layout Subsection 504Latest version of sources 505\end_layout 506 507\begin_layout Itemize 508Via GitHub (since 2016-09-05) at 509\begin_inset CommandInset href 510LatexCommand href 511name "GitHub / ipv6calc" 512target "https://github.com/pbiering/ipv6calc" 513literal "false" 514 515\end_inset 516 517 518\end_layout 519 520\begin_layout Subsection 521Releases 522\end_layout 523 524\begin_layout Subsubsection 525as tar.gz or zip 526\end_layout 527 528\begin_layout Itemize 529via HTTPS at 530\begin_inset CommandInset href 531LatexCommand href 532name "GitHub / ipv6calc / releases" 533target "https://github.com/pbiering/ipv6calc/releases" 534literal "false" 535 536\end_inset 537 538 539\end_layout 540 541\begin_layout Subsubsection 542as tar.gz (signed) 543\end_layout 544 545\begin_layout Itemize 546from 547\begin_inset CommandInset href 548LatexCommand href 549name "DeepSpace6" 550target "http://www.deepspace6.net/" 551literal "false" 552 553\end_inset 554 555 via FTP 556\begin_inset CommandInset href 557LatexCommand href 558name "DeepSpace6 / anonymous FTP" 559target "ftp://ftp.deepspace6.net/pub/ds6/sources/ipv6calc/" 560literal "false" 561 562\end_inset 563 564 or HTTP 565\begin_inset CommandInset href 566LatexCommand href 567name "http://www.deepspace6.net/ftp/" 568target "http://www.deepspace6.net/ftp/" 569literal "false" 570 571\end_inset 572 573 574\end_layout 575 576\begin_layout Itemize 577via 578\begin_inset CommandInset href 579LatexCommand href 580name "ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/" 581target "ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/" 582literal "false" 583 584\end_inset 585 586 or HTTP at 587\begin_inset CommandInset href 588LatexCommand href 589name "http://www.bieringer.de/ftp/" 590target "http://www.bieringer.de/ftp/" 591literal "false" 592 593\end_inset 594 595 596\end_layout 597 598\begin_layout Standard 599Since version 0.95.0 packages are signed with new GPG key, also available 600 here: 601\begin_inset CommandInset href 602LatexCommand href 603name "CODE-GPG-KEY-bieringer.de-2013 @ftp.bieringer.de" 604target "ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/CODE-GPG-KEY-bieringer.de-2013" 605literal "false" 606 607\end_inset 608 609 or 610\begin_inset CommandInset href 611LatexCommand href 612name "CODE-GPG-KEY-bieringer.de-2013 @ftp.deepspace6.net" 613target "ftp://ftp.deepspace6.net/pub/ds6/sources/ipv6calc/CODE-GPG-KEY-bieringer.de-2013" 614literal "false" 615 616\end_inset 617 618 619\end_layout 620 621\begin_layout Code 622 623Key fingerprint: AAB3 8CB7 97C7 50C7 78C6 08C6 DDEB 141D F738 0F61 624\end_layout 625 626\begin_layout Code 627 628uid: Peter Bieringer (Code Signing Key 2013) <code@bieringer.de> 629\end_layout 630 631\begin_layout Standard 632A SPEC file is included, so you can build a RPM from tar.gz using 633\end_layout 634 635\begin_layout Code 636 637$ rpmbuild -ta path/to/ipv6calc-$version.tar.gz 638\end_layout 639 640\begin_layout Standard 641In addition, conditional build options are available (see related configure 642 options below): 643\end_layout 644 645\begin_layout Code 646 647--without ip2location 648\end_layout 649 650\begin_layout Code 651 652--without mmdb (which disables GeoIP v2 and db-ip.com v2) 653\end_layout 654 655\begin_layout Code 656 657--without external 658\end_layout 659 660\begin_layout Code 661 662--without shared 663\end_layout 664 665\begin_layout Code 666 667--without mod_ipv6calc 668\end_layout 669 670\begin_layout Subsubsection 671as RPM 672\end_layout 673 674\begin_layout Standard 675Can be searched via 676\begin_inset CommandInset href 677LatexCommand href 678name "rpmfind / ipv6calc" 679target "http://www.rpmfind.net/linux/rpm2html/search.php?query=ipv6calc" 680literal "false" 681 682\end_inset 683 684. 685\end_layout 686 687\begin_layout Subsection 688Ready to use packages for several operating systems: 689\end_layout 690 691\begin_layout Subsubsection 692Fedora Linux 693\end_layout 694 695\begin_layout Standard 696Fedora 29 is the current developing platform, so use given hints above to 697 create a RPM. 698 Since Fedora 7 this package is included by default. 699\end_layout 700 701\begin_layout Standard 702See also 703\begin_inset CommandInset href 704LatexCommand href 705name "FedoraProject / Packages / ipv6calc" 706target "https://src.fedoraproject.org/rpms/ipv6calc" 707literal "false" 708 709\end_inset 710 711 712\end_layout 713 714\begin_layout Subsubsection 715Red Hat Enterprise Linux and clones 716\end_layout 717 718\begin_layout Standard 719It's tested by the developer that creation of the RPM is working fine starting 720 with RHEL 4. 721\end_layout 722 723\begin_layout Itemize 724Major version 5 has the package included by default (but an rather old version) 725\begin_inset Separator latexpar 726\end_inset 727 728 729\end_layout 730 731\begin_deeper 732\begin_layout Itemize 733RPMs of newer releases are available as test builds on koji, see related 734 URL in announcements 735\begin_inset CommandInset href 736LatexCommand href 737name "ipv6calc-announce / list archive" 738target "https://lists.deepspace6.net/pipermail/ipv6calc-announce/" 739literal "false" 740 741\end_inset 742 743 744\end_layout 745 746\begin_layout Itemize 747*** Untested since version 2.0.0 because OS is out of support *** 748\end_layout 749 750\end_deeper 751\begin_layout Itemize 752Major version 6: available since September 2014 on 753\begin_inset CommandInset href 754LatexCommand href 755name "FedoraProject / EPEL" 756target "https://fedoraproject.org/wiki/EPEL" 757literal "false" 758 759\end_inset 760 761, see also 762\begin_inset CommandInset href 763LatexCommand href 764name "FedoraProject / Packages / ipv6calc" 765target "https://src.fedoraproject.org/rpms/ipv6calc" 766literal "false" 767 768\end_inset 769 770 771\end_layout 772 773\begin_deeper 774\begin_layout Itemize 775*** Untested since version 3.0.1 because OS is out of support *** 776\end_layout 777 778\end_deeper 779\begin_layout Itemize 780Major version 7: available since Decenber 2016 on 781\begin_inset CommandInset href 782LatexCommand href 783name "FedoraProject / EPEL" 784target "https://fedoraproject.org/wiki/EPEL" 785literal "false" 786 787\end_inset 788 789, see also 790\begin_inset CommandInset href 791LatexCommand href 792name "FedoraProject / Packages / ipv6calc" 793target "https://src.fedoraproject.org/rpms/ipv6calc" 794literal "false" 795 796\end_inset 797 798 799\end_layout 800 801\begin_layout Itemize 802Major version 8: available since September 2019 on 803\begin_inset CommandInset href 804LatexCommand href 805name "FedoraProject / EPEL" 806target "https://fedoraproject.org/wiki/EPEL" 807literal "false" 808 809\end_inset 810 811, see also 812\begin_inset CommandInset href 813LatexCommand href 814name "FedoraProject / Packages / ipv6calc" 815target "https://src.fedoraproject.org/rpms/ipv6calc" 816literal "false" 817 818\end_inset 819 820 821\end_layout 822 823\begin_layout Standard 824CentOS 7 and Rocky 8 are also platforms for regression tests. 825\end_layout 826 827\begin_layout Subsubsection 828Gentoo/Funtoo 829\end_layout 830 831\begin_layout Standard 832Package is maintained, nevertheless, Funtoo is used as platform for regression 833 tests. 834\end_layout 835 836\begin_layout Subsubsection 837Ubuntu 838\end_layout 839 840\begin_layout Standard 841Package is maintained, more information can be found at 842\begin_inset CommandInset href 843LatexCommand href 844name "https://packages.ubuntu.com/ipv6calc" 845target "https://packages.ubuntu.com/ipv6calc" 846literal "false" 847 848\end_inset 849 850 851\end_layout 852 853\begin_layout Subsubsection 854Debian GNU/Linux 855\end_layout 856 857\begin_layout Standard 858Package is maintained, more information can be found at 859\begin_inset CommandInset href 860LatexCommand href 861name "http://packages.debian.org/ipv6calc" 862target "http://packages.debian.org/ipv6calc" 863literal "false" 864 865\end_inset 866 867 868\end_layout 869 870\begin_layout Subsubsection 871openSUSE 872\end_layout 873 874\begin_layout Standard 875Package is maintained, more information can be found at 876\begin_inset CommandInset href 877LatexCommand href 878name "http://download.opensuse.org/repositories/home:/uebelhacker/" 879target "http://download.opensuse.org/repositories/home:/uebelhacker/" 880literal "false" 881 882\end_inset 883 884 885\end_layout 886 887\begin_layout Subsubsection 888NetBSD 889\end_layout 890 891\begin_layout Standard 892See here for more: 893\begin_inset CommandInset href 894LatexCommand href 895name "ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/net/ipv6calc/README.html" 896target "ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/net/ipv6calc/README.html" 897literal "false" 898 899\end_inset 900 901 902\end_layout 903 904\begin_layout Subsubsection 905FreeBSD 906\end_layout 907 908\begin_layout Standard 909See here for more: 910\begin_inset CommandInset href 911LatexCommand href 912name "http://www.freshports.org/net-mgmt/ipv6calc/" 913target "http://www.freshports.org/net-mgmt/ipv6calc/" 914literal "false" 915 916\end_inset 917 918 ( 919\begin_inset CommandInset href 920LatexCommand href 921name "http://www.freebsd.org/cgi/query-pr.cgi?pr=34441" 922target "http://www.freebsd.org/cgi/query-pr.cgi?pr=34441" 923literal "false" 924 925\end_inset 926 927) 928\end_layout 929 930\begin_layout Subsubsection 931OpenBSD 932\end_layout 933 934\begin_layout Standard 935See here for more: 936\begin_inset CommandInset href 937LatexCommand href 938name "http://www.openbsd.org/cgi-bin/cvsweb/ports/net/ipv6calc/" 939target "http://www.openbsd.org/cgi-bin/cvsweb/ports/net/ipv6calc/" 940literal "false" 941 942\end_inset 943 944 945\end_layout 946 947\begin_layout Section 948Configuring & Compiling 949\end_layout 950 951\begin_layout Subsection 952Configuring 953\end_layout 954 955\begin_layout Standard 956Following 957\begin_inset Quotes eld 958\end_inset 959 960ipc6calc 961\begin_inset Quotes erd 962\end_inset 963 964 related configure options are currently supported (note: disabling the 965 internal databases reduces the size of the resulting binaries/shared library 966 a lot): 967\end_layout 968 969\begin_layout Code 970 971--disable-dynamic-load Disable dynamic load of libraries (default: enabled) 972\end_layout 973 974\begin_layout Code 975 976\end_layout 977 978\begin_layout Code 979 980--disable-db-ieee Disable build-in IEEE database (default: enabled) 981\end_layout 982 983\begin_layout Code 984 985--disable-db-ipv4 Disable build-in IPv4 database (default: enabled) 986\end_layout 987 988\begin_layout Code 989 990--disable-db-ipv6 Disable build-in IPv6 database (default: enabled) 991\end_layout 992 993\begin_layout Code 994 995--disable-db-as-registry Disable built-in AS-to-Registry database (default: 996 enabled) 997\end_layout 998 999\begin_layout Code 1000 1001--disable-db-cc-registry Disable built-in CountryCode-to-Registry database 1002 (default: enabled) 1003\end_layout 1004 1005\begin_layout Code 1006 1007--disable-geoip2 Disable MaxMindDB support for GeoIP (default: enabled) 1008\end_layout 1009 1010\begin_layout Code 1011 1012--disable-dbip2 Disable MaxMindDB support for db-ip.com (default: 1013 enabled) 1014\end_layout 1015 1016\begin_layout Code 1017 1018--enable-mmdb Enable MaxMindDB support (GeoIP/db-ip.com) (default: 1019 disabled) 1020\end_layout 1021 1022\begin_layout Code 1023 1024--enable-external Enable external db support (default: disabled) 1025\end_layout 1026 1027\begin_layout Code 1028 1029--enable-ip2location Enable IP2Location support (default: disabled) 1030\end_layout 1031 1032\begin_layout Code 1033 1034--enable-mod_ipv6calc Enable build of mod_ipv6calc for Apache (default: 1035 disabled) 1036\end_layout 1037 1038\begin_layout Code 1039 1040\end_layout 1041 1042\begin_layout Code 1043 1044--with-mmdb-dynamic Enable use of dynamic loading of MaxMindDB library 1045 (default=no) 1046\end_layout 1047 1048\begin_layout Code 1049 1050--with-mmdb-headers=DIR MaxMindDB include files location 1051\end_layout 1052 1053\begin_layout Code 1054 1055--with-mmdb-lib=DIR MaxMindDB library location 1056\end_layout 1057 1058\begin_layout Code 1059 1060--with-mmdb-dyn-lib=NAME Use specified MaxMindDB dynamic library, default: 1061 libmaxminddb.so.0 1062\end_layout 1063 1064\begin_layout Code 1065 1066\end_layout 1067 1068\begin_layout Code 1069 1070--with-ip2location-headers=DIR IP2Location include files location 1071\end_layout 1072 1073\begin_layout Code 1074 1075--with-ip2location-headers-fallback IP2Location include files from internal 1076 fallback location (only usable with dynamic load option) 1077 1078\end_layout 1079 1080\begin_layout Code 1081 1082--with-ip2location-lib=FILE IP2Location library location 1083\end_layout 1084 1085\begin_layout Code 1086 1087--with-ip2location-static Explicitly link IP2Location statically 1088 (default=no) 1089\end_layout 1090 1091\begin_layout Code 1092 1093--with-ip2location-dynamic Enable use of dynamic loading of IP2Location 1094 library (default=no) 1095\end_layout 1096 1097\begin_layout Code 1098 1099--with-ip2location-db=DIR Use specified IP2Location database directory 1100, default: /usr/share/IP2Location 1101\end_layout 1102 1103\begin_layout Code 1104 1105--with-ip2location-dyn-lib=NAME Use specified IP2Location dynamic library, 1106 default: libIP2Location.so 1107\end_layout 1108 1109\begin_layout Code 1110 1111\end_layout 1112 1113\begin_layout Code 1114 1115--with-geoip-db=DIR Use specified GeoIP database directory, 1116 default: /usr/share/GeoIP 1117\end_layout 1118 1119\begin_layout Code 1120 1121\end_layout 1122 1123\begin_layout Code 1124 1125--with-dbip-db=DIR Use specified db-ip.com database directory, default: 1126 /usr/share/DBIP 1127\end_layout 1128 1129\begin_layout Code 1130 1131\end_layout 1132 1133\begin_layout Code 1134 1135--with-external-db=DIR Use specified external database directory, default: 1136 /usr/share/ipv6calc/db 1137\end_layout 1138 1139\begin_layout Code 1140 1141\end_layout 1142 1143\begin_layout Code 1144 1145--with-apxs=NAME name of the apxs executable (apxs) 1146\end_layout 1147 1148\begin_layout Code 1149 1150\end_layout 1151 1152\begin_layout Code 1153 1154--enable-shared Enable shared library build (default: disabled) 1155\end_layout 1156 1157\begin_layout Code 1158 1159\end_layout 1160 1161\begin_layout Code 1162 1163--enable-bundled-getopt Enable bundled getopt library (default: 1164 autoselected) 1165\end_layout 1166 1167\begin_layout Code 1168 1169--enable-bundled-md5 Enable bundled MD5 library (default: autoselecte 1170d) 1171\end_layout 1172 1173\begin_layout Subsection 1174Compiling 1175\end_layout 1176 1177\begin_layout Standard 1178As usual, use 1179\end_layout 1180 1181\begin_layout Code 1182 1183$ make 1184\end_layout 1185 1186\begin_layout Standard 1187and run tests afterwards using 1188\end_layout 1189 1190\begin_layout Code 1191 1192$ make test 1193\end_layout 1194 1195\begin_layout Standard 1196or at least (e.g. 1197 if external databases are not available) 1198\end_layout 1199 1200\begin_layout Code 1201 1202$ make test-minimal 1203\end_layout 1204 1205\begin_layout Subsection 1206Configuring & Compiling with Presets 1207\end_layout 1208 1209\begin_layout Standard 1210A shell script is included which can configure and compile with standard 1211 presets (also used during regression tests): 1212\end_layout 1213 1214\begin_layout Code 1215 1216$ ./autogen.sh -h 1217\end_layout 1218 1219\begin_layout Code 1220 1221Supported options: 1222\end_layout 1223 1224\begin_layout Code 1225 1226 -?|-h|--help : this help 1227\end_layout 1228 1229\begin_layout Code 1230 1231 -n|--no-make : stop before running 'make' 1232\end_layout 1233 1234\begin_layout Code 1235 1236 -a|--all : enable GeoIP/IP2Location/db-ip.com/External/mod_ipv6calc 1237 support 1238\end_layout 1239 1240\begin_layout Code 1241 1242 -A|--ALL : enable GeoIP/IP2Location/db-ip.com/External/mod_ipv6calc 1243 support with dynamic library support 1244\end_layout 1245 1246\begin_layout Code 1247 1248 -m|--mmdb : enable MaxMindDB support (GeoIP/db-ip.com) 1249\end_layout 1250 1251\begin_layout Code 1252 1253 --mmdb-dyn|-M : switch to dynamic library loading of MaxMindDB 1254\end_layout 1255 1256\begin_layout Code 1257 1258 --disable-geoip2 : disable MaxMindDB support for GeoIP 1259\end_layout 1260 1261\begin_layout Code 1262 1263 --disable-dbip2 : disable MaxMindDB support for db-ip.com 1264\end_layout 1265 1266\begin_layout Code 1267 1268 -i|--ip2location : enable IP2Location support 1269\end_layout 1270 1271\begin_layout Code 1272 1273 --ip2location-dyn|-I: switch to dynamic library loading of IP2Location 1274\end_layout 1275 1276\begin_layout Code 1277 1278 -e|--external : enable external database support 1279\end_layout 1280 1281\begin_layout Code 1282 1283 --disable-db-ieee : disable built-in IEEE database 1284\end_layout 1285 1286\begin_layout Code 1287 1288 --disable-db-ipv4 : disable built-in IPv4 database 1289\end_layout 1290 1291\begin_layout Code 1292 1293 --disable-db-ipv6 : disable built-in IPv6 database 1294\end_layout 1295 1296\begin_layout Code 1297 1298 -S : enable shared library mode 1299\end_layout 1300 1301\begin_layout Code 1302 1303 --no-static-build : skip static build 1304\end_layout 1305 1306\begin_layout Code 1307 1308 --no-test : skip 'make test' 1309\end_layout 1310 1311\begin_layout Code 1312 1313 --clang : use 'clang' instead of default (usually 'gcc') 1314\end_layout 1315 1316\begin_layout Code 1317 1318 --m32 : compile for 32-bit 1319\end_layout 1320 1321\begin_layout Code 1322 1323 --relax : don't stop on compiler warnings 1324\end_layout 1325 1326\begin_layout Section 1327Mailling Lists 1328\end_layout 1329 1330\begin_layout Subsection 1331ipv6calc-announce 1332\end_layout 1333 1334\begin_layout Description 1335Reason: sending announcements of new versions 1336\end_layout 1337 1338\begin_layout Description 1339Traffic: very low 1340\end_layout 1341 1342\begin_layout Description 1343Postings: only moderators are allowed to post 1344\end_layout 1345 1346\begin_layout Description 1347Information: 1348\begin_inset CommandInset href 1349LatexCommand href 1350name "DeepSpace6 / maillist ipv6calc-announce" 1351target "http://lists.deepspace6.net/listinfo/ipv6calc-announce" 1352literal "false" 1353 1354\end_inset 1355 1356 1357\end_layout 1358 1359\begin_layout Subsection 1360ipv6calc 1361\end_layout 1362 1363\begin_layout Description 1364Reason: discussions 1365\end_layout 1366 1367\begin_layout Description 1368Traffic: low 1369\end_layout 1370 1371\begin_layout Description 1372Postings: subscribers 1373\end_layout 1374 1375\begin_layout Description 1376Information: 1377\begin_inset CommandInset href 1378LatexCommand href 1379name "DeepSpace6 / maillist ipv6calc" 1380target "http://lists.deepspace6.net/listinfo/ipv6calc" 1381literal "false" 1382 1383\end_inset 1384 1385 1386\end_layout 1387 1388\begin_layout Section 1389Bug Reports 1390\end_layout 1391 1392\begin_layout Standard 1393You can send bug reports to the author himself or subscribe to maillist 1394 1395\begin_inset Quotes eld 1396\end_inset 1397 1398ipv6calc 1399\begin_inset Quotes erd 1400\end_inset 1401 1402 and send it to the list. 1403\end_layout 1404 1405\begin_layout Section 1406Features of ipv6calc 1407\end_layout 1408 1409\begin_layout Subsection 1410Description 1411\end_layout 1412 1413\begin_layout Standard 1414The main program named 1415\begin_inset Quotes eld 1416\end_inset 1417 1418ipv6calc 1419\begin_inset Quotes erd 1420\end_inset 1421 1422 is able to recognize many (not only) IPv6 address formats and depending 1423 on a selectable action (not required) a selectable output format can be 1424 specified. 1425 Also it has the capability to show detailed information of an IPv4/IPv6 1426 address or anonymize it. 1427\end_layout 1428 1429\begin_layout Subsection 1430List of built-in features 1431\end_layout 1432 1433\begin_layout Standard 1434Option 1435\begin_inset Quotes eld 1436\end_inset 1437 1438-v 1439\begin_inset Quotes erd 1440\end_inset 1441 1442 shows built-in features, depending on configuration before compiling: 1443\end_layout 1444 1445\begin_layout Code 1446 1447$ ipv6calc -v 1448\end_layout 1449 1450\begin_layout Code 1451 1452ipv6calc: version 3.0.0 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6 1453 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC 1454 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION 1455 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID 1456 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T 1457YPE-GEONAMEID 1458\end_layout 1459 1460\begin_layout Standard 1461Option 1462\begin_inset Quotes eld 1463\end_inset 1464 1465-v -v 1466\begin_inset Quotes erd 1467\end_inset 1468 1469 (since 0.91.0) shows built-in features and capabilities in detail, depending 1470 on configuration before compiling: 1471\end_layout 1472 1473\begin_layout Code 1474 1475$ ipv6calc -vv 1476\end_layout 1477 1478\begin_layout Code 1479 1480ipv6calc: version 3.0.0 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6 1481 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC 1482 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION 1483 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID 1484 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T 1485YPE-GEONAMEID 1486\end_layout 1487 1488\begin_layout Code 1489 1490Capabilities: GeoIP2(linked/MaxMindDB) IP2Location(linked) DBIP2(linked/MaxMindD 1491B) ExternalDatabase DB_AS_REG(BuiltIn) DB_CC_REG(BuiltIn) DB_IPV4_REG(BuiltIn) 1492 DB_IPV6_REG(BuiltIn) DB_IEEE(BuiltIn) 1493\end_layout 1494 1495\begin_layout Code 1496 1497Internal main library version: 3.0.0 API: 3.0.0 (built-in) 1498\end_layout 1499 1500\begin_layout Code 1501 1502Internal database library version: 3.0.0 API: 3.0.0 (built-in) 1503\end_layout 1504 1505\begin_layout Code 1506 1507Compiled: Oct 13 2020 19:38:16 1508\end_layout 1509 1510\begin_layout Code 1511 1512MaxMindDB for GeoIP2/DBIP2 support enabled 1513\end_layout 1514 1515\begin_layout Code 1516 1517MaxMindDB dynamic library version (on this system): 1.4.2 1518\end_layout 1519 1520\begin_layout Code 1521 1522GeoIP2 (MaxMindDB) support enabled 1523\end_layout 1524 1525\begin_layout Code 1526 1527GeoIP2 available databases: Country4=1 Country6=1 ASN4=1 ASN6=1 City4=1 1528 City6=1 1529\end_layout 1530 1531\begin_layout Code 1532 1533IP2Location support enabled, compiled with API version: 8.2.0, dynamically 1534 linked with version: API=8.2.0 Major=8 1535\end_layout 1536 1537\begin_layout Code 1538 1539IP2Location available databases: Country4=1 Country6=1 ASN4=0 ASN6=0 City4=1 1540 City6=1 1541\end_layout 1542 1543\begin_layout Code 1544 1545DBIP2 (MaxMindDB) support enabled 1546\end_layout 1547 1548\begin_layout Code 1549 1550DBIP2 available databases: Country4=1 Country6=1 ASN4=1 ASN6=1 City4=1 City6=1 1551\end_layout 1552 1553\begin_layout Code 1554 1555External available databases: Country4=1 Country6=1 IPV4_REG=1 IPV6_REG=1 1556\end_layout 1557 1558\begin_layout Code 1559 1560BuiltIn databases available: ASN_REG=1 IPV4_REG=1 IPV6_REG=1 IEEE=1 CC_REG=1 1561\end_layout 1562 1563\begin_layout Code 1564 1565DB features: 0xff07ffff 1566\end_layout 1567 1568\begin_layout Code 1569 1570GeoIP(MaxMindDB): features available/implemented: 0x03063ff0/0x03063ff0 1571 (100%) 1572\end_layout 1573 1574\begin_layout Code 1575 1576GeoIP2: info of available databases in directory: /usr/share/GeoIP 1577\end_layout 1578 1579\begin_layout Code 1580 1581GeoIP2: IPv4/v6 CountryCode (FREE) : [1] GeoLite2-Country.mmdb 1582 (GeoLite2-Country Copyright (c) 2019 MaxMind All Rights Reserved, created: 1583 20191217-195954 UTC) 1584\end_layout 1585 1586\begin_layout Code 1587 1588GeoIP2: IPv4/v6 City (FREE) : [2] GeoLite2-City.mmdb 1589 (GeoLite2-City Copyright (c) 2019 MaxMind All Rights Reserved, created: 1590 20191217-200126 UTC) 1591\end_layout 1592 1593\begin_layout Code 1594 1595GeoIP2: IPv4/v6 ASN (FREE) : [3] GeoLite2-ASN.mmdb 1596 (GeoLite2-ASN Copyright (c) 2019 MaxMind All Rights Reserved, created: 1597 20190122-114228 UTC) 1598\end_layout 1599 1600\begin_layout Code 1601 1602GeoIP2: detected best databases FREE Country4=2 Country6=2 City4=2 1603 City6=2 1604\end_layout 1605 1606\begin_layout Code 1607 1608GeoIP2: detected best databases COMM Country4=0 Country6=0 City4=0 1609 City6=0 1610\end_layout 1611 1612\begin_layout Code 1613 1614GeoIP2: selected best databases normal Country4=2 Country6=2 City4=2 1615 City6=2 1616\end_layout 1617 1618\begin_layout Code 1619 1620GeoIP2: selected best databases method: COMM older than 12 months are deselected 1621 in case of FREE is available 1622\end_layout 1623 1624\begin_layout Code 1625 1626GeoIP2: selected best databases method: COMM/FREE with more features are 1627 only selected in case not older than 1 months of already found COMM/FREE 1628\end_layout 1629 1630\begin_layout Code 1631 1632IP2Location: features available/implemented: 0x0c003fc0/0x0c003fc0 (100%) 1633\end_layout 1634 1635\begin_layout Code 1636 1637IP2Location: info of available databases in directory: /usr/share/IP2Location 1638\end_layout 1639 1640\begin_layout Code 1641 1642IP2Location: Copyright (c) IP2Location All Rights Reserved 1643\end_layout 1644 1645\begin_layout Code 1646 1647IP2Location: IPv4 Country :[ 49] IP-COUNTRY-S 1648AMPLE.BIN (IP2L-DB1 IPv4 IPv6 SAMPLE 20201005) 1649\end_layout 1650 1651\begin_layout Code 1652 1653IP2Location: IPv4 Co/Re/Ci/LaLo/ZI/TZ/IS/Do/Ne/Ar/We/Mo :[ 68] IP-COUNTRY-R 1654EGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEAT 1655HER-MOBILE-SAMPLE.BIN (IP2L-DB20 IPv4 IPv6 SAMPLE 20190129) 1656\end_layout 1657 1658\begin_layout Code 1659 1660IP2Location: IPv4 Co/Re/Ci/LaLo/ZI/TZ/IS/Do/Ne/Ar/We/Mo/El/Us:[ 72] IP-COUNTRY-R 1661EGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEAT 1662HER-MOBILE-ELEVATION-USAGETYPE-SAMPLE.BIN (IP2L-DB24 IPv4 IPv6 SAMPLE 20190129) 1663\end_layout 1664 1665\begin_layout Code 1666 1667IP2Location: IPv6 Country :[ 73] IPV6-COUNTRY. 1668SAMPLE.BIN (IP2L-DB1 IPv4 IPv6 SAMPLE 20201005) 1669\end_layout 1670 1671\begin_layout Code 1672 1673IP2Location: IPv6 Co/Re/Ci/LaLo/ZI/TZ/IS/Do/Ne/Ar/We/Mo :[ 92] IPV6-COUNTRY 1674-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WE 1675ATHER-MOBILE.SAMPLE.BIN (IP2L-DB20 IPv4 IPv6 SAMPLE 20171128) 1676\end_layout 1677 1678\begin_layout Code 1679 1680IP2Location: IPv6 Co/Re/Ci/LaLo/ZI/TZ/IS/Do/Ne/Ar/We/Mo/El/Us:[ 96] IPV6-COUNTRY 1681-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WE 1682ATHER-MOBILE-ELEVATION-USAGETYPE.SAMPLE.BIN (IP2L-DB24 IPv4 IPv6 SAMPLE 20171128) 1683\end_layout 1684 1685\begin_layout Code 1686 1687IP2Location: IPvx Co/Re/Ci/LattLong/ZIP/TZ :[ 35] IPV6-COUNTRY 1688-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE.BIN (IP2L-DB11 IPv4 IPv6 1689 20181226) 1690\end_layout 1691 1692\begin_layout Code 1693 1694IP2Location: detected best databases SAMPLE Country4=49 Country6=73 1695 City4=72 City6=96 1696\end_layout 1697 1698\begin_layout Code 1699 1700IP2Location: detected best databases LITE Country4=0 Country6=0 1701 City4=0 City6=0 1702\end_layout 1703 1704\begin_layout Code 1705 1706IP2Location: detected best databases COMM Country4=35 Country6=35 1707 City4=35 City6=35 1708\end_layout 1709 1710\begin_layout Code 1711 1712IP2Location: selected best databases LI->SA* Country4=0 Country6=0 1713 City4=0 City6=0 1714\end_layout 1715 1716\begin_layout Code 1717 1718IP2Location: selected best databases normal Country4=35 Country6=35 1719 City4=35 City6=35 1720\end_layout 1721 1722\begin_layout Code 1723 1724IP2Location: selected best databases method: * = autoswitch from LITE to 1725 SAMPLE enabled in case not older than 12 months and having more features 1726\end_layout 1727 1728\begin_layout Code 1729 1730IP2Location: selected best databases method: COMM older than 12 months are 1731 deselected in case of LITE is available 1732\end_layout 1733 1734\begin_layout Code 1735 1736IP2Location: selected best databases method: COMM/LITE/SAMPLE with more 1737 features are only selected in case not older than 1 months of already found 1738 COMM/LITE/SAMPLE 1739\end_layout 1740 1741\begin_layout Code 1742 1743IP2Location: selected best databases method: softlinks: skipped-by-default 1744\end_layout 1745 1746\begin_layout Code 1747 1748db-ip.com(MaxMindDB): features available/implemented: 0x30063ff0/0x30063ff0 1749 (100%) 1750\end_layout 1751 1752\begin_layout Code 1753 1754DBIP2: info of available databases in directory: /usr/share/DBIP 1755\end_layout 1756 1757\begin_layout Code 1758 1759DBIP2: IPv4/v6 CountryCode (FREE) : [1] dbip-country-lite.mmdb 1760 (DBIP-Country-Lite Copyright (c) 2019 db-ip.com All Rights Reserved, created: 1761 20190831-232938 UTC) 1762\end_layout 1763 1764\begin_layout Code 1765 1766DBIP2: IPv4/v6 City (FREE) : [2] dbip-city-lite.mmdb 1767 (DBIP-City-Lite Copyright (c) 2019 db-ip.com All Rights Reserved, created: 1768 20190831-233248 UTC) 1769\end_layout 1770 1771\begin_layout Code 1772 1773DBIP2: IPv4/v6 Location+ISP (COMM) : [6] dbip-location-isp.mmdb 1774 (DBIP-Location-ISP (compat=Enterprise) Copyright (c) 2019 db-ip.com All 1775 Rights Reserved, created: 20190101-015418 UTC) 1776\end_layout 1777 1778\begin_layout Code 1779 1780DBIP2: detected best databases FREE Country4=2 Country6=2 City4=2 1781 City6=2 1782\end_layout 1783 1784\begin_layout Code 1785 1786DBIP2: detected best databases COMM Country4=6 Country6=6 City4=6 1787 City6=6 1788\end_layout 1789 1790\begin_layout Code 1791 1792DBIP2: selected best databases normal Country4=6 Country6=6 City4=6 1793 City6=6 1794\end_layout 1795 1796\begin_layout Code 1797 1798DBIP2: selected best databases method: COMM older than 12 months are deselected 1799 in case of FREE is available 1800\end_layout 1801 1802\begin_layout Code 1803 1804DBIP2: selected best databases method: COMM/FREE with more features are 1805 only selected in case not older than 1 months of already found COMM/FREE 1806\end_layout 1807 1808\begin_layout Code 1809 1810External: features available/implemented: 0xc00180cc/0xc00180cc (100%) 1811\end_layout 1812 1813\begin_layout Code 1814 1815External: info of available databases in directory: /usr/share/ipv6calc/db 1816\end_layout 1817 1818\begin_layout Code 1819 1820External: IPv4 Registry : ipv6calc-external-ipv4-registry.db 1821 (EXTDB-1/AFRINIC/20200904 APNIC/20200903 ARIN/20200903 IANA/20191227 LACNIC/202 182200903 LISP/20200318 RIPENCC/20200903, created: 20200904-061346 UTC) 1823\end_layout 1824 1825\begin_layout Code 1826 1827External: IPv6 Registry : ipv6calc-external-ipv6-registry.db 1828 (EXTDB-2/AFRINIC/20200904 APNIC/20200903 ARIN/20200903 IANA/20191106 LACNIC/202 182900903 LISP/20200318 RIPENCC/20200903, created: 20200904-063305 UTC) 1830\end_layout 1831 1832\begin_layout Code 1833 1834External: IPv4 CountryCode : ipv6calc-external-ipv4-countrycode.db 1835 (EXTDB-3/AFRINIC/20200904 APNIC/20200903 ARIN/20200903 IANA/20191227 LACNIC/202 183600903 LISP/20200318 RIPENCC/20200903, created: 20200904-061347 UTC) 1837\end_layout 1838 1839\begin_layout Code 1840 1841External: IPv6 CountryCode : ipv6calc-external-ipv6-countrycode.db 1842 (EXTDB-4/AFRINIC/20200904 APNIC/20200903 ARIN/20200903 IANA/20191106 LACNIC/202 184300903 LISP/20200318 RIPENCC/20200903, created: 20200904-063305 UTC) 1844\end_layout 1845 1846\begin_layout Code 1847 1848BuiltIn: features available/implemented: 0x0001c00f/0x0001c00f (100%) 1849\end_layout 1850 1851\begin_layout Code 1852 1853BuiltIn: info of available databases 1854\end_layout 1855 1856\begin_layout Code 1857 1858BuiltIn: ASN : IANA/20200518 1859\end_layout 1860 1861\begin_layout Code 1862 1863BuiltIn: CC : AFRINIC/20201012 APNIC/20201010 ARIN/20201011 LACNIC/20201009 1864 RIPENCC/20201011 1865\end_layout 1866 1867\begin_layout Code 1868 1869BuiltIn: IPv4 : AFRINIC/20201012 APNIC/20201010 ARIN/20201011 IANA/20191227 1870 LACNIC/20201009 LISP/20200318 RIPENCC/20201011 (created: 20201012-064251 1871 UTC) 1872\end_layout 1873 1874\begin_layout Code 1875 1876BuiltIn: IPv6 : AFRINIC/20201012 APNIC/20201010 ARIN/20201011 IANA/20191106 1877 LACNIC/20201009 LISP/20200318 RIPENCC/20201011 (created: 20201012-070210 1878 UTC) 1879\end_layout 1880 1881\begin_layout Code 1882 1883BuiltIn: IEEE : IAB/20201012 OUI/20201012 OUI28/20201012 OUI36/20201012 1884\end_layout 1885 1886\begin_layout Code 1887 1888Database selection or priorization ('->': subsequential calls) 1889\end_layout 1890 1891\begin_layout Code 1892 1893Database priorization default: GeoIP(MaxMindDB)->IP2Location->db-ip.com(MaxMindDB 1894)->GeoIP->db-ip.com->External->BuiltIn 1895\end_layout 1896 1897\begin_layout Code 1898 1899DB_AS_REG (AS-Number to Registry database): BuiltIn 1900\end_layout 1901 1902\begin_layout Code 1903 1904DB_CC_REG (CountryCode to Registry database): BuiltIn 1905\end_layout 1906 1907\begin_layout Code 1908 1909DB_IPV4_REG (IPv4 to Registry database): BuiltIn 1910\end_layout 1911 1912\begin_layout Code 1913 1914DB_IPV6_REG (IPv6 to Registry database): BuiltIn 1915\end_layout 1916 1917\begin_layout Code 1918 1919DB_IPV4_AS (IPv4 to AS database): GeoIP(MaxMindDB)->db-ip.com(MaxMindDB) 1920\end_layout 1921 1922\begin_layout Code 1923 1924DB_IPV6_AS (IPv6 to AS database): GeoIP(MaxMindDB)->db-ip.com(MaxMindDB) 1925\end_layout 1926 1927\begin_layout Code 1928 1929DB_IPV4_CC (IPv4 to CountryCode database): GeoIP(MaxMindDB)->IP2Location->db-ip.c 1930om(MaxMindDB)->External 1931\end_layout 1932 1933\begin_layout Code 1934 1935DB_IPV6_CC (IPv6 to CountryCode database): GeoIP(MaxMindDB)->IP2Location->db-ip.c 1936om(MaxMindDB)->External 1937\end_layout 1938 1939\begin_layout Code 1940 1941DB_IPV4_COUNTRY (IPv4 to Country database): GeoIP(MaxMindDB)->IP2Location->db-ip. 1942com(MaxMindDB) 1943\end_layout 1944 1945\begin_layout Code 1946 1947DB_IPV6_COUNTRY (IPv6 to Country database): GeoIP(MaxMindDB)->IP2Location->db-ip. 1948com(MaxMindDB) 1949\end_layout 1950 1951\begin_layout Code 1952 1953DB_IPV4_CITY (IPv4 to City database): GeoIP(MaxMindDB)->IP2Location->db-ip.com(Ma 1954xMindDB) 1955\end_layout 1956 1957\begin_layout Code 1958 1959DB_IPV6_CITY (IPv6 to City database): GeoIP(MaxMindDB)->IP2Location->db-ip.com(Ma 1960xMindDB) 1961\end_layout 1962 1963\begin_layout Code 1964 1965DB_IPV4_REGION (IPv4 to Region database): GeoIP(MaxMindDB)->IP2Location->db-ip.co 1966m(MaxMindDB) 1967\end_layout 1968 1969\begin_layout Code 1970 1971DB_IPV6_REGION (IPv6 to Region database): GeoIP(MaxMindDB)->IP2Location->db-ip.co 1972m(MaxMindDB) 1973\end_layout 1974 1975\begin_layout Code 1976 1977DB_IEEE (IEEE/OUI/OUI28/OUI36 Vendor database): BuiltIn 1978\end_layout 1979 1980\begin_layout Code 1981 1982DB_IPV4_INFO (IPv4 additional information): External->BuiltIn 1983\end_layout 1984 1985\begin_layout Code 1986 1987DB_IPV6_INFO (IPv6 additional information): External->BuiltIn 1988\end_layout 1989 1990\begin_layout Code 1991 1992DB_IPV4_GEONAMEID (IPv4 GeonameID): GeoIP(MaxMindDB)->db-ip.com(MaxMindDB) 1993\end_layout 1994 1995\begin_layout Code 1996 1997DB_IPV6_GEONAMEID (IPv6 GeonameID): GeoIP(MaxMindDB)->db-ip.com(MaxMindDB) 1998\end_layout 1999 2000\begin_layout Standard 2001Option 2002\begin_inset Quotes eld 2003\end_inset 2004 2005-v -h 2006\begin_inset Quotes erd 2007\end_inset 2008 2009 (since 0.97.4) shows explanation of feature tokens 2010\end_layout 2011 2012\begin_layout Code 2013 2014$ ipv6calc -v -h 2015\end_layout 2016 2017\begin_layout Code 2018 2019ipv6calc: version 3.0.0 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6 2020 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC 2021 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION 2022 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID 2023 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T 2024YPE-GEONAMEID 2025\end_layout 2026 2027\begin_layout Code 2028 2029Explanation of available(x)/possible(o) feature tokens 2030\end_layout 2031 2032\begin_layout Code 2033 2034GeoIP x GeoIPv4 database (provided by GeoIP(MaxMindDB)) 2035\end_layout 2036 2037\begin_layout Code 2038 2039GeoIPv6 x GeoIPv6 database (provided by GeoIP(MaxMindDB)) 2040\end_layout 2041 2042\begin_layout Code 2043 2044IP2Location x IP2Location IPv4 database (provided by IP2Location) 2045\end_layout 2046 2047\begin_layout Code 2048 2049IP2Location6 x IP2Location IPv6 database (provided by IP2Location) 2050\end_layout 2051 2052\begin_layout Code 2053 2054DBIPv4 x db-ip.com IPv4 database (provided by db-ip.com(MaxMindD 2055B)) 2056\end_layout 2057 2058\begin_layout Code 2059 2060DBIPv6 x db-ip.com IPv6 database (provided by db-ip.com(MaxMindD 2061B)) 2062\end_layout 2063 2064\begin_layout Code 2065 2066DB_AS_REG x AS-Number to Registry database (provided by BuiltIn) 2067\end_layout 2068 2069\begin_layout Code 2070 2071DB_IPV4_REG x IPv4 to Registry database (provided by External,Built 2072In) 2073\end_layout 2074 2075\begin_layout Code 2076 2077DB_IPV6_REG x IPv6 to Registry database (provided by External,Built 2078In) 2079\end_layout 2080 2081\begin_layout Code 2082 2083DB_IPV4_AS x IPv4 to AS database (provided by GeoIP(MaxMindDB),db- 2084ip.com(MaxMindDB)) 2085\end_layout 2086 2087\begin_layout Code 2088 2089DB_IPV6_AS x IPv6 to AS database (provided by GeoIP(MaxMindDB),db- 2090ip.com(MaxMindDB)) 2091\end_layout 2092 2093\begin_layout Code 2094 2095DB_IPV4_CC x IPv4 to CountryCode database (provided by GeoIP(MaxMi 2096ndDB),IP2Location,db-ip.com(MaxMindDB),External) 2097\end_layout 2098 2099\begin_layout Code 2100 2101DB_IPV6_CC x IPv6 to CountryCode database (provided by GeoIP(MaxMi 2102ndDB),IP2Location,db-ip.com(MaxMindDB),External) 2103\end_layout 2104 2105\begin_layout Code 2106 2107DB_IPV4_COUNTRY x IPv4 to Country database (provided by GeoIP(MaxMindDB 2108),IP2Location,db-ip.com(MaxMindDB)) 2109\end_layout 2110 2111\begin_layout Code 2112 2113DB_IPV6_COUNTRY x IPv6 to Country database (provided by GeoIP(MaxMindDB 2114),IP2Location,db-ip.com(MaxMindDB)) 2115\end_layout 2116 2117\begin_layout Code 2118 2119DB_IPV4_CITY x IPv4 to City database (provided by GeoIP(MaxMindDB),I 2120P2Location,db-ip.com(MaxMindDB)) 2121\end_layout 2122 2123\begin_layout Code 2124 2125DB_IPV6_CITY x IPv6 to City database (provided by GeoIP(MaxMindDB),I 2126P2Location,db-ip.com(MaxMindDB)) 2127\end_layout 2128 2129\begin_layout Code 2130 2131DB_IPV4_REGION x IPv4 to Region database (provided by GeoIP(MaxMindDB) 2132,IP2Location,db-ip.com(MaxMindDB)) 2133\end_layout 2134 2135\begin_layout Code 2136 2137DB_IPV6_REGION x IPv6 to Region database (provided by GeoIP(MaxMindDB) 2138,IP2Location,db-ip.com(MaxMindDB)) 2139\end_layout 2140 2141\begin_layout Code 2142 2143DB_CC_REG x CountryCode to Registry database (provided by 2144 BuiltIn) 2145\end_layout 2146 2147\begin_layout Code 2148 2149DB_IEEE x IEEE/OUI/OUI28/OUI36 Vendor database (provided 2150 by BuiltIn) 2151\end_layout 2152 2153\begin_layout Code 2154 2155DB_IPV4_INFO x IPv4 additional information (provided by External,Bui 2156ltIn) 2157\end_layout 2158 2159\begin_layout Code 2160 2161DB_IPV6_INFO x IPv6 additional information (provided by External,Bui 2162ltIn) 2163\end_layout 2164 2165\begin_layout Code 2166 2167DB_IPV4_GEONAMEID x IPv4 GeonameID (provided by GeoIP(MaxMindDB),db-ip.com 2168(MaxMindDB)) 2169\end_layout 2170 2171\begin_layout Code 2172 2173DB_IPV6_GEONAMEID x IPv6 GeonameID (provided by GeoIP(MaxMindDB),db-ip.com 2174(MaxMindDB)) 2175\end_layout 2176 2177\begin_layout Code 2178 2179ANON_ZEROISE x Anonymization method 'zeroize' 2180\end_layout 2181 2182\begin_layout Code 2183 2184ANON_ANONYMIZE x Anonymization method 'anonymize' 2185\end_layout 2186 2187\begin_layout Code 2188 2189ANON_KEEP-TYPE-ASN-CC x Anonymization method 'keep-type-asn-cc' 2190\end_layout 2191 2192\begin_layout Code 2193 2194ANON_KEEP-TYPE-GEONAMEID x Anonymization method 'keep-type-geonameid' 2195\end_layout 2196 2197\begin_layout Standard 2198Note: since version 0.95.0 the internal layer for database usage was abstracted 2199 and each database 2200\begin_inset Quotes eld 2201\end_inset 2202 2203plugin 2204\begin_inset Quotes erd 2205\end_inset 2206 2207 is initialized reporting then its supporting features in binary representation. 2208 This makes implementation of other external databases easier in the future. 2209 There are at least plans to create an overlay to built-in databases by 2210 publishing and use some 2211\begin_inset Quotes eld 2212\end_inset 2213 2214precompiled 2215\begin_inset Quotes erd 2216\end_inset 2217 2218 newer databases replacing the need of recompilation for updated built-in 2219 databases. 2220\end_layout 2221 2222\begin_layout Subsection 2223Examples 2224\end_layout 2225 2226\begin_layout Subsubsection 2227Conversion 2228\end_layout 2229 2230\begin_layout Standard 2231A simple example is the conversion of an IPv6 address to a DNS PTR query 2232 string: 2233\end_layout 2234 2235\begin_layout Code 2236 2237$ ipv6calc --out revnibbles.arpa 2001:db8::1 2238\end_layout 2239 2240\begin_layout Code 2241 2242No input type specified, try autodetection...found type: ipv6addr 2243\end_layout 2244 2245\begin_layout Code 2246 22471.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. 2248\end_layout 2249 2250\begin_layout Standard 2251Like you see, input format was autodetected. 2252 And the given example can be extended because ipv6calc also understands 2253 netmask / prefix length values: 2254\end_layout 2255 2256\begin_layout Code 2257 2258$ ipv6calc -q --out revnibbles.arpa 2001:db8::1/64 2259\end_layout 2260 2261\begin_layout Code 2262 22630.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. 2264\end_layout 2265 2266\begin_layout Standard 2267Also you've also learnt now that switch '-q' (quiet) suppresses informational 2268 messages. 2269 You can use this now to start a DNS PTR query using: 2270\end_layout 2271 2272\begin_layout Code 2273 2274$ dig PTR `./ipv6calc -q --out revnibbles.arpa 2001:db8::1/64` 2275\end_layout 2276 2277\begin_layout Standard 2278But ipv6calc can do many more for you! Next example shows you the extraction 2279 of the IPv4 address contained in a 6to4 IPv6 address: 2280\end_layout 2281 2282\begin_layout Code 2283 2284$ ipv6calc -q --action conv6to4 --in ipv6 2002:c0a8:fb61::1 --out ipv4 2285\end_layout 2286 2287\begin_layout Code 2288 2289192.168.251.97 2290\end_layout 2291 2292\begin_layout Standard 2293This also works vice-versa: 2294\end_layout 2295 2296\begin_layout Code 2297 2298$ ipv6calc -q --action conv6to4 --in ipv4 192.168.251.97 --out ipv6 2299\end_layout 2300 2301\begin_layout Code 2302 23032002:c0a8:fb61:: 2304\end_layout 2305 2306\begin_layout Standard 2307There are many more features already implemented, if you miss one, send 2308 a note. 2309\end_layout 2310 2311\begin_layout Subsubsection 2312Information 2313\end_layout 2314 2315\begin_layout Standard 2316Depending on available databases output can vary. 2317\end_layout 2318 2319\begin_layout Paragraph 2320Information about a simple IPv6 address: 2321\end_layout 2322 2323\begin_layout Code 2324 2325$ ipv6calc -q -i 3ffe:ffff::210:a4ff:fe01:2345 2326\end_layout 2327 2328\begin_layout Code 2329 2330Address type: unicast, 6bone, global-unicast, productive 2331\end_layout 2332 2333\begin_layout Code 2334 2335Address type has SLA: 0000 2336\end_layout 2337 2338\begin_layout Code 2339 2340Registry for address: reserved 2341\end_layout 2342 2343\begin_layout Code 2344 2345Interface identifier: 0210:a4ff:fe01:2345 2346\end_layout 2347 2348\begin_layout Code 2349 2350EUI-48/MAC address: 00:10:a4:01:23:45 2351\end_layout 2352 2353\begin_layout Code 2354 2355MAC is a global unique one 2356\end_layout 2357 2358\begin_layout Code 2359 2360MAC is an unicast one 2361\end_layout 2362 2363\begin_layout Code 2364 2365OUI is: XIRCOM 2366\end_layout 2367 2368\begin_layout Paragraph 2369Information about a Teredo IPv6 address: 2370\end_layout 2371 2372\begin_layout Code 2373 2374$ ipv6calc -q -i 3ffe:831f:ce49:7601:8000:efff:af4a:86BF 2375\end_layout 2376 2377\begin_layout Code 2378 2379Address type: unicast, 6bone, global-unicast, teredo 2380\end_layout 2381 2382\begin_layout Code 2383 2384Country Code: IT 2385\end_layout 2386 2387\begin_layout Code 2388 2389Registry for address: 6BONE 2390\end_layout 2391 2392\begin_layout Code 2393 2394IPv4 address: 80.181.121.64 (TEREDO-CLIENT) 2395\end_layout 2396 2397\begin_layout Code 2398 2399IPv4 address type: unicast, global 2400\end_layout 2401 2402\begin_layout Code 2403 2404Autonomous System Information for [80.181.121.64]: AS3269 ASN-IBSNAZ 2405\end_layout 2406 2407\begin_layout Code 2408 2409Country Code for [80.181.121.64]: IT 2410\end_layout 2411 2412\begin_layout Code 2413 2414... 2415\end_layout 2416 2417\begin_layout Paragraph 2418Information about a LISP address 2419\end_layout 2420 2421\begin_layout Code 2422 2423$ ipv6calc -q -i 153.16.26.80 2424\end_layout 2425 2426\begin_layout Code 2427 2428IPv4 address: 153.16.26.80 2429\end_layout 2430 2431\begin_layout Code 2432 2433IPv4 address type: unicast, global, lisp 2434\end_layout 2435 2436\begin_layout Code 2437 2438... 2439\end_layout 2440 2441\begin_layout Code 2442 2443IPv4 registry: ARIN(LISP#cbc-xtr) 2444\end_layout 2445 2446\begin_layout Code 2447 2448... 2449\end_layout 2450 2451\begin_layout Paragraph 2452Machine readable output 2453\end_layout 2454 2455\begin_layout Standard 2456There exists also a machine readable output (e.g. 2457 used by 'ipv6calcweb.cgi') - in addition, database related information can 2458 be displayed, if databases are located on the system and supported. 2459\end_layout 2460 2461\begin_layout Code 2462 2463$ ipv6calc -q -i -m 2a01:238:423d:8800:85b3:9e6b:3019:8909 2464\end_layout 2465 2466\begin_layout Code 2467 2468IPV6=2a01:0238:423d:8800:85b3:9e6b:3019:8909 2469\end_layout 2470 2471\begin_layout Code 2472 2473IPV6_ANON=a909:16fa:9091:a448:a909:4941:0000:0007 2474\end_layout 2475 2476\begin_layout Code 2477 2478IPV6_TYPE=ipv6,unicast,global-unicast,productive,iid-random,iid,iid-local 2479\end_layout 2480 2481\begin_layout Code 2482 2483IPV6_COUNTRYCODE=DE 2484\end_layout 2485 2486\begin_layout Code 2487 2488IPV6_COUNTRYCODE_SOURCE=GeoIP(MaxMindDB) 2489\end_layout 2490 2491\begin_layout Code 2492 2493IPV6_AS_NUM=6724 2494\end_layout 2495 2496\begin_layout Code 2497 2498IPV6_AS_SOURCE=GeoIP(MaxMindDB) 2499\end_layout 2500 2501\begin_layout Code 2502 2503IPV6_GEONAME_ID=2921044 2504\end_layout 2505 2506\begin_layout Code 2507 2508IPV6_GEONAME_ID_SOURCE=GeoIP(MaxMindDB) 2509\end_layout 2510 2511\begin_layout Code 2512 2513IPV6_GEONAME_ID_TYPE=Country 2514\end_layout 2515 2516\begin_layout Code 2517 2518IPV6_REGISTRY=RIPENCC 2519\end_layout 2520 2521\begin_layout Code 2522 2523SLA=8800 2524\end_layout 2525 2526\begin_layout Code 2527 2528IID=85b3:9e6b:3019:8909 2529\end_layout 2530 2531\begin_layout Code 2532 2533EUI64_SCOPE=local-random 2534\end_layout 2535 2536\begin_layout Code 2537 2538IP2LOCATION_COUNTRY_SHORT=DE 2539\end_layout 2540 2541\begin_layout Code 2542 2543IP2LOCATION_COUNTRY_LONG=Germany 2544\end_layout 2545 2546\begin_layout Code 2547 2548IP2LOCATION_REGION=Berlin 2549\end_layout 2550 2551\begin_layout Code 2552 2553IP2LOCATION_CITY=Berlin 2554\end_layout 2555 2556\begin_layout Code 2557 2558IP2LOCATION_ZIPCODE=10178 2559\end_layout 2560 2561\begin_layout Code 2562 2563IP2LOCATION_LATITUDE=52.524368 2564\end_layout 2565 2566\begin_layout Code 2567 2568IP2LOCATION_LONGITUDE=13.410530 2569\end_layout 2570 2571\begin_layout Code 2572 2573IP2LOCATION_TIMEZONE=+01:00 2574\end_layout 2575 2576\begin_layout Code 2577 2578GEOIP2_CONTINENT_SHORT=EU 2579\end_layout 2580 2581\begin_layout Code 2582 2583GEOIP2_CONTINENT_LONG=Europe 2584\end_layout 2585 2586\begin_layout Code 2587 2588GEOIP2_COUNTRY_SHORT=DE 2589\end_layout 2590 2591\begin_layout Code 2592 2593GEOIP2_COUNTRY_LONG=Germany 2594\end_layout 2595 2596\begin_layout Code 2597 2598GEOIP2_LATITUDE=51.000000 2599\end_layout 2600 2601\begin_layout Code 2602 2603GEOIP2_LONGITUDE=9.000000 2604\end_layout 2605 2606\begin_layout Code 2607 2608GEOIP2_RADIUS=100 2609\end_layout 2610 2611\begin_layout Code 2612 2613GEOIP2_TIMEZONE_NAME=Europe/Berlin 2614\end_layout 2615 2616\begin_layout Code 2617 2618GEOIP2_AS_NUM=6724 2619\end_layout 2620 2621\begin_layout Code 2622 2623GEOIP2_AS_ORGNAME=Strato AG 2624\end_layout 2625 2626\begin_layout Code 2627 2628GEOIP2_GEONAME_ID_COUNTRY=2921044 2629\end_layout 2630 2631\begin_layout Code 2632 2633GEOIP2_GEONAME_ID_CONTINENT=6255148 2634\end_layout 2635 2636\begin_layout Code 2637 2638DBIP2_CONTINENT_SHORT=EU 2639\end_layout 2640 2641\begin_layout Code 2642 2643DBIP2_CONTINENT_LONG=Europe 2644\end_layout 2645 2646\begin_layout Code 2647 2648DBIP2_COUNTRY_SHORT=DE 2649\end_layout 2650 2651\begin_layout Code 2652 2653DBIP2_COUNTRY_LONG=Germany 2654\end_layout 2655 2656\begin_layout Code 2657 2658DBIP2_REGION=Berlin 2659\end_layout 2660 2661\begin_layout Code 2662 2663DBIP2_CITY=Berlin (Charlottenburg-Wilmersdorf) 2664\end_layout 2665 2666\begin_layout Code 2667 2668DBIP2_ZIPCODE=10587 2669\end_layout 2670 2671\begin_layout Code 2672 2673DBIP2_LATITUDE=52.523900 2674\end_layout 2675 2676\begin_layout Code 2677 2678DBIP2_LONGITUDE=13.321400 2679\end_layout 2680 2681\begin_layout Code 2682 2683DBIP2_WEATHERSTATIONCODE=GMXX8538 2684\end_layout 2685 2686\begin_layout Code 2687 2688DBIP2_TIMEZONE_NAME=Europe/Berlin 2689\end_layout 2690 2691\begin_layout Code 2692 2693DBIP2_AS_NUM=6724 2694\end_layout 2695 2696\begin_layout Code 2697 2698DBIP2_AS_ORGNAME=Strato AG 2699\end_layout 2700 2701\begin_layout Code 2702 2703DBIP2_ISP=Strato Rechenzentrum 2704\end_layout 2705 2706\begin_layout Code 2707 2708DBIP2_NETSPEED=Corporate 2709\end_layout 2710 2711\begin_layout Code 2712 2713DBIP2_GEONAME_ID=3336294 2714\end_layout 2715 2716\begin_layout Code 2717 2718DBIP2_GEONAME_ID_REGION=2950157 2719\end_layout 2720 2721\begin_layout Code 2722 2723DBIP2_GEONAME_ID_COUNTRY=2921044 2724\end_layout 2725 2726\begin_layout Code 2727 2728DBIP2_GEONAME_ID_CONTINENT=6255148 2729\end_layout 2730 2731\begin_layout Code 2732 2733EXTERNAL_COUNTRY_SHORT=DE 2734\end_layout 2735 2736\begin_layout Code 2737 2738IP2LOCATION_DATABASE_INFO=IP2L-DB11 IPv4 IPv6 20181226 Copyright (c) 2018 2739 IP2Location All Rights Reserved 2740\end_layout 2741 2742\begin_layout Code 2743 2744GEOIP2_DATABASE_INFO=GeoLite2-City Copyright (c) 2019 MaxMind All Rights 2745 Reserved, created: 20191217-200126 UTC / GeoLite2-ASN Copyright (c) 2019 2746 MaxMind All Rights Reserved, created: 20190122-114228 UTC 2747\end_layout 2748 2749\begin_layout Code 2750 2751DBIP2_DATABASE_INFO=DBIP-Location-ISP (compat=Enterprise) Copyright (c) 2752 2019 db-ip.com All Rights Reserved, created: 20190101-015418 UTC 2753\end_layout 2754 2755\begin_layout Code 2756 2757EXTERNAL_DATABASE_INFO=EXTDB-4/AFRINIC/20200904 APNIC/20200903 ARIN/20200903 2758 IANA/20191106 LACNIC/20200903 LISP/20200318 RIPENCC/20200903, created: 2759 20200904-063305 UTC 2760\end_layout 2761 2762\begin_layout Code 2763 2764BUILTIN_DATABASE_INFO=IPv6-REG:AFRINIC/20201012 APNIC/20201010 ARIN/20201011 2765 IANA/20191106 LACNIC/20201009 LISP/20200318 RIPENCC/20201011 2766\end_layout 2767 2768\begin_layout Code 2769 2770IPV6CALC_NAME=ipv6calc 2771\end_layout 2772 2773\begin_layout Code 2774 2775IPV6CALC_VERSION=3.0.0 2776\end_layout 2777 2778\begin_layout Code 2779 2780IPV6CALC_COPYRIGHT="(P) & (C) 2001-2020 by Peter Bieringer <pb (at) bieringer.de> 2781" 2782\end_layout 2783 2784\begin_layout Code 2785 2786IPV6CALC_OUTPUT_VERSION=21 2787\end_layout 2788 2789\begin_layout Code 2790 2791IPV6CALC_SETTINGS_ANON="set=keep-type-asn-cc,mask-ipv6=56,mask-ipv4=24,mask-eui6 27924=40,mask-mac=24,method=keep-type-asn-cc" 2793\end_layout 2794 2795\begin_layout Code 2796 2797IPV6CALC_FEATURES="GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6 2798 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC 2799 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION 2800 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID 2801 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T 2802YPE-GEONAMEID" 2803\end_layout 2804 2805\begin_layout Code 2806 2807IPV6CALC_CAPABILITIES="GeoIP2(linked/MaxMindDB) IP2Location(linked) DBIP2(linked 2808/MaxMindDB) ExternalDatabase DB_AS_REG(BuiltIn) DB_CC_REG(BuiltIn) DB_IPV4_REG(B 2809uiltIn) DB_IPV6_REG(BuiltIn) DB_IEEE(BuiltIn)" 2810\end_layout 2811 2812\begin_layout Paragraph* 2813Special machine readable output options (>= 0.99.0) 2814\end_layout 2815 2816\begin_layout Subparagraph 2817Output filter by selecting a token (>= 0.99.0) 2818\end_layout 2819 2820\begin_layout Standard 2821Using option --mrst <TOKEN> (Machine Readable Select Token) can be used 2822 to display only a selected token 2823\end_layout 2824 2825\begin_layout Code 2826 2827$ ipv6calc -q -i --mrst IPV6_TYPE 2a01:238:423d:8800:85b3:9e6b:3019:8909 2828 2829\end_layout 2830 2831\begin_layout Code 2832 2833IPV6_TYPE=unicast,global-unicast,productive,iid-random,iid,iid-local 2834\end_layout 2835 2836\begin_layout Subparagraph 2837Output filter by matching token (>= 0.99.0) 2838\end_layout 2839 2840\begin_layout Standard 2841Using option --mrmt <TOKEN> (Machine Readable Match Token) can be used to 2842 display only matching tokens 2843\end_layout 2844 2845\begin_layout Code 2846 2847$ ipv6calc -q -i --mrmt IP2LOCATION 2a01:238:423d:8800:85b3:9e6b:3019:8909 2848 2849\end_layout 2850 2851\begin_layout Code 2852 2853IP2LOCATION_COUNTRY_SHORT=DE 2854\end_layout 2855 2856\begin_layout Code 2857 2858IP2LOCATION_COUNTRY_LONG=Germany 2859\end_layout 2860 2861\begin_layout Code 2862 2863IP2LOCATION_REGION=Berlin 2864\end_layout 2865 2866\begin_layout Code 2867 2868IP2LOCATION_CITY=Berlin 2869\end_layout 2870 2871\begin_layout Code 2872 2873IP2LOCATION_ZIPCODE=10178 2874\end_layout 2875 2876\begin_layout Code 2877 2878IP2LOCATION_LATITUDE=52.524368 2879\end_layout 2880 2881\begin_layout Code 2882 2883IP2LOCATION_LONGITUDE=13.410530 2884\end_layout 2885 2886\begin_layout Code 2887 2888IP2LOCATION_TIMEZONE_NAME=+01:00 2889\end_layout 2890 2891\begin_layout Code 2892 2893IP2LOCATION_DATABASE_INFO=IP2L-DB11 IPv6 20181226 Copyright (c) 2018 IP2Location 2894 All Rights Reserved 2895\end_layout 2896 2897\begin_layout Subparagraph 2898Output filter by selecting a value of a token token (>= 0.99.0) 2899\end_layout 2900 2901\begin_layout Standard 2902Using option --mrtvo <TOKEN> (Machine Readable Token Value Only) can be 2903 used to display only thevalue of a selected token 2904\end_layout 2905 2906\begin_layout Code 2907 2908$ ipv6calc -q -i --mrtvo IPV6_TYPE 2a01:238:423d:8800:85b3:9e6b:3019:8909 2909 2910\end_layout 2911 2912\begin_layout Code 2913 2914unicast,global-unicast,productive,iid-random,iid,iid-local 2915\end_layout 2916 2917\begin_layout Subparagraph 2918Output adjustment by unconditional quoting of values (>= 0.99.0) 2919\end_layout 2920 2921\begin_layout Standard 2922Using option --mrqva (Machine Readable Quote Values Always) can be used 2923 to quote values always of a selected token 2924\end_layout 2925 2926\begin_layout Code 2927 2928$ ipv6calc -q -i --mrqva --mrtvo IPV6_TYPE 2a01:238:423d:8800:85b3:9e6b:3019:890 29299 2930\end_layout 2931 2932\begin_layout Code 2933 2934"unicast,global-unicast,productive,iid-random,iid,iid-local" 2935\end_layout 2936 2937\begin_layout Subparagraph 2938Output adjustment by unconditional disabling quoted values (>= 0.99.0) 2939\end_layout 2940 2941\begin_layout Standard 2942Using option --mrqvn (Machine Readable Quote Values Never) can be used to 2943 never quote values of a selected token 2944\end_layout 2945 2946\begin_layout Code 2947 2948$ ipv6calc -q -i --mrqvn --mrst IPV6_AS_TEXT 2a01:238:423d:8800:85b3:9e6b:3019:8 2949909 2950\end_layout 2951 2952\begin_layout Code 2953 2954IPV6_AS_TEXT=AS6724 STRATO AG 2955\end_layout 2956 2957\begin_layout Subparagraph 2958Output adjustment by unconditional print token in case of empty value (>= 2959 0.99.0) 2960\end_layout 2961 2962\begin_layout Standard 2963Using option --mrstpq (Machine Readable Select Token Print Always) can be 2964 used to print always token/value regardless it's contained 2965\end_layout 2966 2967\begin_layout Code 2968 2969$ ipv6calc -q -i --mrqva --mrstpa IPV4 2a01:238:423d:8800:85b3:9e6b:3019:8909 2970 2971\end_layout 2972 2973\begin_layout Code 2974 2975IPV4="" 2976\end_layout 2977 2978\begin_layout Code 2979 2980$ ipv6calc -q -i --mrqva --mrst IPV4 2a01:238:423d:8800:85b3:9e6b:3019:8909 2981 2982\end_layout 2983 2984\begin_layout Code 2985 2986(no output) 2987\end_layout 2988 2989\begin_layout Subsubsection 2990Filter mode 2991\end_layout 2992 2993\begin_layout Standard 2994\begin_inset Quotes eld 2995\end_inset 2996 2997ipv6calc 2998\begin_inset Quotes erd 2999\end_inset 3000 3001 can run in filter mode to be able to extract from a huge list of IPv4/IPv6 3002 addresses ones which are interesting or ones which are not interesting 3003 (see printout of online help below). 3004\end_layout 3005 3006\begin_layout Standard 3007Filter tokens are the ones which are listed on 3008\begin_inset Quotes eld 3009\end_inset 3010 3011TYPE 3012\begin_inset Quotes erd 3013\end_inset 3014 3015 lines shown in 3016\begin_inset Quotes eld 3017\end_inset 3018 3019-m -i 3020\begin_inset Quotes erd 3021\end_inset 3022 3023 information mode. 3024\end_layout 3025 3026\begin_layout Standard 3027Example for searching for Teredo addresses: 3028\end_layout 3029 3030\begin_layout Code 3031 3032$ cat ip.bieringer.de-log.201310 | awk '{ print $1 }' | sort | uniq | ipv6calc 3033 -A filter -E teredo 3034\end_layout 3035 3036\begin_layout Code 3037 30382001:0:9d38:90d7:34f7:1a26:8599:e079 3039\end_layout 3040 3041\begin_layout Standard 3042For more information see below 3043\end_layout 3044 3045\begin_layout Standard 3046Note: since version 0.95.0 '-A filter' is optional if option '-E <filter expressio 3047n>' is given (autoselected action). 3048\end_layout 3049 3050\begin_layout Subsubsection 3051Test mode 3052\end_layout 3053 3054\begin_layout Standard 3055Since 0.99.2 a test mode ('-A test', autoselected in case 'test_*' options 3056 are given) is implemented for address prefix or range 3057\end_layout 3058 3059\begin_layout Standard 3060For more information see below 3061\end_layout 3062 3063\begin_layout Subsection 3064Option style 3065\end_layout 3066 3067\begin_layout Standard 3068Since version 0.40 new-style option handling was introduced, using 3069\end_layout 3070 3071\begin_layout Itemize 3072--in <inputtype> 3073\end_layout 3074 3075\begin_layout Itemize 3076--out <outputtype> 3077\end_layout 3078 3079\begin_layout Itemize 3080--action <actiontype> 3081\end_layout 3082 3083\begin_layout Standard 3084and many more conversions were added. 3085 A built-in check matrix should prevent misconversions. 3086\end_layout 3087 3088\begin_layout Standard 3089Up to version 0.39, only old-style options (aka 3090\begin_inset Quotes eld 3091\end_inset 3092 3093shortcut 3094\begin_inset Quotes erd 3095\end_inset 3096 3097 options). 3098 They are one-in-all options, specifying input/action/output in one token. 3099 Internally this options will be converted into new-style options. 3100\end_layout 3101 3102\begin_layout Subsection 3103Online help 3104\end_layout 3105 3106\begin_layout Standard 3107Online help always shows the currently implemented features. 3108\end_layout 3109 3110\begin_layout Subsubsection 3111Main online help: 3112\end_layout 3113 3114\begin_layout Standard 3115External database options only appear if compiled with related support. 3116\end_layout 3117 3118\begin_layout Code 3119 3120$ ipv6calc -h 3121\end_layout 3122 3123\begin_layout Code 3124 3125ipv6calc: version 3.0.0 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6 3126 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC 3127 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION 3128 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID 3129 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T 3130YPE-GEONAMEID 3131\end_layout 3132 3133\begin_layout Code 3134 3135(P) & (C) 2001-2020 by Peter Bieringer <pb (at) bieringer.de> 3136\end_layout 3137 3138\begin_layout Code 3139 3140This program formats and calculates IPv6/IPv4/MAC addresses and can do many 3141 more tricky things 3142\end_layout 3143 3144\begin_layout Code 3145 3146 [-d|--debug <debug value>] : debug value (bitwise like) 3147\end_layout 3148 3149\begin_layout Code 3150 3151 can also be set by IPV6CALC_DEBUG environment 3152 value 3153\end_layout 3154 3155\begin_layout Code 3156 3157 [-v|--version [-v [-v]]] : version information (2 optional detail levels) 3158\end_layout 3159 3160\begin_layout Code 3161 3162 [-v|--version -h] : explanation of feature tokens 3163\end_layout 3164 3165\begin_layout Code 3166 3167 [-V|--verbose] : be more verbose 3168\end_layout 3169 3170\begin_layout Code 3171 3172 [-h|--help|-?] : this online help 3173\end_layout 3174 3175\begin_layout Code 3176 3177\end_layout 3178 3179\begin_layout Code 3180 3181 [--disable-ip2location ] : IP2Location support disabled 3182\end_layout 3183 3184\begin_layout Code 3185 3186 [--db-ip2location-disable ] : IP2Location support disabled 3187\end_layout 3188 3189\begin_layout Code 3190 3191 [--db-ip2location-dir <directory>] : IP2Location database directory (default: 3192 /usr/share/IP2Location) 3193\end_layout 3194 3195\begin_layout Code 3196 3197 [--db-ip2location-only-type <TYPE>]: IP2Location database only selected 3198 type (1-120) 3199\end_layout 3200 3201\begin_layout Code 3202 3203 [--db-ip2location-allow-softlinks] : IP2Location database softlinks allowed 3204\end_layout 3205 3206\begin_layout Code 3207 3208 by default they are ignored because it is hard to autodetect COMM/LITE/SAMP 3209LE 3210\end_layout 3211 3212\begin_layout Code 3213 3214 [--db-ip2location-lite-to-sample-autoswitch-max-delta-months <MONTHS>]: 3215\end_layout 3216 3217\begin_layout Code 3218 3219 autoswitch from LITE to SAMPLE databases if possible and delta is not 3220 more than 12 months (0=disabled) 3221\end_layout 3222 3223\begin_layout Code 3224 3225 [--db-ip2location-comm-to-lite-switch-min-delta-months <MONTHS>]: 3226\end_layout 3227 3228\begin_layout Code 3229 3230 switch from COMM to LITE databases if possible and delta more than 3231 12 months (0=disabled) 3232\end_layout 3233 3234\begin_layout Code 3235 3236\end_layout 3237 3238\begin_layout Code 3239 3240 [--disable-geoip2 ] : GeoIP(MaxMindDB) support disabled 3241\end_layout 3242 3243\begin_layout Code 3244 3245 [--db-geoip2-disable ] : GeoIP(MaxMindDB) support disabled 3246\end_layout 3247 3248\begin_layout Code 3249 3250 [--db-geoip2-dir <directory>] : GeoIP(MaxMindDB) database directory 3251 (default: /usr/share/GeoIP) 3252\end_layout 3253 3254\begin_layout Code 3255 3256\end_layout 3257 3258\begin_layout Code 3259 3260 [--disable-dbip2 ] : db-ip.com(MaxMindDB) support disabled 3261\end_layout 3262 3263\begin_layout Code 3264 3265 [--db-dbip2-disable ] : db-ip.com(MaxMindDB) support disabled 3266\end_layout 3267 3268\begin_layout Code 3269 3270 [--db-dbip2-dir <directory>] : db-ip.com(MaxMindDB) database directory 3271 (default: /usr/share/DBIP) 3272\end_layout 3273 3274\begin_layout Code 3275 3276 [--db-dbip2-only-type <TYPE>] : db-ip.com(MaxMindDB) database only 3277 selected type (1-6) 3278\end_layout 3279 3280\begin_layout Code 3281 3282 [--db-dbip2-comm-to-free-switch-min-delta-months <MONTHS>]: 3283\end_layout 3284 3285\begin_layout Code 3286 3287 switch from COMM to FREE databases if possible and delta more than 3288 12 months (0=disabled) 3289\end_layout 3290 3291\begin_layout Code 3292 3293 [--disable-external ] : External support disabled 3294\end_layout 3295 3296\begin_layout Code 3297 3298 3299\end_layout 3300 3301\begin_layout Code 3302 3303 [--db-external-disable ] : External support disabled 3304\end_layout 3305 3306\begin_layout Code 3307 3308 [--db-external-dir <directory>] : External database directory (default: 3309 /usr/share/ipv6calc/db) 3310\end_layout 3311 3312\begin_layout Code 3313 3314 [--disable-builtin ] : BuiltIn support disabled 3315\end_layout 3316 3317\begin_layout Code 3318 3319 [--db-builtin-disable ] : BuiltIn support disabled 3320\end_layout 3321 3322\begin_layout Code 3323 3324 3325\end_layout 3326 3327\begin_layout Code 3328 3329 [--db-priorization <entry1>[:...]] : Database priorization order list (overwrites 3330 default) 3331\end_layout 3332 3333\begin_layout Code 3334 3335 colon separated: GeoIP GeoIP2 IP2Locati 3336on DBIP DBIP2 External BuiltIn 3337\end_layout 3338 3339\begin_layout Code 3340 3341\end_layout 3342 3343\begin_layout Code 3344 3345Hint: all long options can be predefined from environment by using 3346\end_layout 3347 3348\begin_layout Code 3349 3350 prefix: IPV6CALC_ and conversion: '-' -> '_' and lowercase -> uppercase 3351\end_layout 3352 3353\begin_layout Code 3354 3355 example for options with values : --db-dbip2-dir=<DIR> -> environment: 3356 IPV6CALC_DB_DBIP2_DIR=<DIR> 3357\end_layout 3358 3359\begin_layout Code 3360 3361 example for options without values: --db-dbip2-disable -> environment: 3362 IPV6CALC_DB_DBIP2_DISABLE=1 3363\end_layout 3364 3365\begin_layout Code 3366 3367 3368 on|off|0|1 is supported 3369\end_layout 3370 3371\begin_layout Code 3372 3373 [-q|--quiet] : be more quiet (auto-enabled in pipe mode) 3374\end_layout 3375 3376\begin_layout Code 3377 3378 [-f|--flush] : flush each line in pipe mode 3379\end_layout 3380 3381\begin_layout Code 3382 3383 Usage with new style options: 3384\end_layout 3385 3386\begin_layout Code 3387 3388 [--in|-I <input type>] : specify input type 3389\end_layout 3390 3391\begin_layout Code 3392 3393 (default: autodetect) 3394\end_layout 3395 3396\begin_layout Code 3397 3398 [--out|-O <output type>] : specify output type 3399\end_layout 3400 3401\begin_layout Code 3402 3403 (sometimes: autodetect) 3404\end_layout 3405 3406\begin_layout Code 3407 3408 [--action|-A <action>] : specify action 3409\end_layout 3410 3411\begin_layout Code 3412 3413 (default: format conversion, sometimes: autodetect) 3414\end_layout 3415 3416\begin_layout Code 3417 3418 [<format option> ...] : specify format options 3419\end_layout 3420 3421\begin_layout Code 3422 3423 <input data> [...] : input data 3424\end_layout 3425 3426\begin_layout Code 3427 3428 Available input types: [-m] -I|--in -?|-h|--help 3429\end_layout 3430 3431\begin_layout Code 3432 3433 Available output types: [-m] -O|--out -?|-h|--help 3434\end_layout 3435 3436\begin_layout Code 3437 3438 Available action types: [-m] -A|--action -?|-h|--help 3439\end_layout 3440 3441\begin_layout Code 3442 3443 Special filter action : -E -?|-h|--help 3444\end_layout 3445 3446\begin_layout Code 3447 3448\end_layout 3449 3450\begin_layout Code 3451 3452 Other usage: 3453\end_layout 3454 3455\begin_layout Code 3456 3457 --showinfo|-i [--machine_readable|-m] : show information about input data 3458\end_layout 3459 3460\begin_layout Code 3461 3462 --showinfo|-i --mrqva : Machine Readable Quote Values 3463 Always 3464\end_layout 3465 3466\begin_layout Code 3467 3468 --showinfo|-i --mrqvn : Machine Readable Quote Values 3469 Never 3470\end_layout 3471 3472\begin_layout Code 3473 3474 --showinfo|-i --mrst <TOKEN> : Machine Readable Select Token 3475\end_layout 3476 3477\begin_layout Code 3478 3479 --showinfo|-i --mrstpa <TOKEN> : Machine Readable Select Token 3480 Print Always 3481\end_layout 3482 3483\begin_layout Code 3484 3485 --showinfo|-i --mrmt <TOKENPREFIX> : Machine Readable Match Token Prefix 3486\end_layout 3487 3488\begin_layout Code 3489 3490 --showinfo|-i --mrmts <TOKENSUFFIX> : Machine Readable Match Token Suffix 3491\end_layout 3492 3493\begin_layout Code 3494 3495 --showinfo|-i --mrtvo <TOKEN> : Machine Readable Token Value Only 3496\end_layout 3497 3498\begin_layout Code 3499 3500 --showinfo|-i --show-tokens : show available tokens (aka types) 3501 on '-m' 3502\end_layout 3503 3504\begin_layout Code 3505 3506\end_layout 3507 3508\begin_layout Code 3509 3510 Usage with shortcut options: <shortcut option> [<format option> ...] <input 3511 data> 3512\end_layout 3513 3514\begin_layout Code 3515 3516 for more information and available format options use: <shortcut option> 3517 -?|-h|--help 3518\end_layout 3519 3520\begin_layout Code 3521 3522 -r|--addr2ip6_int (-O revnibbles.int) 3523\end_layout 3524 3525\begin_layout Code 3526 3527 -r|--addr_to_ip6int (-O revnibbles.int) 3528\end_layout 3529 3530\begin_layout Code 3531 3532 -a|--addr2ip6_arpa (-O revnibbles.arpa) 3533\end_layout 3534 3535\begin_layout Code 3536 3537 -a|--addr_to_ip6arpa (-O revnibbles.arpa) 3538\end_layout 3539 3540\begin_layout Code 3541 3542 -b|--addr_to_bitstring (-O bitstring) 3543\end_layout 3544 3545\begin_layout Code 3546 3547 --addr2compaddr (--printcompressed) 3548\end_layout 3549 3550\begin_layout Code 3551 3552 --addr_to_compressed (--printcompressed) 3553\end_layout 3554 3555\begin_layout Code 3556 3557 --addr2uncompaddr (--printuncompressed) 3558\end_layout 3559 3560\begin_layout Code 3561 3562 --addr_to_uncompressed (--printuncompressed) 3563\end_layout 3564 3565\begin_layout Code 3566 3567 --addr_to_base85 (-I ipv6addr -O base85) 3568\end_layout 3569 3570\begin_layout Code 3571 3572 --base85_to_addr (-I base85 -O ipv6addr) 3573\end_layout 3574 3575\begin_layout Code 3576 3577 --mac_to_eui64 (-I mac -O eui64) 3578\end_layout 3579 3580\begin_layout Code 3581 3582 --addr2fulluncompaddr (--printfulluncompressed) 3583\end_layout 3584 3585\begin_layout Code 3586 3587 --addr_to_fulluncompressed (--printfulluncompressed) 3588\end_layout 3589 3590\begin_layout Code 3591 3592 --addr2if_inet6 (-I ipv6addr -O ifinet6) 3593\end_layout 3594 3595\begin_layout Code 3596 3597 --addr_to_ifinet6 (-I ipv6addr -O ifinet6) 3598\end_layout 3599 3600\begin_layout Code 3601 3602 --if_inet62addr (-I ifinet6 -O ipv6addr --printcompressed) 3603\end_layout 3604 3605\begin_layout Code 3606 3607 --ifinet6_to_compressed (-I ifinet6 -O ipv6addr --printcompressed) 3608\end_layout 3609 3610\begin_layout Code 3611 3612 --eui64_to_privacy (-I iid_token -O iid_token -A genprivacyiid) 3613\end_layout 3614 3615\begin_layout Code 3616 3617 --ipv4_to_6to4addr (-I ipv4 -O ipv6addr -A conv6to4) 3618\end_layout 3619 3620\begin_layout Code 3621 3622 --addr2cc (-A addr2cc) 3623\end_layout 3624 3625\begin_layout Subsubsection 3626Database options 3627\end_layout 3628 3629\begin_layout Itemize 3630each internal/external database can be disabled by option 3631\end_layout 3632 3633\begin_layout Itemize 3634directory of database files can be given via related option 3635\end_layout 3636 3637\begin_layout Itemize 3638databases requiring external library the library file can be given in case 3639 of dynamic load and linking 3640\end_layout 3641 3642\begin_layout Itemize 3643for geolocation databases specific file can be selected (see --db-<PROVIDER>-onl 3644y-type <TYPE>) 3645\end_layout 3646 3647\begin_layout Paragraph 3648IP2Location 3649\end_layout 3650 3651\begin_layout Standard 3652IP2location database directory can contain a bunch of files, the best ones 3653 are selected automatically (since 0.99.0). 3654 3655\begin_inset Quotes eld 3656\end_inset 3657 3658Best 3659\begin_inset Quotes erd 3660\end_inset 3661 3662 can be controlled via two options: 3663\end_layout 3664 3665\begin_layout Itemize 3666--db-ip2location-lite-to-sample-autoswitch-max-delta-months <MONTHS>: switches 3667 from LITE to SAMPLE databases in case of 3668\begin_inset Separator latexpar 3669\end_inset 3670 3671 3672\end_layout 3673 3674\begin_deeper 3675\begin_layout Itemize 3676existing SAMPLE database 3677\end_layout 3678 3679\begin_layout Itemize 3680SAMPLE database not older than default/given MONTHS than the LITE database 3681\end_layout 3682 3683\begin_layout Itemize 3684IP address is in range of SAMPLE database (IPv4: 0.0.0.0-99.255.255.255, IPv6: 3685 2a04::/16) 3686\end_layout 3687 3688\begin_layout Itemize 3689autoswitch can be disabled by using MONTHS=0 3690\end_layout 3691 3692\begin_layout Itemize 3693reason for implementation: show maximum possible IP2Location features 3694\end_layout 3695 3696\end_deeper 3697\begin_layout Itemize 3698--db-ip2location-comm-to-lite-switch-min-delta-months <MONTHS>: switches 3699 from COMMercial to LITE databases in case of 3700\begin_inset Separator latexpar 3701\end_inset 3702 3703 3704\end_layout 3705 3706\begin_deeper 3707\begin_layout Itemize 3708existing LITE database 3709\end_layout 3710 3711\begin_layout Itemize 3712COMMercial database is default/given MONTHS older than the LITE database 3713\end_layout 3714 3715\begin_layout Itemize 3716switch can be disabled by using MONTHS=0 3717\end_layout 3718 3719\begin_layout Itemize 3720reason for implementation: avoid using old COMMercial databases 3721\end_layout 3722 3723\end_deeper 3724\begin_layout Itemize 3725--db-ip2location-only-type <TYPE>: only selects databases of given type 3726\begin_inset Separator latexpar 3727\end_inset 3728 3729 3730\end_layout 3731 3732\begin_deeper 3733\begin_layout Itemize 3734reason for implementation: be able to select a specific database type 3735\end_layout 3736 3737\end_deeper 3738\begin_layout Itemize 3739--db-ip2location-allow-softlinks: allow softlinked IP2Location database 3740 files 3741\begin_inset Separator latexpar 3742\end_inset 3743 3744 3745\end_layout 3746 3747\begin_deeper 3748\begin_layout Itemize 3749by default, softlinked database files are skipped, because it's hard to 3750 detect whether one is COMMercial, LITE or SAMPLE 3751\end_layout 3752 3753\end_deeper 3754\begin_layout Code 3755 3756\end_layout 3757 3758\begin_layout Standard 3759use 3760\begin_inset Quotes eld 3761\end_inset 3762 3763ipv6calc -vv 3764\begin_inset Quotes erd 3765\end_inset 3766 3767 or 3768\begin_inset Quotes eld 3769\end_inset 3770 3771ipv6calc -vvv 3772\begin_inset Quotes erd 3773\end_inset 3774 3775 for verification, which databases are selected finally. 3776\end_layout 3777 3778\begin_layout Subsubsection 3779Input-type options 3780\end_layout 3781 3782\begin_layout Code 3783 3784$ ipv6calc --in -? 3785\end_layout 3786 3787\begin_layout Code 3788 3789ipv6calc: version 2.1.1 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6 3790 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC 3791 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION 3792 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID 3793 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T 3794YPE-GEONAMEID 3795\end_layout 3796 3797\begin_layout Code 3798 3799(P) & (C) 2001-2019 by Peter Bieringer <pb (at) bieringer.de> 3800\end_layout 3801 3802\begin_layout Code 3803 3804 Available input types: 3805\end_layout 3806 3807\begin_layout Code 3808 3809 auto : automatic detection 3810\end_layout 3811 3812\begin_layout Code 3813 3814 revnibbles.int : dot separated nibbles reverse, ending with ip6.int. 3815\end_layout 3816 3817\begin_layout Code 3818 3819 revnibbles.arpa : dot separated nibbles reverse, ending with ip6.arpa. 3820\end_layout 3821 3822\begin_layout Code 3823 3824 bitstring : bitstring labes, ending with ip6.arpa. 3825\end_layout 3826 3827\begin_layout Code 3828 3829 ipv6addr : IPv6 address 3830\end_layout 3831 3832\begin_layout Code 3833 3834 ipv6literal : IPv6 address in literal 3835\end_layout 3836 3837\begin_layout Code 3838 3839 ipv4addr : IPv4 address 3840\end_layout 3841 3842\begin_layout Code 3843 3844 ipv4hex : IPv4 in hexdecimal format 3845\end_layout 3846 3847\begin_layout Code 3848 3849 ipv4revhex : IPv4 in byte-reversed hexdecimal format 3850\end_layout 3851 3852\begin_layout Code 3853 3854 mac : MAC address (48 bits) 3855\end_layout 3856 3857\begin_layout Code 3858 3859 eui64 : EUI-64 identifier (64 bits) 3860\end_layout 3861 3862\begin_layout Code 3863 3864 base85 : Base-85 string 3865\end_layout 3866 3867\begin_layout Code 3868 3869 ifinet6 : Like line in /proc/net/if_inet6 3870\end_layout 3871 3872\begin_layout Code 3873 3874 iid+token : Interface identifier and token 3875\end_layout 3876 3877\begin_layout Code 3878 3879 ipv6logconv : ipv6logconv (currently not supported) 3880\end_layout 3881 3882\begin_layout Code 3883 3884 prefix+mac : IPv6 prefix and a MAC address 3885\end_layout 3886 3887\begin_layout Code 3888 3889 asn : Autonomous System Number 3890\end_layout 3891 3892\begin_layout Subsubsection 3893Output-type options: 3894\end_layout 3895 3896\begin_layout Code 3897 3898$ ipv6calc --out -? 3899\end_layout 3900 3901\begin_layout Code 3902 3903ipv6calc: version 2.1.1 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6 3904 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC 3905 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION 3906 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID 3907 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T 3908YPE-GEONAMEID 3909\end_layout 3910 3911\begin_layout Code 3912 3913(P) & (C) 2001-2019 by Peter Bieringer <pb (at) bieringer.de> 3914\end_layout 3915 3916\begin_layout Code 3917 3918 Available output types: 3919\end_layout 3920 3921\begin_layout Code 3922 3923 revnibbles.int : dot separated nibbles reverse, ending with ip6.int. 3924\end_layout 3925 3926\begin_layout Code 3927 3928 revnibbles.arpa : dot separated nibbles reverse, ending with ip6.arpa. 3929\end_layout 3930 3931\begin_layout Code 3932 3933 bitstring : bitstring labes, ending with ip6.arpa. 3934\end_layout 3935 3936\begin_layout Code 3937 3938 ipv6addr : IPv6 address 3939\end_layout 3940 3941\begin_layout Code 3942 3943 ipv4addr : IPv4 address 3944\end_layout 3945 3946\begin_layout Code 3947 3948 mac : MAC address (48 bits) 3949\end_layout 3950 3951\begin_layout Code 3952 3953 eui64 : EUI-64 identifier (64 bits) 3954\end_layout 3955 3956\begin_layout Code 3957 3958 base85 : Base-85 string 3959\end_layout 3960 3961\begin_layout Code 3962 3963 ifinet6 : Like line in /proc/net/if_inet6 3964\end_layout 3965 3966\begin_layout Code 3967 3968 iid : Interface identifier 3969\end_layout 3970 3971\begin_layout Code 3972 3973 iid+token : Interface identifier and token 3974\end_layout 3975 3976\begin_layout Code 3977 3978 addrtype : Address type 3979\end_layout 3980 3981\begin_layout Code 3982 3983 ouitype : OUI (IEEE) type 3984\end_layout 3985 3986\begin_layout Code 3987 3988 ipv6addrtype : IPv6 address type 3989\end_layout 3990 3991\begin_layout Code 3992 3993 any : any type (currently not supported) 3994\end_layout 3995 3996\begin_layout Code 3997 3998 revipv4 : reverse IPv4, ending with in-addr.arpa 3999\end_layout 4000 4001\begin_layout Code 4002 4003 ipv4hex : IPv4 in hexdecimal format 4004\end_layout 4005 4006\begin_layout Code 4007 4008 octal : IP address in escaped octal format 4009\end_layout 4010 4011\begin_layout Code 4012 4013 hex : IP address in hexadecimal format 4014\end_layout 4015 4016\begin_layout Code 4017 4018 ipv6literal : IPv6 address in literal 4019\end_layout 4020 4021\begin_layout Code 4022 4023 For examples and available format options use: 4024\end_layout 4025 4026\begin_layout Code 4027 4028 -O|--out <type> --examples 4029\end_layout 4030 4031\begin_layout Subsubsection 4032Action-type options: 4033\end_layout 4034 4035\begin_layout Code 4036 4037$ ipv6calc --action -? 4038\end_layout 4039 4040\begin_layout Code 4041 4042ipv6calc: version 2.1.1 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6 4043 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC 4044 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION 4045 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID 4046 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T 4047YPE-GEONAMEID 4048\end_layout 4049 4050\begin_layout Code 4051 4052(P) & (C) 2001-2019 by Peter Bieringer <pb (at) bieringer.de> 4053\end_layout 4054 4055\begin_layout Code 4056 4057 Available action types: 4058\end_layout 4059 4060\begin_layout Code 4061 4062 auto : Automatic selection of action (default) 4063\end_layout 4064 4065\begin_layout Code 4066 4067 geneui64 : Converts a MAC address to an EUI-64 address 4068\end_layout 4069 4070\begin_layout Code 4071 4072 conv6to4 : Converts IPv4 address <-> 6to4 IPv6 address (prefix) 4073\end_layout 4074 4075\begin_layout Code 4076 4077 convnat64 : Converts IPv4 address <-> NAT64 IPv6 address 4078\end_layout 4079 4080\begin_layout Code 4081 4082 ipv6tomac : Extracts MAC of an IPv6 address (if detected) 4083\end_layout 4084 4085\begin_layout Code 4086 4087 ipv6toeui64 : Extracts EUI64 of an IPv6 address (if detected) 4088\end_layout 4089 4090\begin_layout Code 4091 4092 genprivacyiid : Generates a privacy interface ID out of a given one 4093 (arg1) and a token (arg2) 4094\end_layout 4095 4096\begin_layout Code 4097 4098 prefixmac2ipv6 : Generates an IPv6 address out of a prefix and a MAC 4099 address 4100\end_layout 4101 4102\begin_layout Code 4103 4104 anonymize : Anonymize IPv4/IPv6 address without loosing much informatio 4105n 4106\end_layout 4107 4108\begin_layout Code 4109 4110 6rd_local_prefix : Calculate the 6rd prefix from given IPv6 prefix (& 4111 relay prefix) and IPv4 4112\end_layout 4113 4114\begin_layout Code 4115 4116 Options: 4117\end_layout 4118 4119\begin_layout Code 4120 4121 --6rd_prefix ... 4122 (required) 4123\end_layout 4124 4125\begin_layout Code 4126 4127 --6rd_relay_prefix ... 4128 (optional) 4129\end_layout 4130 4131\begin_layout Code 4132 4133 6rd_extract_ipv4 : Extract from 6rd address the include IPv4 address 4134\end_layout 4135 4136\begin_layout Code 4137 4138 Options: 4139\end_layout 4140 4141\begin_layout Code 4142 4143 --6rd_prefixlength ... 4144 (required) 4145\end_layout 4146 4147\begin_layout Code 4148 4149 filter : Filter addresses related to filter options 4150\end_layout 4151 4152\begin_layout Code 4153 4154 test : Test address against given prefix or address 4155\end_layout 4156 4157\begin_layout Code 4158 4159 Options: 4160\end_layout 4161 4162\begin_layout Code 4163 4164 --test_prefix ... 4165 (optional) 4166\end_layout 4167 4168\begin_layout Code 4169 4170 --test_gt ... 4171 (optional) 4172\end_layout 4173 4174\begin_layout Code 4175 4176 --test_ge ... 4177 (optional) 4178\end_layout 4179 4180\begin_layout Code 4181 4182 --test_lt ... 4183 (optional) 4184\end_layout 4185 4186\begin_layout Code 4187 4188 --test_le ... 4189 (optional) 4190\end_layout 4191 4192\begin_layout Code 4193 4194 addr2cc : Converts IPv4/IPv6 address into Country Code 4195\end_layout 4196 4197\begin_layout Subsubsection 4198Special action 4199\begin_inset Quotes eld 4200\end_inset 4201 4202filter 4203\begin_inset Quotes erd 4204\end_inset 4205 4206: 4207\end_layout 4208 4209\begin_layout Standard 4210Special action 4211\begin_inset Quotes eld 4212\end_inset 4213 4214filter 4215\begin_inset Quotes erd 4216\end_inset 4217 4218 can be used especially in pipe mode to filter IP addresses related to their 4219 type and since 0.99.0 also related to database results (CountryCode, ASN 4220 or Registry). 4221\end_layout 4222 4223\begin_layout Code 4224 4225$ ipv6calc --action filter -h 4226\end_layout 4227 4228\begin_layout Code 4229 4230ipv6calc: version 2.1.1 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6 4231 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC 4232 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION 4233 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID 4234 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T 4235YPE-GEONAMEID 4236\end_layout 4237 4238\begin_layout Code 4239 4240 Filter given addresses from stdin by filter expression, e.g. 4241\end_layout 4242 4243\begin_layout Code 4244 4245 echo '2001:db8::1' | ipv6calc [-A filter] -E iid-local 4246\end_layout 4247 4248\begin_layout Code 4249 4250 echo '2001:db8::1' | ipv6calc [-A filter] -E iid-local,global-unicast 4251\end_layout 4252 4253\begin_layout Code 4254 4255 echo '2001:db8::1' | ipv6calc [-A filter] -E ^iid-random 4256\end_layout 4257 4258\begin_layout Code 4259 4260 (note: since version 0.95.0 '-A filter' is autoselected if option '-E <filter 4261 expression>' is given) 4262\end_layout 4263 4264\begin_layout Code 4265 4266 negation of filter expression with prefix: ^ 4267\end_layout 4268 4269\begin_layout Code 4270 4271 IPv6 address filter tokens: 4272\end_layout 4273 4274\begin_layout Code 4275 4276 ipv6 unknown unicast multicast anycast loopback link-local site-local 4277 compat-v4 mapped reserved unique-local-unicast anonymized-iid anonymized-prefix 4278 6to4 6bone global-unicast unspecified solicited-node productive 6to4-microsoft 4279 teredo orchid link-local-teredo nat64 iid-random iid iid-local iid-global 4280 iid-teredo iid-eui48 iid-eui64 iid-isatap iid-includes-ipv4 4281\end_layout 4282 4283\begin_layout Code 4284 4285 IPv4 address filter tokens: 4286\end_layout 4287 4288\begin_layout Code 4289 4290 ipv4 any unicast multicast anycast broadcast loopback unspecified unknown 4291 reserved zeroconf site-local anonymized anonymized-geonameid global 6to4relay 4292 lisp lisp-proxyegresstunnelrouter-anycast lisp-mapresolver-anycast 4293\end_layout 4294 4295\begin_layout Code 4296 4297 IPv4/v6 address filter tokens based on databases: 4298\end_layout 4299 4300\begin_layout Code 4301 4302 [^][ipv4.|ipv6.]db.cc=<CC>|unknown (Country Code [2 chars]) 4303\end_layout 4304 4305\begin_layout Code 4306 4307 [^][ipv4.|ipv6.]db.asn=<ASN>|unknown (Autonomous System Number) 4308\end_layout 4309 4310\begin_layout Code 4311 4312 [^][ipv4.|ipv6.]db.reg=<REGISTRY> 4313\end_layout 4314 4315\begin_layout Code 4316 4317 Registry tokens: 6BONE IANA APNIC ARIN RIPENCC LACNIC AFRINIC 6TO4 reserved 4318 unknown 4319\end_layout 4320 4321\begin_layout Code 4322 4323 IPv4/v6 address filter tokens based on address/mask: 4324\end_layout 4325 4326\begin_layout Code 4327 4328 [^]ipv4.addr=<IPV4-ADDRESS>[<PREFIX-LENGTH>] 4329\end_layout 4330 4331\begin_layout Code 4332 4333 [^]ipv6.addr=<IPV6-ADDRESS>[<PREFIX-LENGTH>] 4334\end_layout 4335 4336\begin_layout Code 4337 4338 IPv4/v6 address filter tokens based on address ranges (<=|<|>|>=): 4339\end_layout 4340 4341\begin_layout Code 4342 4343 [^]ipv4.addr(<=|<|>|>=)<IPV4-ADDRESS> 4344\end_layout 4345 4346\begin_layout Code 4347 4348 [^]ipv6.addr(<=|<|>|>=)<IPV6-ADDRESS> 4349\end_layout 4350 4351\begin_layout Code 4352 4353 as alternative in case <|> creating problems also supported: =(le|lt|gt|ge)=: 4354\end_layout 4355 4356\begin_layout Code 4357 4358 [^]ipv4.addr=(le|lt|gt|ge)=<IPV4-ADDRESS> 4359\end_layout 4360 4361\begin_layout Code 4362 4363 [^]ipv6.addr=(le|lt|gt|ge)=<IPV6-ADDRESS> 4364\end_layout 4365 4366\begin_layout Code 4367 4368 EUI-48/MAC address filter tokens: 4369\end_layout 4370 4371\begin_layout Code 4372 4373 IMPLEMENTATION MISSING 4374\end_layout 4375 4376\begin_layout Code 4377 4378 EUI-64 address filter tokens: 4379\end_layout 4380 4381\begin_layout Code 4382 4383 IMPLEMENTATION MISSING 4384\end_layout 4385 4386\begin_layout Standard 4387Example for some filter expressions: 4388\end_layout 4389 4390\begin_layout Code 4391 4392$ cat ip.bieringer.de-log.201504 | ipv6calc -E ipv6.db.cc=DE | wc -l 4393\end_layout 4394 4395\begin_layout Code 4396 43975068 4398\end_layout 4399 4400\begin_layout Code 4401 4402\end_layout 4403 4404\begin_layout Code 4405 4406$ cat ip.bieringer.de-log.201504 | ipv6calc -E ipv6.db.cc=US | wc -l 4407\end_layout 4408 4409\begin_layout Code 4410 4411305 4412\end_layout 4413 4414\begin_layout Code 4415 4416\end_layout 4417 4418\begin_layout Code 4419 4420$ cat ip.bieringer.de-log.201504 | ipv6calc -E ipv6.db.reg=ARIN | wc -l 4421\end_layout 4422 4423\begin_layout Code 4424 4425306 4426\end_layout 4427 4428\begin_layout Code 4429 4430\end_layout 4431 4432\begin_layout Code 4433 4434$ cat ip.bieringer.de-log.201504 | ipv6calc -E iid-random | wc -l 4435\end_layout 4436 4437\begin_layout Code 4438 44394806 4440\end_layout 4441 4442\begin_layout Code 4443 4444\end_layout 4445 4446\begin_layout Code 4447 4448$ cat ip.bieringer.de-log.201504 | ipv6calc -E ipv6.db.cc=US,iid-random | wc 4449 -l 4450\end_layout 4451 4452\begin_layout Code 4453 445416 4455\end_layout 4456 4457\begin_layout Code 4458 4459\end_layout 4460 4461\begin_layout Code 4462 4463$ cat ip.bieringer.de-log.201504 | ipv6calc -A filter -E ipv6.db.cc=US,iid-random,ipv 44644.db.cc=US | wc -l 4465\end_layout 4466 4467\begin_layout Code 4468 44691842 4470\end_layout 4471 4472\begin_layout Code 4473 4474\end_layout 4475 4476\begin_layout Code 4477 4478$ cat ip.bieringer.de-log.201504 | ipv6calc -A filter -E db.asn=8767 | wc -l 4479\end_layout 4480 4481\begin_layout Code 4482 44832363 4484\end_layout 4485 4486\begin_layout Code 4487 4488$ cat ip.bieringer.de-log.201504 | ipv6calc -A filter -E ipv6.db.asn=8767 | wc 4489 -l 4490\end_layout 4491 4492\begin_layout Code 4493 44941452 4495\end_layout 4496 4497\begin_layout Code 4498 4499$ cat ip.bieringer.de-log.201504 | ipv6calc -A filter -E ipv4.db.asn=8767 | wc 4500 -l 4501\end_layout 4502 4503\begin_layout Code 4504 4505911 4506\end_layout 4507 4508\begin_layout Standard 4509Example for searching for addresses in a specific range (supported since 4510 0.99.2): 4511\end_layout 4512 4513\begin_layout Code 4514 4515$ cat ip.bieringer.de-log.201609 | awk '{ print $1 }' | sort | uniq | ipv6calc 4516 -E ipv6.addr=ge=2002::,ipv6.addr=lt=2003:: 4517\end_layout 4518 4519\begin_layout Code 4520 45212002:2518:0:1:2:3:4:5 4522\end_layout 4523 4524\begin_layout Code 4525 4526... 4527\end_layout 4528 4529\begin_layout Code 4530 45312002:d950:0:1:2:3:4:5 4532\end_layout 4533 4534\begin_layout Subsubsection 4535Special action 4536\begin_inset Quotes eld 4537\end_inset 4538 4539test 4540\begin_inset Quotes erd 4541\end_inset 4542 4543: 4544\end_layout 4545 4546\begin_layout Standard 4547Special action 4548\begin_inset Quotes eld 4549\end_inset 4550 4551test 4552\begin_inset Quotes erd 4553\end_inset 4554 4555 (since 0.99.2) can be used in command line or pipe mode (single address only) 4556 to test IP addresses related to a given prefix or range . 4557\end_layout 4558 4559\begin_layout Code 4560 4561$ ipv6calc -A test -? 4562\end_layout 4563 4564\begin_layout Code 4565 4566ipv6calc: version 2.1.1 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6 4567 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC 4568 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION 4569 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID 4570 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T 4571YPE-GEONAMEID 4572\end_layout 4573 4574\begin_layout Code 4575 4576 Test given address(es) against supported tests: 4577\end_layout 4578 4579\begin_layout Code 4580 4581 --test_prefix <PREFIX> : inside a prefix 4582\end_layout 4583 4584\begin_layout Code 4585 4586 --test_gt|--test_ge <ADDRESS>: greater(/equal) than an address 4587\end_layout 4588 4589\begin_layout Code 4590 4591 --test_lt|--test_le <ADDRESS>: less(/equal) than an address 4592\end_layout 4593 4594\begin_layout Code 4595 4596 Test given address(es) from stdin, e.g. 4597\end_layout 4598 4599\begin_layout Code 4600 4601 echo '2001:db8::1' | ipv6calc [-A test] --test_prefix 2001:db8::/32 4602\end_layout 4603 4604\begin_layout Code 4605 4606 echo '2001:db8::1' | ipv6calc [-A test] --test_prefix 2001:db9::/32 4607\end_layout 4608 4609\begin_layout Code 4610 4611 Single address test, return code: 0=inside/matching 1=outside/not-matching 4612 2=uncomparable 4613\end_layout 4614 4615\begin_layout Code 4616 4617 ipv6calc [-A test] --test_prefix 2001:db8::/32 2001:db8::1 4618\end_layout 4619 4620\begin_layout Code 4621 4622 ipv6calc [-A test] --test_prefix 2001:db9::/32 2001:db8::1 4623\end_layout 4624 4625\begin_layout Code 4626 4627 ipv6calc [-A test] --test_ge 2001:db8:: --test_le 2001:db8:ffff:ffff:ffff:ffff 4628:ffff:ffff 2001:db8::1 4629\end_layout 4630 4631\begin_layout Code 4632 4633 ipv6calc [-A test] --test_ge 2001:db9:: --test_le 2001:db9:ffff:ffff:ffff:ffff 4634:ffff:ffff 2001:db8::1 4635\end_layout 4636 4637\begin_layout Code 4638 4639 ipv6calc [-A test] --test_ge 2001:db9:: --test_lt 2001:dba:: 2001:db8::1 4640\end_layout 4641 4642\begin_layout Code 4643 4644 ipv6calc [-A test] --test_ge 2001:db8:: --test_lt 2001:db9:: 2001:db8::1 4645\end_layout 4646 4647\begin_layout Standard 4648Example for command line mode: 4649\end_layout 4650 4651\begin_layout Code 4652 4653$ ipv6calc --test_ge 2001:db8:: --test_le 2001:db8:ffff:ffff:ffff:ffff:ffff:ffff 4654 2001:db8::1; echo $? 4655\end_layout 4656 4657\begin_layout Code 4658 4659no input type specified, try autodetection...found type: ipv6addr 4660\end_layout 4661 4662\begin_layout Code 4663 4664no output type specified, try autodetection...found type: ipv6addr 4665\end_layout 4666 4667\begin_layout Code 4668 46692001:db8::1 greater/equal than 2001:db8:: less/equal than 2001:db8:ffff:ffff: 4670ffff:ffff:ffff:ffff 4671\end_layout 4672 4673\begin_layout Code 4674 46750 4676\end_layout 4677 4678\begin_layout Standard 4679Example for command line mode (quiet): 4680\end_layout 4681 4682\begin_layout Code 4683 4684$ ipv6calc -q --test_ge 2001:db8:: --test_le 2001:db8:ffff:ffff:ffff:ffff:ffff:f 4685fff 2001:db8::1; echo $? 4686\end_layout 4687 4688\begin_layout Code 4689 46902001:db8::1 greater/equal than 2001:db8:: less/equal than 2001:db8:ffff:ffff: 4691ffff:ffff:ffff:ffff 4692\end_layout 4693 4694\begin_layout Code 4695 46960 4697\end_layout 4698 4699\begin_layout Standard 4700Example for pipe mode: 4701\end_layout 4702 4703\begin_layout Code 4704 4705$ echo -e "1.2.3.4 4706\backslash 4707n1.2.4.4" | ipv6calc --test_prefix 1.2.3.0/24 4708\end_layout 4709 4710\begin_layout Code 4711 47121.2.3.4 inside 1.2.3.0/24 4713\end_layout 4714 4715\begin_layout Code 4716 47171.2.4.4 NOT inside 1.2.3.0/24 4718\end_layout 4719 4720\begin_layout Section 4721Webserver log conversion helper program "ipv6logconv" 4722\end_layout 4723 4724\begin_layout Standard 4725This program parses address tokens of a given webserver logfile and converts 4726 them to special strings, useful for statistics (e.g. 4727 created by using "analog"). 4728\end_layout 4729 4730\begin_layout Subsection 4731Supported options 4732\end_layout 4733 4734\begin_layout Code 4735 4736$ ipv6logconv -h 4737\end_layout 4738 4739\begin_layout Code 4740 4741ipv6logconv: version 2.1.1 CONV_REG CONV_IEEE 4742\end_layout 4743 4744\begin_layout Code 4745 4746(P) & (C) 2002-2019 by Peter Bieringer <pb (at) bieringer.de> 4747\end_layout 4748 4749\begin_layout Code 4750 4751This program converts IPv4/IPv6 addresses in HTTP server log files 4752\end_layout 4753 4754\begin_layout Code 4755 4756 [-d|--debug <debug value>] : debug value (bitwise like) 4757\end_layout 4758 4759\begin_layout Code 4760 4761 can also be set by IPV6CALC_DEBUG environment 4762 value 4763\end_layout 4764 4765\begin_layout Code 4766 4767 [-v|--version [-v [-v]]] : version information (2 optional detail levels) 4768\end_layout 4769 4770\begin_layout Code 4771 4772 [-v|--version -h] : explanation of feature tokens 4773\end_layout 4774 4775\begin_layout Code 4776 4777 [-V|--verbose] : be more verbose 4778\end_layout 4779 4780\begin_layout Code 4781 4782 [-h|--help|-?] : this online help 4783\end_layout 4784 4785\begin_layout Code 4786 4787 Performance options: 4788\end_layout 4789 4790\begin_layout Code 4791 4792 [-n|--nocache] : disable caching 4793\end_layout 4794 4795\begin_layout Code 4796 4797 [-c|--cachelimit <value>] : set cache limit 4798\end_layout 4799 4800\begin_layout Code 4801 4802 default: 20 4803\end_layout 4804 4805\begin_layout Code 4806 4807 maximum: 200 4808\end_layout 4809 4810\begin_layout Code 4811 4812 Output options: 4813\end_layout 4814 4815\begin_layout Code 4816 4817 [--out <output type>] : specify output type 4818\end_layout 4819 4820\begin_layout Code 4821 4822 addrtype : Address type 4823\end_layout 4824 4825\begin_layout Code 4826 4827 ouitype : OUI (IEEE) type 4828\end_layout 4829 4830\begin_layout Code 4831 4832 ipv6addrtype : IPv6 address type 4833\end_layout 4834 4835\begin_layout Code 4836 4837 any : any type 4838\end_layout 4839 4840\begin_layout Code 4841 4842 Takes data from stdin, proceed it to stdout 4843\end_layout 4844 4845\begin_layout Subsection 4846Examples 4847\end_layout 4848 4849\begin_layout Standard 4850A demonstration about which kind of statistics are possible to produce is 4851 shown at 4852\begin_inset CommandInset href 4853LatexCommand href 4854name "http://www.ipv6.bieringer.de/" 4855target "http://www.ipv6.bieringer.de/" 4856literal "false" 4857 4858\end_inset 4859 4860 (IPv6 only). 4861\end_layout 4862 4863\begin_layout Subsection 4864Usage 4865\end_layout 4866 4867\begin_layout Standard 4868Example: 4869\end_layout 4870 4871\begin_layout Code 4872 4873$ echo "2002:50b5:7940:0000:0000:0000:50b5:7940 - -" | ipv6logconv -q --out 4874 any 4875\end_layout 4876 4877\begin_layout Code 4878 4879RIPENCC.6to4.global-unicast.ipv6-addr.addrtype.ipv6calc 4880\end_layout 4881 4882\begin_layout Standard 4883See more examples inside the package. 4884\end_layout 4885 4886\begin_layout Section 4887Webserver log anonymization helper program "ipv6loganon" 4888\end_layout 4889 4890\begin_layout Standard 4891On autoconfiguration, the interface part of an IPv6 address is based on 4892 the MAC address of the network interface card (NIC). 4893 This address is used for outgoing requests, if privacy option (RFC3041 4894 / RFC4941) is not enabled. 4895 This results in many privacy related information on web- or mail-server 4896 log files. 4897 Administrators, which won't (be allowed to) store such information over 4898 time, but still do not want to loose information about address type distributio 4899n should use 'ipv6loganon' to anonymize their log files. 4900\end_layout 4901 4902\begin_layout Standard 4903Since version 0.94.0 internally also IID anonymization is possible without 4904 loosing any information for 4905\begin_inset Quotes eld 4906\end_inset 4907 4908ipv6logstats 4909\begin_inset Quotes erd 4910\end_inset 4911 4912. 4913\end_layout 4914 4915\begin_layout Standard 4916Since version 0.95.0 internally also prefix anonymization is possible without 4917 loosing any information for 4918\begin_inset Quotes eld 4919\end_inset 4920 4921ipv6logstats 4922\begin_inset Quotes erd 4923\end_inset 4924 4925. 4926\end_layout 4927 4928\begin_layout Subsection 4929Anonymization details 4930\end_layout 4931 4932\begin_layout Subsubsection 4933Method 4934\begin_inset Quotes eld 4935\end_inset 4936 4937zeroize 4938\begin_inset Quotes erd 4939\end_inset 4940 4941 4942\end_layout 4943 4944\begin_layout Standard 4945The anonymizer would keep as much information as possible for IPv6 address 4946 types. 4947\end_layout 4948 4949\begin_layout Standard 4950Client-side IID would be anonymized by 4951\end_layout 4952 4953\begin_layout Itemize 4954EUI-48 based: serial number would be zero'ed, keeping OID 4955\end_layout 4956 4957\begin_layout Itemize 4958EUI-64 based: serial number would be zero'ed, keeping OID 4959\end_layout 4960 4961\begin_layout Itemize 4962ISATAP: client IPv4 address would be anonymized by given IPv4 mask 4963\end_layout 4964 4965\begin_layout Itemize 4966TEREDO: client IPv4 address would be anonymized by given IPv4 mask, client 4967 port would be zero'ed 4968\end_layout 4969 4970\begin_layout Itemize 49716to4(Microsoft): client IPv4 address would be anonymized by given IPv4 mask 4972\end_layout 4973 4974\begin_layout Itemize 4975local: whole IID would be zero'ed 4976\end_layout 4977 4978\begin_layout Standard 4979Client-side SLA would be anonymized by 4980\end_layout 4981 4982\begin_layout Itemize 4983SLA would be zero'ed 4984\end_layout 4985 4986\begin_layout Standard 4987Prefix would be anonymized by 4988\end_layout 4989 4990\begin_layout Itemize 49916to4: client IPv4 address would be anonymized by given IPv4 mask 4992\end_layout 4993 4994\begin_layout Standard 4995Compat/Mapped IPv4 addresses would be anonymized by 4996\end_layout 4997 4998\begin_layout Itemize 4999IPv4 address would be anonymized by given IPv4 mask 5000\end_layout 5001 5002\begin_layout Subsubsection 5003Method 5004\begin_inset Quotes eld 5005\end_inset 5006 5007anonmize 5008\begin_inset Quotes erd 5009\end_inset 5010 5011 5012\end_layout 5013 5014\begin_layout Standard 5015The anonymizer would keep as much information as possible for the IID of 5016 an IPv6 address. 5017\end_layout 5018 5019\begin_layout Standard 5020Description from libipv6addr.h: 5021\end_layout 5022 5023\begin_layout Code 5024 5025 * IID anonymization is done by replacing with related information (64-bit) 5026\end_layout 5027 5028\begin_layout Code 5029 5030 * xxxx:xxxx:xxxx:xxxC (C = 4-bit checksum) 5031\end_layout 5032 5033\begin_layout Code 5034 5035 * 5036\end_layout 5037 5038\begin_layout Code 5039 5040 * a9p9 4941 0000 000C -> RFC 4941 anonymized privacy extension Interface 5041 ID 5042\end_layout 5043 5044\begin_layout Code 5045 5046 * 5047\end_layout 5048 5049\begin_layout Code 5050 5051 * a9p9 4291 4xxx xxxC -> RFC 4291 anonymized EUI-48 Interface ID, xxx 5052 xxx = converted OUI 5053\end_layout 5054 5055\begin_layout Code 5056 5057 * a9p9 4291 5xxx xxxC -> RFC 4291 anonymized EUI-48 Interface ID, xxx 5058 xxx = converted mapped IAB/OUI-36 5059\end_layout 5060 5061\begin_layout Code 5062 5063 * a9p9 4291 6xxx xxxC -> RFC 4291 anonymized EUI-64 Interface ID, xxx 5064 xxx = converted OUI 5065\end_layout 5066 5067\begin_layout Code 5068 5069 * a9p9 4291 7xxx xxxC -> RFC 4291 anonymized EUI-64 Interface ID, xxx 5070 xxx = converted mapped IAB/OUI-36 5071\end_layout 5072 5073\begin_layout Code 5074 5075 * a9p9 4291 8xxx xxxC -> RFC 4291 embedded anonymized IPv4 address, xxx 5076 xxx = first 24 bit of included (anonymized) IPv4 address 5077\end_layout 5078 5079\begin_layout Code 5080 5081 * a9p9 4291 c02d 5d1C -> RFC 4291 Chapter 2.5.1 anonymized static Interface 5082 ID 5083\end_layout 5084 5085\begin_layout Code 5086 5087 * 5088\end_layout 5089 5090\begin_layout Code 5091 5092 * a9p9 5214 4xxx xxxC -> RFC 5214 anonymized ISATAP Interface ID, xxx 5093 xxx = first 24 bit of included (anonymized) IPv4 address (local scope) 5094\end_layout 5095 5096\begin_layout Code 5097 5098 * a9p9 5214 5xxx xxxC -> RFC 5214 anonymized ISATAP Interface ID, xxx 5099 xxx = first 24 bit of included (anonymized) IPv4 address (global scope) 5100\end_layout 5101 5102\begin_layout Code 5103 5104 * a9p9 5214 cxx0 000C -> RFC 5214 anonymized ISATAP Interface ID, xx 5105 = first 8 bit of included vendor ID (local scope) 5106\end_layout 5107 5108\begin_layout Code 5109 5110 * a9p9 5214 dxx0 000C -> RFC 5214 anonymized ISATAP Interface ID, xx 5111 = first 8 bit of included vendor ID (global scope) 5112\end_layout 5113 5114\begin_layout Code 5115 5116 * a9p9 5214 exxx xxxC -> RFC 5214 anonymized ISATAP Interface ID, xxx 5117 xxx = first 24 bit of included extension ID (local scope) 5118\end_layout 5119 5120\begin_layout Code 5121 5122 * a9p9 5214 fxxx xxxC -> RFC 5214 anonymized ISATAP Interface ID, xxx 5123 xxx = first 24 bit of included extension ID (global scope) 5124\end_layout 5125 5126\begin_layout Code 5127 5128 * 5129\end_layout 5130 5131\begin_layout Code 5132 5133 * a9p9 4843 0000 000C -> RFC 4843 anonymized ORCHID hash 5134\end_layout 5135 5136\begin_layout Standard 5137Depending on given mask, the part of the prefix will be replaced: 5138\end_layout 5139 5140\begin_layout Code 5141 5142 * SLA/NLA prefix part anonymization is done by replacing with pattern a909a909 5143\end_layout 5144 5145\begin_layout Code 5146 5147 * p = number of nibbles anonymized 5148\end_layout 5149 5150\begin_layout Subsubsection 5151Method 5152\begin_inset Quotes eld 5153\end_inset 5154 5155keep-type-asn-cc 5156\begin_inset Quotes erd 5157\end_inset 5158 5159 5160\end_layout 5161 5162\begin_layout Standard 5163In addition to 5164\begin_inset Quotes eld 5165\end_inset 5166 5167anonymize 5168\begin_inset Quotes erd 5169\end_inset 5170 5171 (of IID) this method anonymizes also the prefix of an IPv6 address or a 5172 whole IPv4 address by keeping ASN (Autonomous System Number, Country Code 5173 and Type). 5174\end_layout 5175 5176\begin_layout Standard 5177Description from libipv6addr.h: 5178\end_layout 5179 5180\begin_layout Code 5181 5182 * Prefix anonymization in case of method=kp: p=0x0f 5183\end_layout 5184 5185\begin_layout Code 5186 5187 * a909:ccca:aaaa:aaaC (C = 4-bit checksum) 5188\end_layout 5189 5190\begin_layout Code 5191 5192 * ccc -> 10-bit Country Code mapping [A-Z]*[A-Z0-9] 5193 (936) 5194\end_layout 5195 5196\begin_layout Code 5197 5198 * 0x3FD = LISP 5199\end_layout 5200 5201\begin_layout Code 5202 5203 * 0x3FE = unknown country 5204\end_layout 5205 5206\begin_layout Code 5207 5208 * 0x3FF - 16 + REGISTRY_6BONE && ASN=0 5209 = 6bone 5210\end_layout 5211 5212\begin_layout Code 5213 5214 * 0x000-0x3A7: c1= c / 36, c2 = c % 36 5215\end_layout 5216 5217\begin_layout Code 5218 5219 * aaaaaaaa -> 32-bit ASN 5220\end_layout 5221 5222\begin_layout Standard 5223Description from libipv4addr.h: 5224\end_layout 5225 5226\begin_layout Code 5227 5228 * Global IPv4 addresses are anoymized by storing country code and AS number 5229\end_layout 5230 5231\begin_layout Code 5232 5233 * and using prefix of experimental range (240-255.x.y.z) 5234\end_layout 5235 5236\begin_layout Code 5237 5238 * 5239\end_layout 5240 5241\begin_layout Code 5242 5243 * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 5244\end_layout 5245 5246\begin_layout Code 5247 5248 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 5249\end_layout 5250 5251\begin_layout Code 5252 5253 * 1 1 1 1 5254\end_layout 5255 5256\begin_layout Code 5257 5258 * |p p p p| 5259\end_layout 5260 5261\begin_layout Code 5262 5263 * Prefix 5264\end_layout 5265 5266\begin_layout Code 5267 5268 * 0xF 5269\end_layout 5270 5271\begin_layout Code 5272 5273 * 5274\end_layout 5275 5276\begin_layout Code 5277 5278 * Pariy Bit (odd parity) 5279\end_layout 5280 5281\begin_layout Code 5282 5283 * |P| 5284\end_layout 5285 5286\begin_layout Code 5287 5288 * 5289\end_layout 5290 5291\begin_layout Code 5292 5293 * Mapping of Country Code 5294\end_layout 5295 5296\begin_layout Code 5297 5298 * |c c c c c c c c c c| 5299\end_layout 5300 5301\begin_layout Code 5302 5303 * 10-bit Country Code mapping [A-Z]*[A-Z0-9] (936) 5304\end_layout 5305 5306\begin_layout Code 5307 5308 * 0x3FF = unknown country 5309\end_layout 5310 5311\begin_layout Code 5312 5313 * 0x000-0x3A7: c1= c / 36, c2 = c % 36 5314\end_layout 5315 5316\begin_layout Code 5317 5318 * 5319\end_layout 5320 5321\begin_layout Code 5322 5323 * Mapping of ASN <= 65535 5324\end_layout 5325 5326\begin_layout Code 5327 5328 * 0|a a a a a a a a a a a a a a a a| 5329\end_layout 5330 5331\begin_layout Code 5332 5333 * 16-bit ASN 5334\end_layout 5335 5336\begin_layout Code 5337 5338 * 5339\end_layout 5340 5341\begin_layout Code 5342 5343 * Mapping of ASN >= 65536, ASN & 0xE000 == 0 (12-bit LSB is ok) 5344\end_layout 5345 5346\begin_layout Code 5347 5348 * 1|r r r|0|l l l l l l l l l l l l| 5349\end_layout 5350 5351\begin_layout Code 5352 5353 * 13-bit LSB of ASN 5354\end_layout 5355 5356\begin_layout Code 5357 5358 * 5359\end_layout 5360 5361\begin_layout Code 5362 5363 * Mapping of ASN >= 65536, ASN & 0xE000 != 0 (12-bit LSB overflow) => unspecifi 5364ed 5365\end_layout 5366 5367\begin_layout Code 5368 5369 * 1|r r r|1|0 0 0 0 0 0 0 0 0 0 0 0| 5370\end_layout 5371 5372\begin_layout Code 5373 5374 * 5375\end_layout 5376 5377\begin_layout Code 5378 5379 * Mapping of ASN registry for ASN >= 65536 5380\end_layout 5381 5382\begin_layout Code 5383 5384 * 0 0 0 = "unknown ASN registry" 5385\end_layout 5386 5387\begin_layout Code 5388 5389 * 0 1 0 = APNIC 5390\end_layout 5391 5392\begin_layout Code 5393 5394 * 0 1 1 = RIPE 5395\end_layout 5396 5397\begin_layout Code 5398 5399 * 1 0 0 = LACNIC 5400\end_layout 5401 5402\begin_layout Code 5403 5404 * 1 0 1 = AFRINIC 5405\end_layout 5406 5407\begin_layout Code 5408 5409 * 1 1 0 = ARIN 5410\end_layout 5411 5412\begin_layout Code 5413 5414 * Mapping of LISP 5415\end_layout 5416 5417\begin_layout Code 5418 5419 * 1|r r r|1|1|0 0 0 0 0 0 0 0 0 0 0| 5420\end_layout 5421 5422\begin_layout Subsubsection 5423Method 5424\begin_inset Quotes eld 5425\end_inset 5426 5427keep-type-geonameid 5428\begin_inset Quotes erd 5429\end_inset 5430 5431 5432\end_layout 5433 5434\begin_layout Standard 5435In difference to keep-type-asn-cc this method anonymizes the prefix of an 5436 IPv6 address or a whole IPv4 address by keeping the GeonameID and Type. 5437\end_layout 5438 5439\begin_layout Standard 5440Description from libipv6addr.h: 5441\end_layout 5442 5443\begin_layout Code 5444 5445 * a909:sssg:gggg:gggC (C = 4-bit checksum) 5446\end_layout 5447 5448\begin_layout Code 5449 5450 * sss -> 10-bit source mapping 5451\end_layout 5452 5453\begin_layout Code 5454 5455 * GeonameID source information 5456\end_layout 5457 5458\begin_layout Code 5459 5460 * 0x000 = unknown 5461\end_layout 5462 5463\begin_layout Code 5464 5465 * 0x001 = continent (prio: lowest) 5466\end_layout 5467 5468\begin_layout Code 5469 5470 * 0x002 = country 5471\end_layout 5472 5473\begin_layout Code 5474 5475 * 0x003 = state/prov 5476\end_layout 5477 5478\begin_layout Code 5479 5480 * 0x004 = district 5481\end_layout 5482 5483\begin_layout Code 5484 5485 * 0x005 = city (prio: highest) 5486\end_layout 5487 5488\begin_layout Code 5489 5490 * 0x006 = (reserved) 5491\end_layout 5492 5493\begin_layout Code 5494 5495 * 0x007 = LISP 5496\end_layout 5497 5498\begin_layout Code 5499 5500 * 0x0r. 5501 = registry 5502\end_layout 5503 5504\begin_layout Code 5505 5506 * -> 2 leftmost bit are |0 1| 5507\end_layout 5508 5509\begin_layout Code 5510 5511 * gggggggg -> 32-bit GeonameID 5512\end_layout 5513 5514\begin_layout Code 5515 5516 * 0x11800 = LISP 5517\end_layout 5518 5519\begin_layout Standard 5520Description from libipv4addr.h: 5521\end_layout 5522 5523\begin_layout Code 5524 5525 * IPv4 address anonymization type "keep-type-geonameid" 5526\end_layout 5527 5528\begin_layout Code 5529 5530 * Global IPv4 addresses are anonymized by storing GeonameID 5531\end_layout 5532 5533\begin_layout Code 5534 5535 * and using prefix of experimental range (240-255.x.y.z) 5536\end_layout 5537 5538\begin_layout Code 5539 5540 * 5541\end_layout 5542 5543\begin_layout Code 5544 5545 * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 5546\end_layout 5547 5548\begin_layout Code 5549 5550 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 5551\end_layout 5552 5553\begin_layout Code 5554 5555 * 1 1 1 1 5556\end_layout 5557 5558\begin_layout Code 5559 5560 * |p p p p| 5561\end_layout 5562 5563\begin_layout Code 5564 5565 * Prefix 5566\end_layout 5567 5568\begin_layout Code 5569 5570 * 0xF 5571\end_layout 5572 5573\begin_layout Code 5574 5575 * 5576\end_layout 5577 5578\begin_layout Code 5579 5580 * Parity Bit (even parity) 5581\end_layout 5582 5583\begin_layout Code 5584 5585 * |P| 5586\end_layout 5587 5588\begin_layout Code 5589 5590 * 5591\end_layout 5592 5593\begin_layout Code 5594 5595 * Mapping of GeonameID source 5596\end_layout 5597 5598\begin_layout Code 5599 5600 * |s s s| 5601\end_layout 5602 5603\begin_layout Code 5604 5605 * 3-bit GeonameID source information 5606\end_layout 5607 5608\begin_layout Code 5609 5610 * 0 0 0 (0x0) = unknown 5611\end_layout 5612 5613\begin_layout Code 5614 5615 * 0 0 1 (0x1) = continent (prio: lowest) 5616\end_layout 5617 5618\begin_layout Code 5619 5620 * 0 1 0 (0x2) = country 5621\end_layout 5622 5623\begin_layout Code 5624 5625 * 0 1 1 (0x3) = state/prov 5626\end_layout 5627 5628\begin_layout Code 5629 5630 * 1 0 0 (0x4) = district 5631\end_layout 5632 5633\begin_layout Code 5634 5635 * 1 0 1 (0x5) = city (prio: highest) 5636\end_layout 5637 5638\begin_layout Code 5639 5640 * 1 1 0 (0x6) = (reserved) 5641\end_layout 5642 5643\begin_layout Code 5644 5645 * 1 1 1 (0x7) = LISP 5646\end_layout 5647 5648\begin_layout Code 5649 5650 * 5651\end_layout 5652 5653\begin_layout Code 5654 5655 * Mapping of GeonameID (limited to IDs < 2^24, in worst case ID from source 5656 with lower prio is used) 5657\end_layout 5658 5659\begin_layout Code 5660 5661 * |g g g g g g g g g g g g g g g g g g g g g g g g| 5662\end_layout 5663 5664\begin_layout Code 5665 5666 * 5667\end_layout 5668 5669\begin_layout Code 5670 5671 * Mapping of LISP registry 5672\end_layout 5673 5674\begin_layout Code 5675 5676 * 0 0 0 = "unknown ASN registry" 5677\end_layout 5678 5679\begin_layout Code 5680 5681 * 0 1 0 = APNIC 5682\end_layout 5683 5684\begin_layout Code 5685 5686 * 0 1 1 = RIPE 5687\end_layout 5688 5689\begin_layout Code 5690 5691 * 1 0 0 = LACNIC 5692\end_layout 5693 5694\begin_layout Code 5695 5696 * 1 0 1 = AFRINIC 5697\end_layout 5698 5699\begin_layout Code 5700 5701 * 1 1 0 = ARIN 5702\end_layout 5703 5704\begin_layout Code 5705 5706 * |0 0 0 0 0 0 0 1 r r r 1 1 0 0 0 0 0 0 0 0 0 0 0| 5707\end_layout 5708 5709\begin_layout Subsection 5710Supported log file formats 5711\end_layout 5712 5713\begin_layout Standard 5714Currently native supported log files: 5715\end_layout 5716 5717\begin_layout Itemize 5718Apache log file format, 1st token is IPv4 or IPv6 address 5719\end_layout 5720 5721\begin_layout Standard 5722There are plans to support also mail server log files sometimes in the future, 5723 but because of different formats, this would be probably done by a Perl 5724 program which parses the log file and a (cached) 'ip6calc' call with action 5725 'anonymize'. 5726\end_layout 5727 5728\begin_layout Subsection 5729Supported options 5730\end_layout 5731 5732\begin_layout Code 5733 5734$ ipv6loganon -h 5735\end_layout 5736 5737\begin_layout Code 5738 5739ipv6loganon: version 2.1.1 ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC 5740 ANON_KEEP-TYPE-GEONAMEID 5741\end_layout 5742 5743\begin_layout Code 5744 5745(P) & (C) 2007-2019 by Peter Bieringer <pb (at) bieringer.de> 5746\end_layout 5747 5748\begin_layout Code 5749 5750This program anonymizes IPv4/IPv6 addresses in e.g. 5751 HTTP server log files 5752\end_layout 5753 5754\begin_layout Code 5755 5756 [-d|--debug <debug value>] : debug value (bitwise like) 5757\end_layout 5758 5759\begin_layout Code 5760 5761 can also be set by IPV6CALC_DEBUG environment 5762 value 5763\end_layout 5764 5765\begin_layout Code 5766 5767 [-v|--version [-v [-v]]] : version information (2 optional detail levels) 5768\end_layout 5769 5770\begin_layout Code 5771 5772 [-v|--version -h] : explanation of feature tokens 5773\end_layout 5774 5775\begin_layout Code 5776 5777 [-V|--verbose] : be more verbose 5778\end_layout 5779 5780\begin_layout Code 5781 5782 [-h|--help|-?] : this online help 5783\end_layout 5784 5785\begin_layout Code 5786 5787 [-q|--quiet] : be more quiet 5788\end_layout 5789 5790\begin_layout Code 5791 5792 [--disable-ip2location ] : IP2Location support disabled 5793\end_layout 5794 5795\begin_layout Code 5796 5797 [--db-ip2location-disable ] : IP2Location support disabled 5798\end_layout 5799 5800\begin_layout Code 5801 5802 [--db-ip2location-dir <directory>] : IP2Location database directory (default: 5803 /usr/share/IP2Location) 5804\end_layout 5805 5806\begin_layout Code 5807 5808 [--db-ip2location-lib <file> ] : IP2Location library file (default: 5809 libIP2Location.so) 5810\end_layout 5811 5812\begin_layout Code 5813 5814 [--db-ip2location-only-type <TYPE>]: IP2Location database only selected 5815 type (1-120) 5816\end_layout 5817 5818\begin_layout Code 5819 5820 [--db-ip2location-allow-softlinks] : IP2Location database softlinks allowed 5821\end_layout 5822 5823\begin_layout Code 5824 5825 by default they are ignored because it is hard to autodetect COMM/LITE/SAMP 5826LE 5827\end_layout 5828 5829\begin_layout Code 5830 5831 [--db-ip2location-lite-to-sample-autoswitch-max-delta-months <MONTHS>]: 5832\end_layout 5833 5834\begin_layout Code 5835 5836 autoswitch from LITE to SAMPLE databases if possible and delta is not 5837 more than 12 months (0=disabled) 5838\end_layout 5839 5840\begin_layout Code 5841 5842 [--db-ip2location-comm-to-lite-switch-min-delta-months <MONTHS>]: 5843\end_layout 5844 5845\begin_layout Code 5846 5847 switch from COMM to LITE databases if possible and delta more than 5848 12 months (0=disabled) 5849\end_layout 5850 5851\begin_layout Code 5852 5853 [--disable-geoip ] : GeoIP support disabled 5854\end_layout 5855 5856\begin_layout Code 5857 5858 [--db-geoip-disable ] : GeoIP support disabled 5859\end_layout 5860 5861\begin_layout Code 5862 5863 [--db-geoip-dir <directory>] : GeoIP database directory (default: 5864 /usr/share/GeoIP) 5865\end_layout 5866 5867\begin_layout Code 5868 5869 [--db-geoip-lib <file> ] : GeoIP library file (default: libGeoIP.so.1) 5870\end_layout 5871 5872\begin_layout Code 5873 5874 [--db-mmdb-lib <file> ] : MaxMindDB library file (default: 5875 libmaxminddb.so.0) 5876\end_layout 5877 5878\begin_layout Code 5879 5880 [--disable-geoip2 ] : GeoIP (MaxMindDB) support disabled 5881\end_layout 5882 5883\begin_layout Code 5884 5885 [--db-geoip2-disable ] : GeoIP (MaxMindDB) support disabled 5886\end_layout 5887 5888\begin_layout Code 5889 5890 [--db-geoip2-dir <directory>] : GeoIP (MaxMindDB) database directory 5891 (default: /usr/share/GeoIP) 5892\end_layout 5893 5894\begin_layout Code 5895 5896 [--disable-dbip2 ] : db-ip.com (MaxMindDB) support disabled 5897\end_layout 5898 5899\begin_layout Code 5900 5901 [--db-dbip2-disable ] : db-ip.com (MaxMindDB) support disabled 5902\end_layout 5903 5904\begin_layout Code 5905 5906 [--db-dbip2-dir <directory>] : db-ip.com (MaxMindDB) database directory 5907 (default: /usr/share/DBIP) 5908\end_layout 5909 5910\begin_layout Code 5911 5912 [--db-dbip2-only-type <TYPE>] : db-ip.com (MaxMindDB) database only 5913 selected type (1-10) 5914\end_layout 5915 5916\begin_layout Code 5917 5918 [--db-dbip2-comm-to-free-switch-min-delta-months <MONTHS>]: 5919\end_layout 5920 5921\begin_layout Code 5922 5923 switch from COMM to FREE databases if possible and delta more than 5924 12 months (0=disabled) 5925\end_layout 5926 5927\begin_layout Code 5928 5929 [--disable-dbip ] : db-ip.com support disabled 5930\end_layout 5931 5932\begin_layout Code 5933 5934 [--db-dbip-disable ] : db-ip.com support disabled 5935\end_layout 5936 5937\begin_layout Code 5938 5939 [--db-dbip-dir <directory>] : db-ip.com database directory (default: 5940 /usr/share/DBIP) 5941\end_layout 5942 5943\begin_layout Code 5944 5945 [--db-dbip-only-type <TYPE>] : db-ip.com database only selected type 5946 (1-10) 5947\end_layout 5948 5949\begin_layout Code 5950 5951 [--db-dbip-comm-to-free-switch-min-delta-months <MONTHS>]: 5952\end_layout 5953 5954\begin_layout Code 5955 5956 switch from COMM to FREE databases if possible and delta more than 5957 12 months (0=disabled) 5958\end_layout 5959 5960\begin_layout Code 5961 5962 [--disable-external ] : External support disabled 5963\end_layout 5964 5965\begin_layout Code 5966 5967 [--db-external-disable ] : External support disabled 5968\end_layout 5969 5970\begin_layout Code 5971 5972 [--db-external-dir <directory>] : External database directory (default: 5973 /usr/share/ipv6calc/db) 5974\end_layout 5975 5976\begin_layout Code 5977 5978 [--disable-builtin ] : BuiltIn support disabled 5979\end_layout 5980 5981\begin_layout Code 5982 5983 [--db-builtin-disable ] : BuiltIn support disabled 5984\end_layout 5985 5986\begin_layout Code 5987 5988 [--db-priorization <entry1>[:...]] : Database priorization order list (overwrites 5989 default) 5990\end_layout 5991 5992\begin_layout Code 5993 5994 colon separated: GeoIP GeoIP2 IP2Locati 5995on DBIP DBIP2 External BuiltIn 5996\end_layout 5997 5998\begin_layout Code 5999 6000 [-w|--write] : write output to file instead of stdout 6001\end_layout 6002 6003\begin_layout Code 6004 6005 [-a|--append] : append output to file instead of stdout 6006\end_layout 6007 6008\begin_layout Code 6009 6010 [-f|--flush] : flush output after each line 6011\end_layout 6012 6013\begin_layout Code 6014 6015 [-V|--verbose] : be verbose 6016\end_layout 6017 6018\begin_layout Code 6019 6020 [-n|--nocache] : disable caching 6021\end_layout 6022 6023\begin_layout Code 6024 6025 [-c|--cachelimit <value>] : set cache limit 6026\end_layout 6027 6028\begin_layout Code 6029 6030 default: 20 6031\end_layout 6032 6033\begin_layout Code 6034 6035 maximum: 200 6036\end_layout 6037 6038\begin_layout Code 6039 6040 Shortcut for anonymization presets: 6041\end_layout 6042 6043\begin_layout Code 6044 6045 --anonymize-standard (default) 6046\end_layout 6047 6048\begin_layout Code 6049 6050 --anonymize-careful 6051\end_layout 6052 6053\begin_layout Code 6054 6055 --anonymize-paranoid 6056\end_layout 6057 6058\begin_layout Code 6059 6060 Supported methods [--anonymize-method METHOD]: 6061\end_layout 6062 6063\begin_layout Code 6064 6065 anonymize : reliable anonymization, keep as much type information as 6066 possible 6067\end_layout 6068 6069\begin_layout Code 6070 6071 zeroize : simple zeroizing according to given masks, probably loose 6072 type information 6073\end_layout 6074 6075\begin_layout Code 6076 6077 keep-type-asn-cc: special reliable anonymization, keep type & Autonomous 6078 System Number and CountryCode 6079\end_layout 6080 6081\begin_layout Code 6082 6083 keep-type-geonameid: special reliable anonymization, keep type & GeonameID 6084\end_layout 6085 6086\begin_layout Code 6087 6088 Available presets (shortcut names) [--anonymize-preset|ap PRESET-NAME]: 6089\end_layout 6090 6091\begin_layout Code 6092 6093 anonymize-standard (as): mask-ipv6= 56 mask-ipv4=24 mask-eui64=40 mask-mac= 609424 mask-autoadjust=yes method=anonymize 6095\end_layout 6096 6097\begin_layout Code 6098 6099 anonymize-careful (ac): mask-ipv6= 48 mask-ipv4=20 mask-eui64=24 mask-mac= 610024 mask-autoadjust=yes method=anonymize 6101\end_layout 6102 6103\begin_layout Code 6104 6105 anonymize-paranoid (ap): mask-ipv6= 40 mask-ipv4=16 mask-eui64= 0 mask-mac= 610624 mask-autoadjust=no method=anonymize 6107\end_layout 6108 6109\begin_layout Code 6110 6111 zeroize-standard (zs): mask-ipv6= 56 mask-ipv4=24 mask-eui64=40 mask-mac= 611224 mask-autoadjust=yes method=zeroize 6113\end_layout 6114 6115\begin_layout Code 6116 6117 zeroize-careful (zc): mask-ipv6= 48 mask-ipv4=20 mask-eui64=24 mask-mac= 611824 mask-autoadjust=yes method=zeroize 6119\end_layout 6120 6121\begin_layout Code 6122 6123 zeroize-paranoid (zp): mask-ipv6= 40 mask-ipv4=16 mask-eui64= 0 mask-mac= 612424 mask-autoadjust=no method=zeroize 6125\end_layout 6126 6127\begin_layout Code 6128 6129 keep-type-asn-cc (kp): mask-ipv6= 56 mask-ipv4=24 mask-eui64=40 mask-mac= 613024 mask-autoadjust=yes method=keep-type-asn-cc 6131\end_layout 6132 6133\begin_layout Code 6134 6135 keep-type-geonameid (kg): mask-ipv6= 56 mask-ipv4=24 mask-eui64=40 mask-mac= 613624 mask-autoadjust=yes method=keep-type-geonameid 6137\end_layout 6138 6139\begin_layout Code 6140 6141 Custom control: 6142\end_layout 6143 6144\begin_layout Code 6145 6146 --mask-ipv4 <bits> : mask IPv4 address [0-32] (even if occurs in 6147 IPv6 address) 6148\end_layout 6149 6150\begin_layout Code 6151 6152 --mask-ipv6 <bits> : mask IPv6 prefix [0-64] (only applied to related 6153 address types) 6154\end_layout 6155 6156\begin_layout Code 6157 6158 --mask-eui64 <bits> : mask EUI-64 address or IPv6 interface identifier 6159 [0-64] 6160\end_layout 6161 6162\begin_layout Code 6163 6164 --mask-mac <bits> : mask MAC address [0-48] 6165\end_layout 6166 6167\begin_layout Code 6168 6169 --mask-autoadjust yes|no: autoadjust mask to keep type/vendor information 6170 regardless of less given mask 6171\end_layout 6172 6173\begin_layout Code 6174 6175 Takes data from stdin, outputs the processed data to stdout (default) 6176\end_layout 6177 6178\begin_layout Subsection 6179Usage 6180\end_layout 6181 6182\begin_layout Subsubsection 6183Offline anonymization 6184\end_layout 6185 6186\begin_layout Code 6187 6188$ cat /path/to/http_log | ./ipv6loganon >/path/to/http_log_anonymized 6189\end_layout 6190 6191\begin_layout Subsubsection 6192On-the-fly online anonymization for Apache Webserver 6193\end_layout 6194 6195\begin_layout Quotation 6196Note: since 0.91.1 also an module for Apache Webserver is available (see below) 6197 supporting anonymized logging 6198\end_layout 6199 6200\begin_layout Standard 6201(Supported since 0.90.0) 6202\end_layout 6203 6204\begin_layout Standard 6205Adjust or add (note: more than one CustomLog directive is supported by Apache) 6206 httpd.conf like following: 6207\end_layout 6208 6209\begin_layout Code 6210 6211CustomLog "|/usr/local/bin/ipv6loganon -a -f /var/log/httpd/access_log" 6212 combined 6213\end_layout 6214 6215\begin_layout Standard 6216In case of 6217\begin_inset Quotes eld 6218\end_inset 6219 6220cronolog 6221\begin_inset Quotes erd 6222\end_inset 6223 6224 is used on the system, configure like this: 6225\end_layout 6226 6227\begin_layout Itemize 6228Apache version < 2.4: 6229\end_layout 6230 6231\begin_layout Code 6232 6233CustomLog "|/usr/bin/ipv6loganon -f |/usr/sbin/cronolog /var/log/httpd/access.log 6234-%Y%m%d" combined 6235\end_layout 6236 6237\begin_layout Itemize 6238Apache version >= 2.4: 6239\end_layout 6240 6241\begin_layout Code 6242 6243CustomLog "|$/usr/bin/ipv6loganon -f |/usr/sbin/cronolog /var/log/httpd/access.lo 6244g-%Y%m%d" combined 6245\end_layout 6246 6247\begin_layout Section 6248External database update helper scripts 6249\end_layout 6250 6251\begin_layout Standard 6252The 6253\begin_inset Quotes eld 6254\end_inset 6255 6256tools 6257\begin_inset Quotes erd 6258\end_inset 6259 6260 subdirectory contains helper scripts for updating external databases. 6261\end_layout 6262 6263\begin_layout Subsection 6264IP2Location 6265\end_layout 6266 6267\begin_layout Code 6268 6269$ /usr/share/ipv6calc/tools/IP2Location-update.sh -h 6270\end_layout 6271 6272\begin_layout Code 6273 6274Usage: IP2Location-update.sh [-D <dir>] [-n] [-s] 6275\end_layout 6276 6277\begin_layout Code 6278 6279 -D <dir> database destination directory (optional) 6280\end_layout 6281 6282\begin_layout Code 6283 6284 -n no action (dry-run) 6285\end_layout 6286 6287\begin_layout Code 6288 6289 -s skip already successfully downloaded files 6290\end_layout 6291 6292\begin_layout Code 6293 6294\end_layout 6295 6296\begin_layout Code 6297 6298 database directory: /usr/share/IP2Location (default: /usr/share/IP2Location) 6299\end_layout 6300 6301\begin_layout Code 6302 6303\end_layout 6304 6305\begin_layout Code 6306 6307 it honors externally defined environment value: IP2LOCATION_DAT_DIR 6308\end_layout 6309 6310\begin_layout Code 6311 6312\end_layout 6313 6314\begin_layout Code 6315 6316 this script will download data from ip2location.com 6317\end_layout 6318 6319\begin_layout Code 6320 6321 into given/set database directory 6322\end_layout 6323 6324\begin_layout Code 6325 6326\end_layout 6327 6328\begin_layout Code 6329 6330 Sample databases: 6331\end_layout 6332 6333\begin_layout Code 6334 6335 IP2LOCATION_DAT_FILES_SAMPLE=IPv4:20 IPv6:20 IPv4:24 IPv6:24 6336\end_layout 6337 6338\begin_layout Code 6339 6340\end_layout 6341 6342\begin_layout Code 6343 6344 Lite (free) databases: 6345\end_layout 6346 6347\begin_layout Code 6348 6349 IP2LOCATION_DAT_FILES_LITE_FREE=IPv4:1 IPv6:1 6350\end_layout 6351 6352\begin_layout Code 6353 6354 6355\end_layout 6356 6357\begin_layout Code 6358 6359 With authentication (requires login/password in /home/compile/.ip2location) 6360 and a valid subscription 6361\end_layout 6362 6363\begin_layout Code 6364 6365 IP2LOCATION_DAT_FILES_LITE= 6366\end_layout 6367 6368\begin_layout Code 6369 6370 6371\end_layout 6372 6373\begin_layout Code 6374 6375 Credentials must be defined in $HOME/.ip2location by 6376\end_layout 6377 6378\begin_layout Code 6379 6380 login=IP2LOCATION-LOGIN 6381\end_layout 6382 6383\begin_layout Code 6384 6385 password=IP2LOCATION-PASSWORD 6386\end_layout 6387 6388\begin_layout Code 6389 6390\end_layout 6391 6392\begin_layout Code 6393 6394 In addition settings from above can be overwritten by setting related variables 6395\end_layout 6396 6397\begin_layout Subsection 6398GeoIP 6399\end_layout 6400 6401\begin_layout Standard 6402Just note that old database format (version 1) is no longer supported for 6403 free download, ipv6calc >= 2.0.0 supports also MaxMindDB format, ipv6calc 6404 >= 3.0.0 drops legacy download capability 6405\end_layout 6406 6407\begin_layout Code 6408 6409$ /usr/share/ipv6calc/tools/GeoIP-update.sh -h 6410\end_layout 6411 6412\begin_layout Code 6413 6414Usage: GeoIP-update.sh [-D <dir>] [-v] [-s] [-L] [-G] 6415\end_layout 6416 6417\begin_layout Code 6418 6419 -s skip download 6420\end_layout 6421 6422\begin_layout Code 6423 6424 -D <dir> database directory (optional) 6425\end_layout 6426 6427\begin_layout Code 6428 6429 -v verbose 6430\end_layout 6431 6432\begin_layout Code 6433 6434 database directory: @GEOIP2_DB@ (default: @GEOIP2_DB@) 6435\end_layout 6436 6437\begin_layout Code 6438 6439 it honors externally defined environment value: 6440\end_layout 6441 6442\begin_layout Code 6443 6444 prio 1: GEOIP_DAT_DIR 6445\end_layout 6446 6447\begin_layout Code 6448 6449 prio 2: IPV6CALC_DB_GEOIP2_DIR 6450\end_layout 6451 6452\begin_layout Code 6453 6454 adjust /etc/GeoIP.conf in advance: 6455\end_layout 6456 6457\begin_layout Code 6458 6459 EditionIDs GeoLite2-Country GeoLite2-City GeoLite2-ASN 6460\end_layout 6461 6462\begin_layout Code 6463 6464 (in case a valid license key exists, add key and extend EditionIDs related) 6465\end_layout 6466 6467\begin_layout Code 6468 6469 see also https://dev.maxmind.com/geoip/geoipupdate/ 6470\end_layout 6471 6472\begin_layout Subsection 6473DB-IP.com 6474\end_layout 6475 6476\begin_layout Standard 6477Since ipv6calc >= 2.0.0 supports also MaxMindDB format, so download of CSV 6478 files and converting them into BerkeleyDB format is no longer required. 6479\end_layout 6480 6481\begin_layout Code 6482 6483$ /usr/share/ipv6calc/tools/DBIP-update.sh -h 6484\end_layout 6485 6486\begin_layout Code 6487 6488Usage: DBIP-update.sh [-v] [-s] [-D <dir>] [-U <url>] [-T <type>] 6489\end_layout 6490 6491\begin_layout Code 6492 6493 -s skip download 6494\end_layout 6495 6496\begin_layout Code 6497 6498 -v verbose 6499\end_layout 6500 6501\begin_layout Code 6502 6503 -D <dir> database directory (optional) 6504\end_layout 6505 6506\begin_layout Code 6507 6508 -U <url> use URL to download full database 6509\end_layout 6510 6511\begin_layout Code 6512 6513 -T <type> set type of via URL downloaded file 6514\end_layout 6515 6516\begin_layout Code 6517 6518 MMDB: country|isp|location|*location-isp* 6519\end_layout 6520 6521\begin_layout Code 6522 6523 CSV : isp|location|*full* 6524\end_layout 6525 6526\begin_layout Code 6527 6528 database directory: /usr/share/DBIP (default: /usr/share/DBIP) 6529\end_layout 6530 6531\begin_layout Code 6532 6533 it honors externally defined environment value: 6534\end_layout 6535 6536\begin_layout Code 6537 6538 prio 1: DBIP_DAT_DIR 6539\end_layout 6540 6541\begin_layout Code 6542 6543 prio 2: IPV6CALC_DB_DBIP2_DIR 6544\end_layout 6545 6546\begin_layout Code 6547 6548 this script will download data from 6549\end_layout 6550 6551\begin_layout Code 6552 6553 DB-IP.com (default: free versions) the MaxMindDB (mmdb) files DB files for 6554 ipv6calc 6555\end_layout 6556 6557\begin_layout Code 6558 6559 "DBIP" database support 6560\end_layout 6561 6562\begin_layout Code 6563 6564 DBIP_DAT_URL_BASE=http://download.db-ip.com/free/ 6565\end_layout 6566 6567\begin_layout Code 6568 6569 DBIP_DAT_FILES=dbip-country-lite-%Y-%m.mmdb.gz dbip-city-lite-%Y-%m.mmdb.gz 6570\end_layout 6571 6572\begin_layout Code 6573 6574 in case -U <url> (take URL from subscription e-mail) is provided, it downloads 6575 the database 6576\end_layout 6577 6578\begin_layout Code 6579 6580 use -T <type> in case it's not "location-isp" 6581\end_layout 6582 6583\begin_layout Subsection 6584External 6585\end_layout 6586 6587\begin_layout Code 6588 6589$ /usr/share/ipv6calc/tools/ipv6calc-db-update.sh -h 6590\end_layout 6591 6592\begin_layout Code 6593 6594Usage: ipv6calc-db-update.sh [-s] [-u] [-D <dir>] 6595\end_layout 6596 6597\begin_layout Code 6598 6599 -s skip download 6600\end_layout 6601 6602\begin_layout Code 6603 6604 -u unconditional update 6605\end_layout 6606 6607\begin_layout Code 6608 6609 -D <dir> database directory (optional) 6610\end_layout 6611 6612\begin_layout Code 6613 6614\end_layout 6615 6616\begin_layout Code 6617 6618 database directory: /usr/share/ipv6calc/db (default: /usr/share/ipv6calc/db) 6619\end_layout 6620 6621\begin_layout Code 6622 6623\end_layout 6624 6625\begin_layout Code 6626 6627 it honors externally defined environment value: IPV6CALC_DAT_DIR 6628\end_layout 6629 6630\begin_layout Code 6631 6632\end_layout 6633 6634\begin_layout Code 6635 6636 this script (and its helper scripts) will download data from 6637\end_layout 6638 6639\begin_layout Code 6640 6641 registries and generate Berkeley DB files for ipv6calc 6642\end_layout 6643 6644\begin_layout Code 6645 6646 "external" database support 6647\end_layout 6648 6649\begin_layout Section 6650Perl CGI wrapper program "ipv6calcweb.cgi" 6651\end_layout 6652 6653\begin_layout Standard 6654Because calling C programs directly as CGI isn't really recommended (too 6655 much security troubles all the time), I wrote a small wrapper utility which 6656 calls "ipv6calc" to get information about client and server address for 6657 displaying on a web page. 6658 6659\end_layout 6660 6661\begin_layout Subsection 6662Examples 6663\end_layout 6664 6665\begin_layout Standard 6666A demonstration about which kind of output is possible to produce is shown 6667 at 6668\end_layout 6669 6670\begin_layout Itemize 6671\begin_inset CommandInset href 6672LatexCommand href 6673name "http://ip.bieringer.de/" 6674target "http://ip.bieringer.de/" 6675literal "false" 6676 6677\end_inset 6678 6679 (IPv4/IPv6) 6680\end_layout 6681 6682\begin_layout Itemize 6683\begin_inset CommandInset href 6684LatexCommand href 6685name "http://www.ipv6.bieringer.de/" 6686target "http://www.ipv6.bieringer.de/" 6687literal "false" 6688 6689\end_inset 6690 6691 (IPv6 only) 6692\end_layout 6693 6694\begin_layout Itemize 6695\begin_inset CommandInset href 6696LatexCommand href 6697name "http://mirrors.bieringer.de/" 6698target "http://mirrors.bieringer.de/" 6699literal "false" 6700 6701\end_inset 6702 6703 (IPv4/IPv6) 6704\end_layout 6705 6706\begin_layout Itemize 6707\begin_inset CommandInset href 6708LatexCommand href 6709name "http://www.sixxs.net/tools/ipv6calc/" 6710target "http://www.sixxs.net/tools/ipv6calc/" 6711literal "false" 6712 6713\end_inset 6714 6715 (IPv4/IPv6) 6716\end_layout 6717 6718\begin_layout Section 6719Webserver log statistics helper program "ipv6logstats" 6720\end_layout 6721 6722\begin_layout Standard 6723This program parses a given webserver logfile and count addresses, useful 6724 for time period statistics. 6725\end_layout 6726 6727\begin_layout Standard 6728Since version 0.95.0 it has extended output, adding a date/time line and statistic 6729s by Country Code and ASN (if required databases are available). 6730\end_layout 6731 6732\begin_layout Subsection 6733Supported options 6734\end_layout 6735 6736\begin_layout Code 6737 6738$ ipv6logstats -h 6739\end_layout 6740 6741\begin_layout Code 6742 6743ipv6logstats: version 2.1.1 STAT_REG STAT_CC STAT_AS 6744\end_layout 6745 6746\begin_layout Code 6747 6748(P) & (C) 2003-2019 by Peter Bieringer <pb (at) bieringer.de> 6749\end_layout 6750 6751\begin_layout Code 6752 6753 Takes web server log data (or any other data which has IPv4/v6 address 6754 in first column) 6755\end_layout 6756 6757\begin_layout Code 6758 6759 from stdin and print statistics table/list (depending on option) to stdout 6760\end_layout 6761 6762\begin_layout Code 6763 6764 [-d|--debug <debug value>] : debug value (bitwise like) 6765\end_layout 6766 6767\begin_layout Code 6768 6769 can also be set by IPV6CALC_DEBUG environment 6770 value 6771\end_layout 6772 6773\begin_layout Code 6774 6775 [-v|--version [-v [-v]]] : version information (2 optional detail levels) 6776\end_layout 6777 6778\begin_layout Code 6779 6780 [-v|--version -h] : explanation of feature tokens 6781\end_layout 6782 6783\begin_layout Code 6784 6785 [-V|--verbose] : be more verbose 6786\end_layout 6787 6788\begin_layout Code 6789 6790 [-h|--help|-?] : this online help 6791\end_layout 6792 6793\begin_layout Code 6794 6795 [-q|--quiet] : be more quiet 6796\end_layout 6797 6798\begin_layout Code 6799 6800 [--disable-ip2location ] : IP2Location support disabled 6801\end_layout 6802 6803\begin_layout Code 6804 6805 [--db-ip2location-disable ] : IP2Location support disabled 6806\end_layout 6807 6808\begin_layout Code 6809 6810 [--db-ip2location-dir <directory>] : IP2Location database directory (default: 6811 /usr/share/IP2Location) 6812\end_layout 6813 6814\begin_layout Code 6815 6816 [--db-ip2location-lib <file> ] : IP2Location library file (default: 6817 libIP2Location.so) 6818\end_layout 6819 6820\begin_layout Code 6821 6822 [--db-ip2location-only-type <TYPE>]: IP2Location database only selected 6823 type (1-120) 6824\end_layout 6825 6826\begin_layout Code 6827 6828 [--db-ip2location-allow-softlinks] : IP2Location database softlinks allowed 6829\end_layout 6830 6831\begin_layout Code 6832 6833 by default they are ignored because it is hard to autodetect COMM/LITE/SAMP 6834LE 6835\end_layout 6836 6837\begin_layout Code 6838 6839 [--db-ip2location-lite-to-sample-autoswitch-max-delta-months <MONTHS>]: 6840\end_layout 6841 6842\begin_layout Code 6843 6844 autoswitch from LITE to SAMPLE databases if possible and delta is not 6845 more than 12 months (0=disabled) 6846\end_layout 6847 6848\begin_layout Code 6849 6850 [--db-ip2location-comm-to-lite-switch-min-delta-months <MONTHS>]: 6851\end_layout 6852 6853\begin_layout Code 6854 6855 switch from COMM to LITE databases if possible and delta more than 6856 12 months (0=disabled) 6857\end_layout 6858 6859\begin_layout Code 6860 6861 [--disable-geoip ] : GeoIP support disabled 6862\end_layout 6863 6864\begin_layout Code 6865 6866 [--db-geoip-disable ] : GeoIP support disabled 6867\end_layout 6868 6869\begin_layout Code 6870 6871 [--db-geoip-dir <directory>] : GeoIP database directory (default: 6872 /usr/share/GeoIP) 6873\end_layout 6874 6875\begin_layout Code 6876 6877 [--db-geoip-lib <file> ] : GeoIP library file (default: libGeoIP.so.1) 6878\end_layout 6879 6880\begin_layout Code 6881 6882 [--db-mmdb-lib <file> ] : MaxMindDB library file (default: 6883 libmaxminddb.so.0) 6884\end_layout 6885 6886\begin_layout Code 6887 6888 [--disable-geoip2 ] : GeoIP (MaxMindDB) support disabled 6889\end_layout 6890 6891\begin_layout Code 6892 6893 [--db-geoip2-disable ] : GeoIP (MaxMindDB) support disabled 6894\end_layout 6895 6896\begin_layout Code 6897 6898 [--db-geoip2-dir <directory>] : GeoIP (MaxMindDB) database directory 6899 (default: /usr/share/GeoIP) 6900\end_layout 6901 6902\begin_layout Code 6903 6904 [--disable-dbip2 ] : db-ip.com (MaxMindDB) support disabled 6905\end_layout 6906 6907\begin_layout Code 6908 6909 [--db-dbip2-disable ] : db-ip.com (MaxMindDB) support disabled 6910\end_layout 6911 6912\begin_layout Code 6913 6914 [--db-dbip2-dir <directory>] : db-ip.com (MaxMindDB) database directory 6915 (default: /usr/share/DBIP) 6916\end_layout 6917 6918\begin_layout Code 6919 6920 [--db-dbip2-only-type <TYPE>] : db-ip.com (MaxMindDB) database only 6921 selected type (1-10) 6922\end_layout 6923 6924\begin_layout Code 6925 6926 [--db-dbip2-comm-to-free-switch-min-delta-months <MONTHS>]: 6927\end_layout 6928 6929\begin_layout Code 6930 6931 switch from COMM to FREE databases if possible and delta more than 6932 12 months (0=disabled) 6933\end_layout 6934 6935\begin_layout Code 6936 6937 [--disable-dbip ] : db-ip.com support disabled 6938\end_layout 6939 6940\begin_layout Code 6941 6942 [--db-dbip-disable ] : db-ip.com support disabled 6943\end_layout 6944 6945\begin_layout Code 6946 6947 [--db-dbip-dir <directory>] : db-ip.com database directory (default: 6948 /usr/share/DBIP) 6949\end_layout 6950 6951\begin_layout Code 6952 6953 [--db-dbip-only-type <TYPE>] : db-ip.com database only selected type 6954 (1-10) 6955\end_layout 6956 6957\begin_layout Code 6958 6959 [--db-dbip-comm-to-free-switch-min-delta-months <MONTHS>]: 6960\end_layout 6961 6962\begin_layout Code 6963 6964 switch from COMM to FREE databases if possible and delta more than 6965 12 months (0=disabled) 6966\end_layout 6967 6968\begin_layout Code 6969 6970 [--disable-external ] : External support disabled 6971\end_layout 6972 6973\begin_layout Code 6974 6975 [--db-external-disable ] : External support disabled 6976\end_layout 6977 6978\begin_layout Code 6979 6980 [--db-external-dir <directory>] : External database directory (default: 6981 /usr/share/ipv6calc/db) 6982\end_layout 6983 6984\begin_layout Code 6985 6986 [--disable-builtin ] : BuiltIn support disabled 6987\end_layout 6988 6989\begin_layout Code 6990 6991 [--db-builtin-disable ] : BuiltIn support disabled 6992\end_layout 6993 6994\begin_layout Code 6995 6996 [--db-priorization <entry1>[:...]] : Database priorization order list (overwrites 6997 default) 6998\end_layout 6999 7000\begin_layout Code 7001 7002 colon separated: GeoIP GeoIP2 IP2Locati 7003on DBIP DBIP2 External BuiltIn 7004\end_layout 7005 7006\begin_layout Code 7007 7008 [-u|--unknown] : print unknown IP addresses to stderr 7009\end_layout 7010 7011\begin_layout Code 7012 7013 [-c|--columns] : print statistics in columns (1) 7014\end_layout 7015 7016\begin_layout Code 7017 7018 [-N|--column-numbers] : print column numbers 7019\end_layout 7020 7021\begin_layout Code 7022 7023 [-n|--noheader] : don't print header in columns mode (1) 7024\end_layout 7025 7026\begin_layout Code 7027 7028 [-o|--onlyheader] : print only header in columns mode (1) 7029\end_layout 7030 7031\begin_layout Code 7032 7033 [-p|--prefix <token>] : print token as prefix (1) 7034\end_layout 7035 7036\begin_layout Code 7037 7038 [-s|--simple] : disable extended statistic (CountryCode/ASN) 7039\end_layout 7040 7041\begin_layout Code 7042 7043 (1) unsupported for CountryCode & ASN statistics 7044\end_layout 7045 7046\begin_layout Subsection 7047Usage 7048\end_layout 7049 7050\begin_layout Standard 7051There are a README and some helper scripts available in the package how 7052 to use this program and how to generate a graph using Gnuplot. 7053\end_layout 7054 7055\begin_layout Subsubsection 7056Line-by-line output 7057\end_layout 7058 7059\begin_layout Standard 7060The example shows output version 3.0, which 7061\end_layout 7062 7063\begin_layout Code 7064 7065$ zcat ip.bieringer.de-log.201*.gz | ipv6logstats 7066\end_layout 7067 7068\begin_layout Standard 7069Header section, since output version 3.0 (>= 0.95.0) additional lines starting 7070 with '*3*' and '*DateTime' and '*UnixTime' included 7071\end_layout 7072 7073\begin_layout Code 7074 7075*Version 3.0 7076\end_layout 7077 7078\begin_layout Code 7079 7080*DateTime: 2013:11:03 08:57:01+0000 GMT 7081\end_layout 7082 7083\begin_layout Code 7084 7085*UnixTime: 1383469021 7086\end_layout 7087 7088\begin_layout Code 7089 7090*3*DB-Info: DB features: 0x0000133f 7091\end_layout 7092 7093\begin_layout Code 7094 7095*3*DB-Info: GeoIP: features: 0x00000330 7096\end_layout 7097 7098\begin_layout Code 7099 7100*3*DB-Info: GeoIP: info of available databases in directory: /usr/share/GeoIP 7101 (max: 31) 7102\end_layout 7103 7104\begin_layout Code 7105 7106*3*DB-Info: GeoIP: GeoIP Country Edition :[ 1] /usr/share/GeoIP/GeoIP. 7107dat (GEO-106FREE 20130903 Build 1 Copyright (c) 2013 MaxMind 7108 Inc All Rights Reserved) 7109\end_layout 7110 7111\begin_layout Code 7112 7113*3*DB-Info: GeoIP: GeoIP ASNum Edition :[ 9] /usr/share/GeoIP/GeoIP 7114ASNum.dat (GEO-117 20130902 Build 1 Copyright (c) 2013 MaxMind Inc 7115 All Rights Reserved) 7116\end_layout 7117 7118\begin_layout Code 7119 7120*3*DB-Info: GeoIP: GeoIP Country V6 Edition :[12] /usr/share/GeoIP/GeoIP 7121v6.dat (GEO-106FREE 20131001 Build 1 Copyright (c) 2013 MaxMind 7122 Inc All Rights Reserved) 7123\end_layout 7124 7125\begin_layout Code 7126 7127*3*DB-Info: GeoIP: GeoIP Large Country Edition :[17] /usr/share/GeoIP/GeoIP. 7128dat (GEO-106FREE 20130903 Build 1 Copyright (c) 2013 MaxMind 7129 Inc All Rights Reserved) 7130\end_layout 7131 7132\begin_layout Code 7133 7134*3*DB-Info: GeoIP: GeoIP Large Country V6 Edition :[18] /usr/share/GeoIP/GeoIP 7135v6.dat (GEO-106FREE 20131001 Build 1 Copyright (c) 2013 MaxMind 7136 Inc All Rights Reserved) 7137\end_layout 7138 7139\begin_layout Code 7140 7141*3*DB-Info: GeoIP: GeoIP ASNum V6 Edition :[21] /usr/share/GeoIP/GeoIP 7142ASNumv6.dat (GEO-117 20130306 Build 1 Copyright (c) 2013 MaxMind Inc 7143 All Rights Reserved) 7144\end_layout 7145 7146\begin_layout Code 7147 7148*3*DB-Info: IP2Location: features: 0x00000300 7149\end_layout 7150 7151\begin_layout Code 7152 7153*3*DB-Info: IP2Location: info of available databases in directory: /usr/share/IP 71542Location 7155\end_layout 7156 7157\begin_layout Code 7158 7159*3*DB-Info: IP2Location: IPv4 Country : /usr/share/IP2Location/IP- 7160COUNTRY.BIN (IP2L-DB20 20130411 Copyright (c) 2013 IP2Location All Rights 7161 Reserved) 7162\end_layout 7163 7164\begin_layout Code 7165 7166*3*DB-Info: IP2Location: IPv6 Country : /usr/share/IP2Location/IPV 71676-COUNTRY.BIN (IP2L-DB1 20131025 Copyright (c) 2013 IP2Location All Rights 7168 Reserved) 7169\end_layout 7170 7171\begin_layout Code 7172 7173*3*DB-Info: BuiltIn: features: 0x0000100f 7174\end_layout 7175 7176\begin_layout Code 7177 7178*3*DB-Info: BuiltIn: info of available databases 7179\end_layout 7180 7181\begin_layout Code 7182 7183*3*DB-Info: BuiltIn: ASN : IANA/20130730 7184\end_layout 7185 7186\begin_layout Code 7187 7188*3*DB-Info: BuiltIn: CC : AFRINIC/20130806 APNIC/20130805 ARIN/20130805 7189 LACNIC/20130805 RIPENCC/20130805 7190\end_layout 7191 7192\begin_layout Code 7193 7194*3*DB-Info: BuiltIn: IPv4 : AFRINIC/20131014 APNIC/20131014 ARIN/20131014 7195 IANA/20130520 LACNIC/20131014 RIPENCC/20131014 7196\end_layout 7197 7198\begin_layout Code 7199 7200*3*DB-Info: BuiltIn: IPv6 : AFRINIC/20131015 APNIC/20131014 ARIN/20131014 7201 IANA/20130215 LACNIC/20131014 RIPENCC/20131014 7202\end_layout 7203 7204\begin_layout Code 7205 7206*3*DB-Info: BuiltIn: IEEE : IAB/20131015 OUI/20131015 OUI36/20131015 7207\end_layout 7208 7209\begin_layout Standard 7210Simple statistics section 7211\end_layout 7212 7213\begin_layout Code 7214 7215ALL 108525 7216\end_layout 7217 7218\begin_layout Code 7219 7220IPv4 46233 7221\end_layout 7222 7223\begin_layout Code 7224 7225IPv6 62292 7226\end_layout 7227 7228\begin_layout Code 7229 7230UNKNOWN 0 7231\end_layout 7232 7233\begin_layout Code 7234 7235IPv4/APNIC 2397 7236\end_layout 7237 7238\begin_layout Code 7239 7240IPv4/ARIN 3525 7241\end_layout 7242 7243\begin_layout Code 7244 7245IPv4/RIPE 40198 7246\end_layout 7247 7248\begin_layout Code 7249 7250IPv4/LACNIC 97 7251\end_layout 7252 7253\begin_layout Code 7254 7255IPv4/UNKNOWN 16 7256\end_layout 7257 7258\begin_layout Code 7259 7260IPv6/6bone 0 7261\end_layout 7262 7263\begin_layout Code 7264 7265IPv6/IANA 0 7266\end_layout 7267 7268\begin_layout Code 7269 7270IPv6/APNIC 129 7271\end_layout 7272 7273\begin_layout Code 7274 7275IPv6/ARIN 839 7276\end_layout 7277 7278\begin_layout Code 7279 7280IPv6/RIPE 61074 7281\end_layout 7282 7283\begin_layout Code 7284 7285IPv6/LACNIC 0 7286\end_layout 7287 7288\begin_layout Code 7289 7290IPv6/RESERVED 0 7291\end_layout 7292 7293\begin_layout Code 7294 7295IPv6/UNKNOWN 0 7296\end_layout 7297 7298\begin_layout Code 7299 7300IPv6/6to4/IANA 0 7301\end_layout 7302 7303\begin_layout Code 7304 7305IPv6/6to4/APNIC 0 7306\end_layout 7307 7308\begin_layout Code 7309 7310IPv6/6to4/ARIN 16 7311\end_layout 7312 7313\begin_layout Code 7314 7315IPv6/6to4/RIPE 51 7316\end_layout 7317 7318\begin_layout Code 7319 7320IPv6/6to4/LACNIC 0 7321\end_layout 7322 7323\begin_layout Code 7324 7325IPv6/6to4/RESERVED 0 7326\end_layout 7327 7328\begin_layout Code 7329 7330IPv6/6to4/UNKNOWN 0 7331\end_layout 7332 7333\begin_layout Code 7334 7335IPv6/Teredo/IANA 0 7336\end_layout 7337 7338\begin_layout Code 7339 7340IPv6/Teredo/APNIC 63 7341\end_layout 7342 7343\begin_layout Code 7344 7345IPv6/Teredo/ARIN 0 7346\end_layout 7347 7348\begin_layout Code 7349 7350IPv6/Teredo/RIPE 90 7351\end_layout 7352 7353\begin_layout Code 7354 7355IPv6/Teredo/LACNIC 30 7356\end_layout 7357 7358\begin_layout Code 7359 7360IPv6/Teredo/RESERVED 0 7361\end_layout 7362 7363\begin_layout Code 7364 7365IPv6/Teredo/UNKNOWN 0 7366\end_layout 7367 7368\begin_layout Code 7369 7370IPv6/NAT64/IANA 0 7371\end_layout 7372 7373\begin_layout Code 7374 7375IPv6/NAT64/APNIC 0 7376\end_layout 7377 7378\begin_layout Code 7379 7380IPv6/NAT64/ARIN 0 7381\end_layout 7382 7383\begin_layout Code 7384 7385IPv6/NAT64/RIPE 0 7386\end_layout 7387 7388\begin_layout Code 7389 7390IPv6/NAT64/LACNIC 0 7391\end_layout 7392 7393\begin_layout Code 7394 7395IPv6/NAT64/RESERVED 0 7396\end_layout 7397 7398\begin_layout Code 7399 7400IPv6/NAT64/UNKNOWN 0 7401\end_layout 7402 7403\begin_layout Code 7404 7405IPv6/IID/Global 1436 7406\end_layout 7407 7408\begin_layout Code 7409 7410IPv6/IID/Random 58198 7411\end_layout 7412 7413\begin_layout Code 7414 7415IPv6/IID/Manual 2055 7416\end_layout 7417 7418\begin_layout Code 7419 7420IPv6/IID/ISATAP 353 7421\end_layout 7422 7423\begin_layout Code 7424 7425IPv6/IID/Unknown 0 7426\end_layout 7427 7428\begin_layout Standard 7429External database supported output since output version 3.0 (>= 0.95.0) 7430\end_layout 7431 7432\begin_layout Itemize 7433Country Code / Proto 7434\end_layout 7435 7436\begin_layout Code 7437 7438... 7439\end_layout 7440 7441\begin_layout Code 7442 7443*3*CC-code-proto/DE/ALL 96450 7444\end_layout 7445 7446\begin_layout Code 7447 7448*3*CC-code-proto/DE/IPv4 36486 7449\end_layout 7450 7451\begin_layout Code 7452 7453*3*CC-code-proto/DE/IPv6 59964 7454\end_layout 7455 7456\begin_layout Code 7457 7458*3*CC-code-proto-list/DE 96450 36486 59964 7459\end_layout 7460 7461\begin_layout Code 7462 7463... 7464\end_layout 7465 7466\begin_layout Itemize 7467Proto / Country Code ( 7468\begin_inset Quotes eld 7469\end_inset 7470 7471ALL 7472\begin_inset Quotes erd 7473\end_inset 7474 7475 line contains: ALL IPv4 IPv6) 7476\end_layout 7477 7478\begin_layout Code 7479 7480... 7481\end_layout 7482 7483\begin_layout Code 7484 7485*3*CC-proto-code/ALL/DE 96450 7486\end_layout 7487 7488\begin_layout Code 7489 7490*3*CC-proto-code/IPv4/DE 36486 7491\end_layout 7492 7493\begin_layout Code 7494 7495*3*CC-proto-code/IPv6/DE 59964 7496\end_layout 7497 7498\begin_layout Code 7499 7500... 7501\end_layout 7502 7503\begin_layout Code 7504 7505*3*CC-proto-code-list/ALL 108525 46483 62042 7506\end_layout 7507 7508\begin_layout Itemize 7509Autonomous System number / Proto 7510\end_layout 7511 7512\begin_layout Code 7513 7514... 7515\end_layout 7516 7517\begin_layout Code 7518 7519*3*AS-num-proto/8767/ALL 6054 7520\end_layout 7521 7522\begin_layout Code 7523 7524*3*AS-num-proto/8767/IPv4 2705 7525\end_layout 7526 7527\begin_layout Code 7528 7529*3*AS-num-proto/8767/IPv6 3349 7530\end_layout 7531 7532\begin_layout Code 7533 7534*3*AS-num-proto-list/8767 6054 2705 3349 7535\end_layout 7536 7537\begin_layout Code 7538 7539... 7540\end_layout 7541 7542\begin_layout Itemize 7543Proto / Autonomous System number ( 7544\begin_inset Quotes eld 7545\end_inset 7546 7547ALL 7548\begin_inset Quotes erd 7549\end_inset 7550 7551 line contains: ALL IPv4 IPv6) 7552\end_layout 7553 7554\begin_layout Code 7555 7556... 7557\end_layout 7558 7559\begin_layout Code 7560 7561*3*AS-proto-num/ALL/8767 6054 7562\end_layout 7563 7564\begin_layout Code 7565 7566*3*AS-proto-num/IPv4/8767 2705 7567\end_layout 7568 7569\begin_layout Code 7570 7571*3*AS-proto-num/IPv6/8767 3349 7572\end_layout 7573 7574\begin_layout Code 7575 7576... 7577\end_layout 7578 7579\begin_layout Code 7580 7581*3*AS-proto-num-list/ALL 108525 46483 62042 7582\end_layout 7583 7584\begin_layout Subsubsection 7585Column output 7586\end_layout 7587 7588\begin_layout Standard 7589Column output does not support version 3 extension, only simple statistics 7590 with a header line: 7591\end_layout 7592 7593\begin_layout Code 7594 7595$ zcat ip.bieringer.de-log.201*.gz | ipv6logstats -q -c 7596\end_layout 7597 7598\begin_layout Code 7599 7600 IPv4 IPv6 UNKNOWN IPv4/APNIC IPv4/ARIN IPv4/RIPE IPv4/LACNIC IPv4/UNKNOWN 7601 IPv6/6bone IPv6/IANA IPv6/APNIC IPv6/ARIN IPv6/RIPE IPv6/LACNIC IPv6/RESERVED 7602 IPv6/UNKNOWN IPv6/6to4/IANA IPv6/6to4/APNIC IPv6/6to4/ARIN IPv6/6to4/RIPE 7603 IPv6/6to4/LACNIC IPv6/6to4/RESERVED IPv6/6to4/UNKNOWN IPv6/Teredo/IANA 7604 IPv6/Teredo/APNIC IPv6/Teredo/ARIN IPv6/Teredo/RIPE IPv6/Teredo/LACNIC 7605 IPv6/Teredo/RESERVED IPv6/Teredo/UNKNOWN IPv6/NAT64/IANA IPv6/NAT64/APNIC 7606 IPv6/NAT64/ARIN IPv6/NAT64/RIPE IPv6/NAT64/LACNIC IPv6/NAT64/RESERVED IPv6/NAT6 76074/UNKNOWN IPv6/IID/Global IPv6/IID/Random IPv6/IID/Manual IPv6/IID/ISATAP 7608 IPv6/IID/Unknown 7609\end_layout 7610 7611\begin_layout Code 7612 7613 46233 62292 0 2397 3525 40198 97 16 0 0 129 839 61074 0 0 0 0 0 16 51 0 7614 0 0 0 63 0 90 30 0 0 0 0 0 0 0 0 0 1436 58198 2055 353 0 7615\end_layout 7616 7617\begin_layout Standard 7618An optional prefix token can be given ( 7619\begin_inset Quotes eld 7620\end_inset 7621 7622-p <prefix> 7623\begin_inset Quotes erd 7624\end_inset 7625 7626) to create e.g. 7627 in a for-loop one line per month and put month in front of statistics, 7628 also the header line can be suppressed ( 7629\begin_inset Quotes eld 7630\end_inset 7631 7632-n 7633\begin_inset Quotes erd 7634\end_inset 7635 7636). 7637\end_layout 7638 7639\begin_layout Code 7640 7641$ zcat ip.bieringer.de-log.201*.gz | ipv6logstats -q -c -n -p ALL 7642\end_layout 7643 7644\begin_layout Code 7645 7646ALL 46233 62292 0 2397 3525 40198 97 16 0 0 129 839 61074 0 0 0 0 0 16 7647 51 0 0 0 0 63 0 90 30 0 0 0 0 0 0 0 0 0 1436 58198 2055 353 0 7648\end_layout 7649 7650\begin_layout Subsection 7651Examples 7652\end_layout 7653 7654\begin_layout Standard 7655A demonstration with real data is available at 7656\begin_inset CommandInset href 7657LatexCommand href 7658name "http://mirrors.bieringer.de/stats/timeline.html" 7659target "http://mirrors.bieringer.de/stats/timeline.html" 7660literal "false" 7661 7662\end_inset 7663 7664. 7665\end_layout 7666 7667\begin_layout Section 7668Apache web server module 7669\begin_inset Quotes eld 7670\end_inset 7671 7672mod_ipv6calc 7673\begin_inset Quotes erd 7674\end_inset 7675 7676 7677\end_layout 7678 7679\begin_layout Standard 7680This Apache web server module (since version 0.99.1, released 2015) interfaces 7681 with internal ipv6calc library to support 7682\end_layout 7683 7684\begin_layout Itemize 7685Client IP address anonymization 7686\begin_inset Quotes eld 7687\end_inset 7688 7689on-the-fly 7690\begin_inset Quotes erd 7691\end_inset 7692 7693, exported to IPV6CALC_CLIENT_IP_ANON 7694\begin_inset Separator latexpar 7695\end_inset 7696 7697 7698\end_layout 7699 7700\begin_deeper 7701\begin_layout Itemize 7702depending on the configured anonymization method 3rd party database is required 7703\end_layout 7704 7705\end_deeper 7706\begin_layout Itemize 7707Country code of client IP address, exported to IPV6CALC_CLIENT_COUNTRYCODE 7708\begin_inset Separator latexpar 7709\end_inset 7710 7711 7712\end_layout 7713 7714\begin_deeper 7715\begin_layout Itemize 7716requires 3rd party database: GeoIP or IP2Location or DB-IP.com 7717\end_layout 7718 7719\end_deeper 7720\begin_layout Itemize 7721Autonomous System Number (ASN) of client IP address, exported to IPV6CALC_CLIENT 7722_ASN 7723\begin_inset Separator latexpar 7724\end_inset 7725 7726 7727\end_layout 7728 7729\begin_deeper 7730\begin_layout Itemize 7731requires 3rd party database: GeoIP 7732\end_layout 7733 7734\end_deeper 7735\begin_layout Itemize 7736Registry of client IP address, exported to IPV6CALC_CLIENT_REGISTRY 7737\begin_inset Separator latexpar 7738\end_inset 7739 7740 7741\end_layout 7742 7743\begin_deeper 7744\begin_layout Itemize 7745requires internal or 7746\begin_inset Quotes eld 7747\end_inset 7748 7749external 7750\begin_inset Quotes erd 7751\end_inset 7752 7753 database 7754\end_layout 7755 7756\end_deeper 7757\begin_layout Itemize 7758Configured IP address anonymization method, exported to IPV6CALC_ANON_METHOD 7759\end_layout 7760 7761\begin_layout Subsection 7762Installation 7763\end_layout 7764 7765\begin_layout Standard 7766Install compiled Apache module 7767\begin_inset Quotes eld 7768\end_inset 7769 7770mod_ipv6calc 7771\begin_inset Quotes erd 7772\end_inset 7773 7774 to Apache's module directory 7775\end_layout 7776 7777\begin_layout Standard 7778Install included default configuration file 7779\begin_inset Quotes eld 7780\end_inset 7781 7782ipv6calc.conf 7783\begin_inset Quotes erd 7784\end_inset 7785 7786 to Apache's config directory (usually conf.d) 7787\end_layout 7788 7789\begin_layout Subsection 7790Configuration 7791\end_layout 7792 7793\begin_layout Standard 7794Enable in 7795\begin_inset Quotes eld 7796\end_inset 7797 7798ipv6calc.conf 7799\begin_inset Quotes erd 7800\end_inset 7801 7802 loading of module 7803\end_layout 7804 7805\begin_layout Code 7806 7807LoadModule ipv6calc_module modules/mod_ipv6calc.so 7808\end_layout 7809 7810\begin_layout Standard 7811Enable module itself 7812\end_layout 7813 7814\begin_layout Code 7815 7816ipv6calcEnable on 7817\end_layout 7818 7819\begin_layout Standard 7820Adjust configuration settings, if needed (see examples in 7821\begin_inset Quotes eld 7822\end_inset 7823 7824ipv6calc.conf 7825\begin_inset Quotes erd 7826\end_inset 7827 7828) 7829\end_layout 7830 7831\begin_layout Standard 7832Review predefined log format 7833\end_layout 7834 7835\begin_layout Code 7836 7837LogFormat "%{IPV6CALC_CLIENT_IP_ANON}e 7838\backslash 7839"%{IPV6CALC_CLIENT_COUNTRYCODE}e/%{IPV6CALC_CLIENT_ASN}e/%{IPV6CALC_CLIENT_REGIS 7840TRY}e/%{IPV6CALC_ANON_METHOD}e 7841\backslash 7842" %u %t 7843\backslash 7844"%r 7845\backslash 7846" %>s %b 7847\backslash 7848"%{Referer}i 7849\backslash 7850" 7851\backslash 7852"%{User-Agent}i 7853\backslash 7854"" combined_anon 7855\end_layout 7856 7857\begin_layout Standard 7858Enable custom log with anonymized information, using the predefined LogFormat 7859\end_layout 7860 7861\begin_layout Code 7862 7863CustomLog logs/access_anon_log combined_anon 7864\end_layout 7865 7866\begin_layout Standard 7867Restart Apache web server, check error_log for any issues 7868\end_layout 7869 7870\begin_layout Subsection 7871Result 7872\end_layout 7873 7874\begin_layout Standard 7875The new log file contains anonymized requests like 7876\end_layout 7877 7878\begin_layout Code 7879 7880252.176.92.172 "CN/23724/APNIC/keep-type-asn-cc" - [25/Jul/2015:13:20:25 +0200] 7881 "GET / HTTP/1.1" 200 3569 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://w 7882ww.baidu.com/search/spider.html)" 7883\end_layout 7884 7885\begin_layout Code 7886 7887\end_layout 7888 7889\begin_layout Code 7890 7891a909:390a:909a:81d9:a909:4291:c02d:5d1d "CZ/43037/RIPENCC/keep-type-asn-cc" 7892 - [25/Jul/2015:12:59:00 +0200] "GET /robots.txt HTTP/1.1" 200 33 "-" "Mozilla/5.0 7893 (compatible; SeznamBot/3.2; +http://fulltext.sblog.cz/)" 7894\end_layout 7895 7896\begin_layout Subsection 7897Post-analysis in case of anonymization method 7898\begin_inset Quotes eld 7899\end_inset 7900 7901keep-type-asn-cc 7902\begin_inset Quotes erd 7903\end_inset 7904 7905 7906\end_layout 7907 7908\begin_layout Standard 7909In case 7910\begin_inset Quotes eld 7911\end_inset 7912 7913keep-type-asn-cc 7914\begin_inset Quotes erd 7915\end_inset 7916 7917 is configured and also working (required databases are available), related 7918 information of anonymized IP addresses can be retrieved using 7919\begin_inset Quotes eld 7920\end_inset 7921 7922ipv6calc 7923\begin_inset Quotes erd 7924\end_inset 7925 7926 or 7927\begin_inset Quotes eld 7928\end_inset 7929 7930ipv6logstats 7931\begin_inset Quotes erd 7932\end_inset 7933 7934. 7935\end_layout 7936 7937\begin_layout Code 7938 7939$ ipv6calc -q -m -i 252.176.92.172 7940\end_layout 7941 7942\begin_layout Code 7943 7944IPV4=252.176.92.172 7945\end_layout 7946 7947\begin_layout Code 7948 7949IPV4_TYPE=unicast,anonymized,global 7950\end_layout 7951 7952\begin_layout Code 7953 7954IPV4_AS_NUM=23724 7955\end_layout 7956 7957\begin_layout Code 7958 7959IPV4_COUNTRYCODE=CN 7960\end_layout 7961 7962\begin_layout Code 7963 7964IPV4_REGISTRY=APNIC 7965\end_layout 7966 7967\begin_layout Code 7968 7969... 7970\end_layout 7971 7972\begin_layout Code 7973 7974\end_layout 7975 7976\begin_layout Code 7977 7978$ ipv6calc -q -m -i a909:390a:909a:81d9:a909:4291:c02d:5d1d 7979\end_layout 7980 7981\begin_layout Code 7982 7983IPV6=a909:390a:909a:81d9:a909:4291:c02d:5d1d 7984\end_layout 7985 7986\begin_layout Code 7987 7988IPV6_TYPE=unicast,anonymized-iid,anonymized-prefix,global-unicast,productive,iid 7989,iid-local 7990\end_layout 7991 7992\begin_layout Code 7993 7994IPV6_COUNTRYCODE=CZ 7995\end_layout 7996 7997\begin_layout Code 7998 7999IPV6_AS_NUM=43037 8000\end_layout 8001 8002\begin_layout Code 8003 8004IPV6_REGISTRY=RIPENCC 8005\end_layout 8006 8007\begin_layout Code 8008 8009... 8010\end_layout 8011 8012\begin_layout Section 8013History 8014\end_layout 8015 8016\begin_layout Standard 8017Major extensions/changes are listed here 8018\end_layout 8019 8020\begin_layout Subsection 80212021 8022\end_layout 8023 8024\begin_layout Itemize 8025add support for compressed IPv4 addresses like 10/8 (>= 3.1.0) 8026\end_layout 8027 8028\begin_layout Subsection 80292020 8030\end_layout 8031 8032\begin_layout Itemize 8033drop GeoIP(legacy) support (>= 3.0.0) 8034\end_layout 8035 8036\begin_layout Itemize 8037drop db-ip.com(BerkeleyDB) support (>= 3.0.0) 8038\end_layout 8039 8040\begin_layout Subsection 80412019 8042\end_layout 8043 8044\begin_layout Itemize 8045add OUI-28 support (>= 2.2.0) 8046\end_layout 8047 8048\begin_layout Itemize 8049add action 8050\begin_inset Quotes eld 8051\end_inset 8052 8053addr2cc 8054\begin_inset Quotes erd 8055\end_inset 8056 8057 (can be used as replacement for geoiplookup) (>= 2.1.0) 8058\end_layout 8059 8060\begin_layout Itemize 8061enable 8062\begin_inset Quotes eld 8063\end_inset 8064 8065geonameid 8066\begin_inset Quotes erd 8067\end_inset 8068 8069 also in mod_ipv6calc (>= 2.1.0) 8070\end_layout 8071 8072\begin_layout Itemize 8073add anonymization method 8074\begin_inset Quotes eld 8075\end_inset 8076 8077keep-type-geonameid 8078\begin_inset Quotes erd 8079\end_inset 8080 8081 (>= 2.1.0) 8082\end_layout 8083 8084\begin_layout Itemize 8085add support for MaxMindDB (GeoIP, db-ip.com) (>= 2.0.0) 8086\end_layout 8087 8088\begin_layout Itemize 8089drop support of IP2Location libraries < 7.0.1 (>= 2.0.0) 8090\end_layout 8091 8092\begin_layout Subsection 80932017 8094\end_layout 8095 8096\begin_layout Itemize 8097add support for LISP detection 8098\end_layout 8099 8100\begin_layout Itemize 8101add support for non-free versions 8102\begin_inset CommandInset href 8103LatexCommand href 8104name "DB-IP.com" 8105target "http://www.db-ip.com/" 8106literal "false" 8107 8108\end_inset 8109 8110 databases 8111\end_layout 8112 8113\begin_layout Itemize 8114finally release 1.0.0 after 16 year of development 8115\end_layout 8116 8117\begin_layout Subsection 81182016 8119\end_layout 8120 8121\begin_layout Itemize 8122implement action 'test' and extend action 'filter' with support of address 8123 ranges (>= 0.99.2) 8124\end_layout 8125 8126\begin_layout Subsection 81272015 8128\end_layout 8129 8130\begin_layout Itemize 8131Introduce mod_ipv6calc for Apache web server (>= 0.99.1) 8132\end_layout 8133 8134\begin_layout Itemize 8135Add support for 8136\begin_inset CommandInset href 8137LatexCommand href 8138name "DB-IP.com" 8139target "http://www.db-ip.com/" 8140literal "false" 8141 8142\end_inset 8143 8144 databases (by generated Berkeley DB files) (>= 0.98.0) 8145\end_layout 8146 8147\begin_layout Itemize 8148Add support for 8149\begin_inset Quotes eld 8150\end_inset 8151 8152External 8153\begin_inset Quotes erd 8154\end_inset 8155 8156 database files (generated Berkeley DB files), superseeding (if newer) built-in 8157 IPv4/IPv6->Registry and adding IPv4/IPv6->CountryCode support (>= 0.98.0) 8158\end_layout 8159 8160\begin_layout Itemize 8161Extend filter options with support of CountryCode, ASN or Registry (>= 0.99.0) 8162\end_layout 8163 8164\begin_layout Itemize 8165Add support for 8166\begin_inset CommandInset href 8167LatexCommand href 8168name "IP2Location LITE" 8169target "http://lite.ip2location.com/" 8170literal "false" 8171 8172\end_inset 8173 8174 databases (>= 0.99.0), add configurable IP2Location database autoselection 8175 support 8176\end_layout 8177 8178\begin_layout Subsection 81792014 8180\end_layout 8181 8182\begin_layout Itemize 8183Shared library mode supported (reduces size of binaries) 8184\end_layout 8185 8186\begin_layout Subsection 81872013 8188\end_layout 8189 8190\begin_layout Itemize 8191Prefix and IID anonymization methods 8192\end_layout 8193 8194\begin_layout Itemize 8195Support of dynamic load of GeoIP and IP2Location libraries 8196\end_layout 8197 8198\begin_layout Itemize 8199Specifying dedicated GeoIP and IP2Location database files is now replaced 8200 by specifying dedicated database directories to make especially for GeoIP 8201 use of more database files. 8202\end_layout 8203 8204\begin_layout Subsection 82052011 8206\end_layout 8207 8208\begin_layout Itemize 8209ipv6calc/ipv6calcweb.cgi: enable included GeoIP support with IPv6 (usable 8210 with GeoIP >= 1.4.5) 8211\end_layout 8212 8213\begin_layout Itemize 8214ipv6calc: extend for 6rd support (--action 6rd_local_prefix --6rd_prefix 8215 <PREFIX> --6rd_relay_prefix <RELAY_PREFIX>) 8216\end_layout 8217 8218\begin_layout Itemize 8219ipv6calc: enable stdin support for bulk transformation 8220\end_layout 8221 8222\begin_layout Itemize 8223ipv6calc: add support for NAT64 address type 8224\end_layout 8225 8226\begin_layout Itemize 8227ipv6calc: add option 8228\begin_inset Quotes eld 8229\end_inset 8230 8231forceprefix <LENGTH> 8232\begin_inset Quotes erd 8233\end_inset 8234 8235 to print prefix of an address without a given prefix length 8236\end_layout 8237 8238\begin_layout Itemize 8239ipv6loganon: extend for pipe usage (e.g. 8240 in Apache log file directive) and write/append to specified file 8241\end_layout 8242 8243\begin_layout Itemize 8244General: add configure options to disable built-in databases (reduce binary 8245 size a lot, e.g. 8246 for embedded devices) 8247\end_layout 8248 8249\begin_layout Subsection 82502002-2010 8251\end_layout 8252 8253\begin_layout Standard 8254See 8255\begin_inset CommandInset href 8256LatexCommand href 8257name "ChangeLog@GitHub" 8258target "https://raw.githubusercontent.com/pbiering/ipv6calc/master/ChangeLog" 8259literal "false" 8260 8261\end_inset 8262 8263 for now 8264\end_layout 8265 8266\begin_layout Subsection 82672001 8268\end_layout 8269 8270\begin_layout Itemize 8271Start of development 8272\end_layout 8273 8274\end_body 8275\end_document 8276