본문 바로가기

리눅스

[리눅스] IP 계산기(ipcalc/sipcalc)

728x90

IP 계산기(ipcalc/sipcalc)

ipcalc/sipcalc 명령어

 : 콘솔 기반 IP 서브넷 계산기

ipcalc 패키지 설치

$ yum install -y ipcalc

ipcalc 사용 방법

ipcalc -4bmnp 10.31.0.0/16
$ ipcalc -4bmnp 10.31.0.0/16
NETMASK=255.255.0.0
PREFIX=16
BROADCAST=10.31.255.255
NETWORK=10.31.0.0

명령어 help

$ ipcalc --help
Usage: ipcalc [OPTION...]
  -c, --check         Validate IP address for specified address family
  -4, --ipv4          IPv4 address family (default)
  -6, --ipv6          IPv6 address family
  -b, --broadcast     Display calculated broadcast address
  -h, --hostname      Show hostname determined via DNS
  -m, --netmask       Display default netmask for IP (class A, B, or C)
  -n, --network       Display network address
  -p, --prefix        Display network prefix
  -s, --silent        Don't ever display error messages

Help options:
  -?, --help          Show this help message
  --usage             Display brief usage message

sipcalc 패키지 설치

$ yum install -y sipcalc

sipcalc 사용 방법

- 10.31.0.0/16 서브넷에서 20서브넷으로 나누기

sipcalc 10.31.0.0/16 -s 20
$ sipcalc 10.31.0.0/16 -s 20
-[ipv4 : 10.31.0.0/16] - 0

[Split network]
Network                 - 10.31.0.0       - 10.31.15.255
Network                 - 10.31.16.0      - 10.31.31.255
Network                 - 10.31.32.0      - 10.31.47.255
Network                 - 10.31.48.0      - 10.31.63.255
Network                 - 10.31.64.0      - 10.31.79.255
Network                 - 10.31.80.0      - 10.31.95.255
Network                 - 10.31.96.0      - 10.31.111.255
...

서브넷에 대한 세부 정보 확인

sipcalc 10.31.0.0/16 -s 20 -u
$ sipcalc 10.31.0.0/16 -s 20 -u
-[ipv4 : 10.31.0.0/16] - 0

[Split network - verbose]
-[ipv4 : 10.31.0.0/16] - 0

[CIDR]
Host address            - 10.31.0.0
Host address (decimal)  - 169803776
Host address (hex)      - A1F0000
Network address         - 10.31.0.0
Network mask            - 255.255.240.0
Network mask (bits)     - 20
Network mask (hex)      - FFFFF000
Broadcast address       - 10.31.15.255
Cisco wildcard          - 0.0.15.255
Addresses in network    - 4096
Network range           - 10.31.0.0 - 10.31.15.255
Usable range            - 10.31.0.1 - 10.31.15.254

-
-[ipv4 : 10.31.0.0/16] - 0

[CIDR]
Host address            - 10.31.16.0
Host address (decimal)  - 169807872
Host address (hex)      - A1F1000
Network address         - 10.31.16.0
Network mask            - 255.255.240.0
Network mask (bits)     - 20
Network mask (hex)      - FFFFF000
Broadcast address       - 10.31.31.255
Cisco wildcard          - 0.0.15.255
Addresses in network    - 4096
Network range           - 10.31.16.0 - 10.31.31.255
Usable range            - 10.31.16.1 - 10.31.31.254

-
...

서브넷의 클래스 표시

sipcalc 10.31.0.0/16 -s 20 -u -c
$ sipcalc 10.31.0.0/16 -s 20 -u -c
-[ipv4 : 10.31.0.0/16] - 0

[Classful]
Host address            - 10.31.0.0
Host address (decimal)  - 169803776
Host address (hex)      - A1F0000
Network address         - 10.0.0.0
Network class           - A
Network mask            - 255.0.0.0
Network mask (hex)      - FF000000
Broadcast address       - 10.255.255.255

[Split network - verbose]
-[ipv4 : 10.31.0.0/16] - 0

[Classful]
Host address            - 10.31.0.0
Host address (decimal)  - 169803776
Host address (hex)      - A1F0000
Network address         - 10.0.0.0
Network class           - A
Network mask            - 255.0.0.0
Network mask (hex)      - FF000000
Broadcast address       - 10.255.255.255

-
-[ipv4 : 10.31.0.0/16] - 0

[Classful]
Host address            - 10.31.16.0
Host address (decimal)  - 169807872
Host address (hex)      - A1F1000
Network address         - 10.0.0.0
Network class           - A
Network mask            - 255.0.0.0
Network mask (hex)      - FF000000
Broadcast address       - 10.255.255.255

-
...

명령어 help

$ sipcalc --help
sipcalc 1.1.6

Usage: sipcalc [OPTIONS]... <[ADDRESS]... [INTERFACE]... | [-]>

Global options:
  -a, --all                     All possible information.
  -d, --resolve                 Enable name resolution.
  -h, --help                    Display this help.
  -I, --addr-int=INT            Added an interface.
  -n, --subnets=NUM             Display NUM extra subnets (starting from
                                the current subnet). Will display all subnets
                                in the current /24 if NUM is 0.
  -u, --split-verbose           Verbose split.
  -v, --version                 Version information.
  -4, --addr-ipv4=ADDR          Add an ipv4 address.
  -6, --addr-ipv6=ADDR          Add an ipv6 address.

IPv4 options:
  -b, --cidr-bitmap             CIDR bitmap.
  -c, --classful-addr           Classful address information.
  -i, --cidr-addr               CIDR address information. (default)
  -s, --v4split=MASK            Split the current network into subnets
                                of MASK size.
  -w, --wildcard                Display information for a wildcard
                                (inverse mask).
  -x, --classful-bitmap Classful bitmap.

IPv6 options:
  -e, --v4inv6                  IPv4 compatible IPv6 information.
  -r, --v6rev                   IPv6 reverse DNS output.
  -S, --v6split=MASK            Split the current network into subnets
                                of MASK size.
  -t, --v6-standard             Standard IPv6. (default)

Address must be in the "standard" dotted quad format.
Netmask can be given in three different ways:
 - Number of bits    [/nn]
 - Dotted quad       [nnn.nnn.nnn.nnn]
 - Hex               [0xnnnnnnnn | nnnnnnnn]

Interface must be a valid network interface on the system.
If this options is used an attempt will be made to gain the address
and netmask from the specified interface.

Replacing address/interface with '-' will use stdin for reading further
arguments.

Report bugs to <[email protected]>.

 

728x90