ip

ip interprets IPv4 and IPv6 addresses, classifies their scope, converts numeric forms and calculates CIDR network boundaries entirely in PHP.

NetworkVersion 1.2.2Stable
lil-terminal

Overview

Use ip when you need deterministic address math rather than a remote network request: convert IPv4 forms, expand IPv6, inspect private or loopback scope, or calculate the network and range represented by a prefix.

An address and a CIDR network answer different questions

Without a prefix, ip describes one address. With /prefix, it calculates the network boundaries and range. ip me and ip server are different again: they read addresses from the current HTTP request and hosting environment.

Syntax

lil-terminal
ip <address|integer|hex|me|server>[/prefix]

Reference

ip 192.168.1.1

inspect an IPv4 address, numeric forms and scope

ip 3232235777

convert an unsigned integer to IPv4 and inspect it

ip 0xC0A80101

convert hexadecimal to IPv4 and inspect it

ip 192.168.1.10/24

show IPv4 network, mask, wildcard, broadcast and range

ip 2001:db8::1

show compressed and expanded IPv6 forms and scope

ip 2001:db8::1/64

show the IPv6 network, last address and range

ip me

inspect the current visitor address

ip server

inspect the current server address

Practical workflow

Enter an IPv4 or IPv6 address to inspect its family and scope. For IPv4, you can also enter the unsigned decimal integer or 0x hexadecimal form. Add /prefix to obtain network address, range and address count; IPv4 also shows mask, wildcard and broadcast, while IPv6 shows last address. ip me reads the HTTP visitor address seen by PHP, and ip server uses the server address reported by PHP.

Limits and safety

CIDR output is arithmetic, not a scan of active hosts: the count includes reserved endpoints and does not tell you which addresses are assigned or accessible. Proxy servers may affect me; shared hosting may expose an internal or missing server address. Invalid inputs and out-of-range prefixes are rejected. The prepared examples contain only documentation addresses or deterministic local values.

Deterministic forms

The same IPv4 address can be entered as dotted decimal, an unsigned integer or hexadecimal. CIDR input adds the calculated network boundaries. IPv6 output includes compressed, expanded and hexadecimal forms; a prefix additionally shows the network, last address, full range and address count. me and server depend on the current HTTP request and hosting environment.

Interactive sandbox preview

Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.

Compare server and visitor addresses

Install and manage

Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.

Base and Minimum are two packages of the same current module release, not separate command versions.

Base package

Install the complete package with local command reference and every published mode.

install ip
Minimum package

Install the reduced package. Local reference is omitted; help <cmd> -i opens the current server reference.

install ip -m
Exact public version

Install exactly this published version.

install ip -v 1.2.2
Check or update

Ask upgrade to check compatibility and replace the installed block only when needed.

upgrade ip
Remove module

Remove the extension block while leaving the core and unrelated modules intact.

install ip -u

Examples

Examples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.

Compare server and visitor addresses
ip 192.168.1.1
Offline educational example — not a live lookup
Address  192.168.1.1
Family   IPv4
Scope    private
Integer  3232235777
Hex      0xC0A80101
Bytes    192.168.1.1
Convert an unsigned integer to IPv4 and inspect it
ip 3232235777
Offline educational example — not a live lookup
Address  192.168.1.1
Family   IPv4
Scope    private
Integer  3232235777
Hex      0xC0A80101
Bytes    192.168.1.1
Convert hexadecimal to IPv4 and inspect it
ip 0xC0A80101
Offline educational example — not a live lookup
Address  192.168.1.1
Family   IPv4
Scope    private
Integer  3232235777
Hex      0xC0A80101
Bytes    192.168.1.1
Show IPv4 network, mask, wildcard, broadcast and range
ip 192.168.1.10/24
Offline educational example — not a live lookup
Address    192.168.1.10
Family     IPv4
Scope      private
Integer    3232235786
Hex        0xC0A8010A
Bytes      192.168.1.10
CIDR       192.168.1.0/24
Network    192.168.1.0
Netmask    255.255.255.0
Wildcard   0.0.0.255
Broadcast  192.168.1.255
Range      192.168.1.0 – 192.168.1.255
Addresses  256
Show IPv4 network, mask, wildcard, broadcast and range
ip 192.0.2.10/30
Offline educational example — not a live lookup
Address    192.0.2.10
Family     IPv4
Scope      documentation
Integer    3221225994
Hex        0xC000020A
Bytes      192.0.2.10
CIDR       192.0.2.8/30
Network    192.0.2.8
Netmask    255.255.255.252
Wildcard   0.0.0.3
Broadcast  192.0.2.11
Range      192.0.2.8 – 192.0.2.11
Addresses  4
Show IPv4 network, mask, wildcard, broadcast and range
ip 0.0.0.0/0
Offline educational example — not a live lookup
Address    0.0.0.0
Family     IPv4
Scope      unspecified
Integer    0
Hex        0x00000000
Bytes      0.0.0.0
CIDR       0.0.0.0/0
Network    0.0.0.0
Netmask    0.0.0.0
Wildcard   255.255.255.255
Broadcast  255.255.255.255
Range      0.0.0.0 – 255.255.255.255
Addresses  4294967296
Inspect an IPv4 address, numeric forms and scope
ip 127.0.0.1
Offline educational example — not a live lookup
Address  127.0.0.1
Family   IPv4
Scope    loopback
Integer  2130706433
Hex      0x7F000001
Bytes    127.0.0.1
Inspect an IPv4 address, numeric forms and scope
ip 169.254.10.5
Offline educational example — not a live lookup
Address  169.254.10.5
Family   IPv4
Scope    link-local
Integer  2851998213
Hex      0xA9FE0A05
Bytes    169.254.10.5
Reject an invalid IP address
ip 100.64.0.1
Offline educational example — not a live lookup
Address  100.64.0.1
Family   IPv4
Scope    shared
Integer  1681915905
Hex      0x64400001
Bytes    100.64.0.1
Inspect an IPv4 address, numeric forms and scope
ip 224.0.0.1
Offline educational example — not a live lookup
Address  224.0.0.1
Family   IPv4
Scope    multicast
Integer  3758096385
Hex      0xE0000001
Bytes    224.0.0.1
Inspect an IPv4 address, numeric forms and scope
ip 203.0.113.3
Offline educational example — not a live lookup
Address  203.0.113.3
Family   IPv4
Scope    documentation
Integer  3405803779
Hex      0xCB007103
Bytes    203.0.113.3
Inspect an IPv4 address, numeric forms and scope
ip 255.255.255.255
Offline educational example — not a live lookup
Address  255.255.255.255
Family   IPv4
Scope    broadcast
Integer  4294967295
Hex      0xFFFFFFFF
Bytes    255.255.255.255
Show compressed and expanded IPv6 forms and scope
ip ::1
Offline educational example — not a live lookup
Address     ::1
Family      IPv6
Scope       loopback
Compressed  ::1
Expanded    0000:0000:0000:0000:0000:0000:0000:0001
Hex         0x00000000000000000000000000000001
Show compressed and expanded IPv6 forms and scope
ip 2001:db8::1
Offline educational example — not a live lookup
Address     2001:db8::1
Family      IPv6
Scope       documentation
Compressed  2001:db8::1
Expanded    2001:0db8:0000:0000:0000:0000:0000:0001
Hex         0x20010DB8000000000000000000000001
Show the IPv6 network, last address and range
ip 2001:db8::1/64
Offline educational example — not a live lookup
Address     2001:db8::1
Family      IPv6
Scope       documentation
Compressed  2001:db8::1
Expanded    2001:0db8:0000:0000:0000:0000:0000:0001
Hex         0x20010DB8000000000000000000000001
CIDR        2001:db8::/64
Network     2001:db8::
Last        2001:db8::ffff:ffff:ffff:ffff
Range       2001:db8:: – 2001:db8::ffff:ffff:ffff:ffff
Addresses   18446744073709551616
Show the IPv6 network, last address and range
ip fe80::1/128
Offline educational example — not a live lookup
Address     fe80::1
Family      IPv6
Scope       link-local
Compressed  fe80::1
Expanded    fe80:0000:0000:0000:0000:0000:0000:0001
Hex         0xFE800000000000000000000000000001
CIDR        fe80::1/128
Network     fe80::1
Last        fe80::1
Range       fe80::1 – fe80::1
Addresses   1
Show compressed and expanded IPv6 forms and scope
ip fc00::1
Offline educational example — not a live lookup
Address     fc00::1
Family      IPv6
Scope       private
Compressed  fc00::1
Expanded    fc00:0000:0000:0000:0000:0000:0000:0001
Hex         0xFC000000000000000000000000000001
Inspect the current visitor address
ip me
Offline educational example — not a live lookup
Address  8.8.8.8
Family   IPv4
Scope    public
Integer  134744072
Hex      0x08080808
Bytes    8.8.8.8
Inspect the current server address
ip server
Offline educational example — not a live lookup
Address  192.0.2.3
Family   IPv4
Scope    documentation
Integer  3221225987
Hex      0xC0000203
Bytes    192.0.2.3
Ip · 20
ip 256.1.1.1
Offline educational example — not a live lookup
Invalid IP address
Ip · 21
ip 192.0.2.10/33
Offline educational example — not a live lookup
Invalid prefix
Ip · 22
ip 2001:db8::1/129
Offline educational example — not a live lookup
Invalid prefix
Ip · 23
ip 4294967296
Offline educational example — not a live lookup
IPv4 integer is out of range
Ip · 24
ip 192.0.2.1/abc
Offline educational example — not a live lookup
Invalid prefix

File used in this example: sandbox/config/app.json

The example uses a file or directory from the protected /sandbox/ documentation workspace.

{
  "name": "lil-sandbox",
  "debug": true,
  "features": ["files", "code", "archives"],
  "limits": {
    "upload_mb": 2,
    "history": 25
  }
}

Related documentation

Current public release

v1.2.22026-08-08

Clearer visitor and server forms

Separates request-derived me/server forms from deterministic address conversions in the local reference.