7/2/2017

Netwerk adressen met ipcalc

Filed under: — pinguim @ 10:13 am

ipcalc is een handig hulpmiddel op de commandolijn om uitleg te krijgen over ip-adressen in netwerken.

Afhalen via je packet manager/softwarebeheertool; zoek naar ipcalc (bv sudo zypper install ipcalc op Suse of sudo apt-get install ipcalc op debian)

De tool gebruikt kleur om de uitleg over de delen van de netwerkadressen te verduidelijken.
(hieronder nu niet zichtbaar, maar bv: ip-adres blauw, binaire weergave adres oranje, netmask rood, class violet..)

Je hoeft geen root te zijn om ipcalc te starten:

ipcalc
Usage: ipcalc [options]

[[/]] [NETMASK]

ipcalc takes an IP address and netmask and calculates the resulting broadcast,
network, Cisco wildcard mask, and host range. By giving a second netmask, you
can design sub- and supernetworks. It is also intended to be a teaching tool
and presents the results as easy-to-understand binary values.

-n –nocolor Don’t display ANSI color codes.
-b –nobinary Suppress the bitwise output.
-c –class Just print bit-count-mask of given address.
-h –html Display results as HTML (not finished in this version).
-v –version Print Version.
-s –split n1 n2 n3
Split into networks of size n1, n2, n3.
-r –range Deaggregate address range.
–help Longer help text.

Examples:

ipcalc 192.168.0.1/24
ipcalc 192.168.0.1/255.255.128.0
ipcalc 192.168.0.1 255.255.128.0 255.255.192.0
ipcalc 192.168.0.1 0.0.63.255

ipcalc deaggregate address range

ipcalc

/ –s a b c
split network to subnets
where a b c fits in.

! New HTML support not yet finished.

ipcalc 0.41
wim@wimbox:~> ipcalc 192.168.1.0
Address: 192.168.1.0 11000000.10101000.00000001. 00000000
Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000
Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111
=>
Network: 192.168.1.0/24 11000000.10101000.00000001. 00000000
HostMin: 192.168.1.1 11000000.10101000.00000001. 00000001
HostMax: 192.168.1.254 11000000.10101000.00000001. 11111110
Broadcast: 192.168.1.255 11000000.10101000.00000001. 11111111
Hosts/Net: 254 Class C, Private Internet

Met een switch zelfs html output (met beetje andere kleuren):

ipcalc 192.168.2.200 -h
(html output hieronder geplakt zodat je het effect ziet, niet de code)


Address:     192.168.2.200         11000000.10101000.00000010. 11001000
Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000
Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111
=>
Network:     192.168.2.0/24        11000000.10101000.00000010. 00000000
HostMin: 192.168.2.1 11000000.10101000.00000010. 00000001
HostMax: 192.168.2.254 11000000.10101000.00000010. 11111110
Broadcast: 192.168.2.255 11000000.10101000.00000010. 11111111
Hosts/Net: 254 Class C, Private Internet

Powered by WordPress