Ferramentas do usuário

Ferramentas do site


engenharia:enderecamento_ip_ipcalc

Enderecamento IP com comando IPCalc

Comando ipcalc

Para uso do endereçamento IP e saber como criar subnets, podemos utilizar o comando “ipcalc”.

root@cerberus:~# ipcalc 192.168.10.0 24
Address:   192.168.10.0         11000000.10101000.00001010. 00000000
Netmask:   255.255.255.0 = 24   11111111.11111111.11111111. 00000000
Wildcard:  0.0.0.255            00000000.00000000.00000000. 11111111
=>
Network:   192.168.10.0/24      11000000.10101000.00001010. 00000000
HostMin:   192.168.10.1         11000000.10101000.00001010. 00000001
HostMax:   192.168.10.254       11000000.10101000.00001010. 11111110
Broadcast: 192.168.10.255       11000000.10101000.00001010. 11111111
Hosts/Net: 254                   Class C, Private Internet
 
root@cerberus:~#

Vamos transformar o /24 em /25 no caso teremos duas subnets

root@cerberus:~# ipcalc 192.168.10.0 24 25
Address:   192.168.10.0         11000000.10101000.00001010. 00000000
Netmask:   255.255.255.0 = 24   11111111.11111111.11111111. 00000000
Wildcard:  0.0.0.255            00000000.00000000.00000000. 11111111
=>
Network:   192.168.10.0/24      11000000.10101000.00001010. 00000000
HostMin:   192.168.10.1         11000000.10101000.00001010. 00000001
HostMax:   192.168.10.254       11000000.10101000.00001010. 11111110
Broadcast: 192.168.10.255       11000000.10101000.00001010. 11111111
Hosts/Net: 254                   Class C, Private Internet
 
Subnets after transition from /24 to /25
 
Netmask:   255.255.255.128 = 25 11111111.11111111.11111111.1 0000000
Wildcard:  0.0.0.127            00000000.00000000.00000000.0 1111111
 
 1.
Network:   192.168.10.0/25      11000000.10101000.00001010.0 0000000
HostMin:   192.168.10.1         11000000.10101000.00001010.0 0000001
HostMax:   192.168.10.126       11000000.10101000.00001010.0 1111110
Broadcast: 192.168.10.127       11000000.10101000.00001010.0 1111111
Hosts/Net: 126                   Class C, Private Internet
 
 2.
Network:   192.168.10.128/25    11000000.10101000.00001010.1 0000000
HostMin:   192.168.10.129       11000000.10101000.00001010.1 0000001
HostMax:   192.168.10.254       11000000.10101000.00001010.1 1111110
Broadcast: 192.168.10.255       11000000.10101000.00001010.1 1111111
Hosts/Net: 126                   Class C, Private Internet
 
 
Subnets:   2
Hosts:     252
root@cerberus:~#

Comando sipcalc

root@cerberus:~# sipcalc 2001:db8::/64
-[ipv6 : 2001:db8::/64] - 0
 
[IPV6 INFO]
Expanded Address        - 2001:0db8:0000:0000:0000:0000:0000:0000
Compressed address      - 2001:db8::
Subnet prefix (masked)  - 2001:db8:0:0:0:0:0:0/64
Address ID (masked)     - 0:0:0:0:0:0:0:0/64
Prefix address          - ffff:ffff:ffff:ffff:0:0:0:0
Prefix length           - 64
Address type            - Aggregatable Global Unicast Addresses
Network range           - 2001:0db8:0000:0000:0000:0000:0000:0000 -
                          2001:0db8:0000:0000:ffff:ffff:ffff:ffff
 
-
root@cerberus:~#

Vou dividir uma rede ipv6 /64 em 2 /65

root@cerberus:~# sipcalc 2001:db8::/64 -S 65
-[ipv6 : 2001:db8::/64] - 0
 
[Split network]
Network                 - 2001:0db8:0000:0000:0000:0000:0000:0000 -
                          2001:0db8:0000:0000:7fff:ffff:ffff:ffff
Network                 - 2001:0db8:0000:0000:8000:0000:0000:0000 -
                          2001:0db8:0000:0000:ffff:ffff:ffff:ffff
 
-
root@cerberus:~#

Att.

Discussão

Insira seu comentário. Sintaxe wiki é permitida:
 
engenharia/enderecamento_ip_ipcalc.txt · Última modificação: 2019/04/28 20:23 por ricardobarbosams