'

Outils pour utilisateurs

Outils du site


doc:sipcalc

sipcalc : manipuler les adresses IP

sipcalc est un outil en ligne de commande bien pratique pour manipuler les adresses IP et leurs masques. Il est disponible sur toutes les bonnes distributions GNU & Linux.

Exemple

En IPv4

$ sipcalc 192.168.1.24 255.255.255.240
-[ipv4 : 192.168.1.24 255.255.255.240] - 0

[CIDR]
Host address		- 192.168.1.24
Host address (decimal)	- 3232235800
Host address (hex)	- C0A80118
Network address		- 192.168.1.16
Network mask		- 255.255.255.240
Network mask (bits)	- 28
Network mask (hex)	- FFFFFFF0
Broadcast address	- 192.168.1.31
Cisco wildcard		- 0.0.0.15
Addresses in network	- 16
Network range		- 192.168.1.16 - 192.168.1.31
Usable range		- 192.168.1.17 - 192.168.1.30

En IPv4 avec un masque CIDR

$ sipcalc 192.168.1.24/30
-[ipv4 : 192.168.1.24/30] - 0

[CIDR]
Host address		- 192.168.1.24
Host address (decimal)	- 3232235800
Host address (hex)	- C0A80118
Network address		- 192.168.1.24
Network mask		- 255.255.255.252
Network mask (bits)	- 30
Network mask (hex)	- FFFFFFFC
Broadcast address	- 192.168.1.27
Cisco wildcard		- 0.0.0.3
Addresses in network	- 4
Network range		- 192.168.1.24 - 192.168.1.27
Usable range		- 192.168.1.25 - 192.168.1.26

Convertir une adresse IPv4 en décimal :

$ sipcalc 192.168.1.1/32 | grep decimal | awk '{print $5}'
3232235777

En IPv6

 sipcalc 2001:200:dff:fff1:216:3eff:feb1:44d7/64
-[ipv6 : 2001:200:dff:fff1:216:3eff:feb1:44d7/64] - 0

[IPV6 INFO]
Expanded Address	- 2001:0200:0dff:fff1:0216:3eff:feb1:44d7
Compressed address	- 2001:200:dff:fff1:216:3eff:feb1:44d7
Subnet prefix (masked)	- 2001:200:dff:fff1:0:0:0:0/64
Address ID (masked)	- 0:0:0:0:216:3eff:feb1:44d7/64
Prefix address		- ffff:ffff:ffff:ffff:0:0:0:0
Prefix length		- 64
Address type		- Aggregatable Global Unicast Addresses
Network range		- 2001:0200:0dff:fff1:0000:0000:0000:0000 -
			  2001:0200:0dff:fff1:ffff:ffff:ffff:ffff
doc/sipcalc.txt · Dernière modification: Le 07/01/2015 à 23:52 (modification externe)