In the process of network planning and management, IP address is an important factor that must be considered. For complex network environments, how to plan IP addresses has become a very troublesome matter. However, in Linux systems, there is a subnet calculation tool-Sipcalc, which can simplify our IP address planning process and allow us to easily cope with various IP address-related needs.
Sipcalc is a command line ip subnet calculator that supports IPv4 and IPv6 and will show you all the IP related information you need to fill in your DHCP information or set up a static IP address. Development of Sipcalc began in 2001 and it has most of the features we would want in an ip calculator.
Install
Before installing sipcalc in Centos8, you need to install the epel source first. :
[root@localhost ~]# yum -y install epel-release [root@localhost ~]# yum -y install sipcalc
sipcalc usage
The following uses sipcalc to list a standard 24-bit Class C network example:
[root@localhost ~]# sipcalc 192.168.10.0/24 -[ipv4 : 192.168.10.0/24] - 0 [CIDR] Host address - 192.168.10.0 Host address (decimal) - 3232238080 Host address (hex) - C0A80A00 Network address - 192.168.10.0 Network mask - 255.255.255.0 Network mask (bits) - 24 Network mask (hex) - FFFFFF00 Broadcast address - 192.168.10.255 Cisco wildcard - 0.0.0.255 Addresses in network - 256 Network range - 192.168.10.0 - 192.168.10.255 Usable range - 192.168.10.1 - 192.168.10.254
You can see that the broadcast address, anti-mask, network range and available IP address range in the 192.168.10.0/24 network segment are listed.
Add -a
below to check:
[root@localhost ~]# sipcalc -a 192.168.10.0/24 -[ipv4 : 192.168.10.0/24] - 0 [Classful] Host address - 192.168.10.0 Host address (decimal) - 3232238080 Host address (hex) - C0A80A00 Network address - 192.168.10.0 Network class - C Network mask - 255.255.255.0 Network mask (hex) - FFFFFF00 Broadcast address - 192.168.10.255 [CIDR] Host address - 192.168.10.0 Host address (decimal) - 3232238080 Host address (hex) - C0A80A00 Network address - 192.168.10.0 Network mask - 255.255.255.0 Network mask (bits) - 24 Network mask (hex) - FFFFFF00 Broadcast address - 192.168.10.255 Cisco wildcard - 0.0.0.255 Addresses in network - 256 Network range - 192.168.10.0 - 192.168.10.255 Usable range - 192.168.10.1 - 192.168.10.254 [Classful bitmaps] Network address - 11000000.10101000.00001010.00000000 Network mask - 11111111.11111111.11111111.00000000 [CIDR bitmaps] Host address - 11000000.10101000.00001010.00000000 Network address - 11000000.10101000.00001010.00000000 Network mask - 11111111.11111111.11111111.00000000 Broadcast address - 11000000.10101000.00001010.11111111 Cisco wildcard - 00000000.00000000.00000000.11111111 Network range - 11000000.10101000.00001010.00000000 - 11000000.10101000.00001010.11111111 Usable range - 11000000.10101000.00001010.00000001 - 11000000.10101000.00001010.11111110 [Networks] Network - 192.168.10.0 - 192.168.10.255 (current)
You can see the binary form of classful routing and classless routing for the 192.168.10.0 network segment.
The following uses a network segment with a mask of 27:
[root@localhost ~]# sipcalc 192.168.10.0/27 -[ipv4 : 192.168.10.0/27] - 0 [CIDR] Host address - 192.168.10.0 Host address (decimal) - 3232238080 Host address (hex) - C0A80A00 Network address - 192.168.10.0 Network mask - 255.255.255.224 Network mask (bits) - 27 Network mask (hex) - FFFFFFE0 Broadcast address - 192.168.10.31 Cisco wildcard - 0.0.0.31 Addresses in network - 32 Network range - 192.168.10.0 - 192.168.10.31 Usable range - 192.168.10.1 - 192.168.10.30
You can see that the available addresses are 192.168.10.1-192.168.10.30
Add the -a
option to see what network segments are available:
[root@localhost ~]# sipcalc 192.168.10.0/27 -a -[ipv4 : 192.168.10.0/27] - 0 [Classful] Host address - 192.168.10.0 Host address (decimal) - 3232238080 Host address (hex) - C0A80A00 Network address - 192.168.10.0 Network class - C Network mask - 255.255.255.0 Network mask (hex) - FFFFFF00 Broadcast address - 192.168.10.255 [CIDR] Host address - 192.168.10.0 Host address (decimal) - 3232238080 Host address (hex) - C0A80A00 Network address - 192.168.10.0 Network mask - 255.255.255.224 Network mask (bits) - 27 Network mask (hex) - FFFFFFE0 Broadcast address - 192.168.10.31 Cisco wildcard - 0.0.0.31 Addresses in network - 32 Network range - 192.168.10.0 - 192.168.10.31 Usable range - 192.168.10.1 - 192.168.10.30 [Classful bitmaps] Network address - 11000000.10101000.00001010.00000000 Network mask - 11111111.11111111.11111111.00000000 [CIDR bitmaps] Host address - 11000000.10101000.00001010.00000000 Network address - 11000000.10101000.00001010.00000000 Network mask - 11111111.11111111.11111111.11100000 Broadcast address - 11000000.10101000.00001010.00011111 Cisco wildcard - 00000000.00000000.00000000.00011111 Network range - 11000000.10101000.00001010.00000000 - 11000000.10101000.00001010.00011111 Usable range - 11000000.10101000.00001010.00000001 - 11000000.10101000.00001010.00011110 [Networks] Network - 192.168.10.0 - 192.168.10.31 (current) Network - 192.168.10.32 - 192.168.10.63 Network - 192.168.10.64 - 192.168.10.95 Network - 192.168.10.96 - 192.168.10.127 Network - 192.168.10.128 - 192.168.10.159 Network - 192.168.10.160 - 192.168.10.191 Network - 192.168.10.192 - 192.168.10.223 Network - 192.168.10.224 - 192.168.10.255
In short, Sipcalc subnet calculator is a very powerful IP address planning tool, which can be easily used in Linux systems. Through the introduction of this article, we can learn how to use the Sipcalc calculation tool in Linux systems to plan IP addresses, subnets, masks and other related information, and learn how to use the Sipcalc calculation tool to troubleshoot and locate network problems. I believe these tips will help you plan IP addresses more efficiently and accurately, and provide better services for your network environment.
The above is the detailed content of IP address planning is no longer difficult! Detailed explanation of the powerful Sipcalc subnet calculator under Linux. For more information, please follow other related articles on the PHP Chinese website!