Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The usage of the Linux basic command ipcalc

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "the usage of the Linux basic command ipcalc". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Ipcalc

Ipcalc provides a simple way to calculate host IP information. Various options specify what information ipcalc should display on standard output. You can specify multiple options. You must always specify the IP address to operate on. Most operations also require a netmask or CIDR prefix.

The scope of this command: RedHat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.

1. Grammar

Ipcalc [OPTION]... [/ prefix] [netmask]

2. List of options

Option

Description

-c |-- check

Detect ip addr

-4

Specify ipv4

-6

Specify ipv6

-b |-- broadcast

Displays the broadcast address and network mask of the specified ip

-h |-- hostname

Displays the hostname of the specified ip

-m |-- netmask

Calculate the mask for a given address

-p |-- prefix

Displays the prefix of a given mask or ip

-n |-- network

Displays the network address of the given ip and mask

-s |-- slient

Do not display any error messages

3. Examples

1) calculate the network address

[root@localhost] # ipcalc-n 192.168.1.9 Universe 24

NETWORK=192.168.1.0

2) calculate the broadcast address

[root@localhost] # ipcalc-b 192.168.1.9 Universe 24

BROADCAST=192.168.1.255

3) calculate the subnet mask

[root@localhost] # ipcalc-4-m 192.168.1.9

NETMASK=255.255.255.0

This is the end of the introduction to "the usage of the Linux basic command ipcalc". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report