Posted: . At: 8:38 AM. This was 3 years ago. Post ID: 14950
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


Convert your IP address to binary easily with this command.


This one-liner will take your IP address and convert it into binary. This is very useful and fun to do.

┌──[jason@192.168.1.2][~/Videos]
└──╼  ╼ $ ipcalc `ip a | awk '/inet / { print $2 }' | sed -n 2p | cut -d "/" -f1` | awk '/Address/ {print $3,$4}'
11000000.10101000.00000001. 00000010

This alternate version also works very well. This allows the user to convert the IP address of their machine into binary with one simple command.

┌──[jason@192.168.1.2][~/Videos]
└──╼  ╼ $ ipcalc $(ip a | awk '/inet / { print $2 }' | sed -n 2p | cut -d "/" -f1) | awk '/Address/ {print $3,$4}'
11000000.10101000.00000001. 00000010

The sipcalc utility is a very useful tool for creating a network, this can be used to calculate subnets very easily.

Below is an example of a /27 subnetting setup. This gives 32 addresses in the network. This gives a netmask of 255.255.255.224.

┌──[jason@192.168.1.2][~/Videos]
└──╼  ╼ $ sipcalc 204.17.5.32/27
-[ipv4 : 204.17.5.32/27] - 0
 
[CIDR]
Host address		- 204.17.5.32
Host address (decimal)	- 3423667488
Host address (hex)	- CC110520
Network address		- 204.17.5.32
Network mask		- 255.255.255.224
Network mask (bits)	- 27
Network mask (hex)	- FFFFFFE0
Broadcast address	- 204.17.5.63
Cisco wildcard		- 0.0.0.31
Addresses in network	- 32
Network range		- 204.17.5.32 - 204.17.5.63
Usable range		- 204.17.5.33 - 204.17.5.62

Calculating subnetting can be very frustrating, but this can really help out.

This Youtube video will also be very helpful, this is how to calculate subnets by hand, this is an alternative to always using a calculator like siplcalc, as you cannot do that in a Cisco examination.

This should really help out struggling Cisco students.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.