• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

ipcalc Command Examples in Linux

by Deepika

The “ipcalc” command is a command-line utility that is used to perform simple operations and calculations on IP addresses and networks. It is typically used to calculate the network address, broadcast address, and other information about a given IP address and netmask.

Here are some examples of how the “ipcalc” command can be used:

  • To calculate the network address and broadcast address of a given IP address and netmask, use the command “ipcalc [IP address] [netmask]”.
  • To display the network address, broadcast address, and other information about a given IP address and netmask, use the command “ipcalc -s [IP address] [netmask]”.
  • To calculate the netmask for a given IP address and prefix, use the command “ipcalc -p [IP address] [prefix]”.

The “ipcalc” command can also be used to perform more advanced calculations such as the CIDR notation or prefix notation of a IP address and subnet mask. It is also able to support IPv6 addresses, for example “ipcalc -6 2001:0db8:85a3:0000:0000:8a2e:0370:7334/128”

ipcalc Command Examples

1. Show information about an address or network with a given subnet mask:

# ipcalc 1.2.3.4 255.255.255.0

2. Show information about an address or network in CIDR notation:

# ipcalc 1.2.3.4/24

3. Show the broadcast address of an address or network:

# ipcalc -b 1.2.3.4/30

4. Show the network address of provided IP address and netmask:

# ipcalc -n 1.2.3.4/24

5. Display geographic information about a given IP address:

# ipcalc -g 1.2.3.4

Filed Under: Linux

Some more articles you might also be interested in …

  1. fdisk: Unable to write /dev/sdg: Bad file descriptor – error while formatting USB disk
  2. Yum Command – RPM Based Package Management Utility
  3. How to Create a Custom Log File Rotation by logrotate in Linux
  4. “WARNING: Duplicate VG name [vgname]” – error while running LVM commands
  5. Extend volume on non-partitioned disk (XFS) under VMware guest
  6. timedatectl Command Examples in Linux
  7. How To Check Swap Usage of Each Processes in Linux
  8. enum4linux Command Examples in Linux
  9. Audit Rule Configuration not Reflected – How to troubleshoot
  10. lpq Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright