Skip to content
Smarter by Design.Simpler for Business

sys-cmd ipcalc ​

sys-cmd ipcalc calculates the network address, the broadcast address, the two spellings of the mask and the usable address range from the IP address and the mask given in WEB-CLI. It does not send any packets to the network; it is used to understand which subnet a VIP or a backend address falls into and whether two addresses are in the same subnet.

Command Summary ​

TR7 WEB-CLI · sys-cmd ipcalc
# type ipcalc and press Tab: a free parameter
admin@TR7LBWAF01> sys-cmd ipcalc
<ipcalc-parameter-1>
 
admin@TR7LBWAF01> sys-cmd ipcalc <address>/<prefix>
admin@TR7LBWAF01> sys-cmd ipcalc <address> <mask>
admin@TR7LBWAF01>  

Everything written after the word ipcalc is passed to the tool as it is. There is no mandatory field; the address and the mask are written in one of the formats below.

How It Works ​

SubjectBehavior
ContextIt only calculates; the selected v-device and route table do not change the result.
DurationIt writes the result and closes immediately.
PipeThe output can be filtered with | or written to a file with to-file.
RecordingEvery run is written to the user logs.

Writing Formats ​

FormatWhat is calculatedExample
<address>/<prefix>The information of the network given with a prefix length10.20.0.0/22
<address> <mask>The information of the network given with a dotted mask198.51.100.137 255.255.255.0

The names of the lines in the output and the additional options depend on the version of the tool on the device.

Examples ​

TR7 WEB-CLI · A) The /24 network in which the VIP is located
admin@TR7LBWAF01> sys-cmd ipcalc 10.0.7.20/24
admin@TR7LBWAF01>  
TR7 WEB-CLI · B) With a dotted mask
admin@TR7LBWAF01> sys-cmd ipcalc 198.51.100.137 255.255.255.0
admin@TR7LBWAF01>  
TR7 WEB-CLI · C) A wide block
admin@TR7LBWAF01> sys-cmd ipcalc 10.10.0.0/22
admin@TR7LBWAF01>  

Things to Know ​

  • Are two addresses in the same subnet? Both addresses are calculated separately with the same mask; if the network addresses are equal, the addresses are in the same subnet and routing is not needed between them.
  • Address planning. Before a new IP address is added to a route table, the usable range is verified with this command; adding an address is done with the network ip command.