Networking Snippets

1 minute read

Collection of snippets for basic network configuration and IP/CIDR ranges.

Connecting

Windows


Windows host network configuration.

1) Windows + R

2) ncpa.cpl    // run

3) Right click Ethernet -> Properties 

4) Select Internet Protocol Version 4 (TCP/IPv4) -> Properties 

5) Enter IP and DNS server:

	Use the following IP address: <...>

	Use the follwing DNS server addresses: <...>


Kali VM


Then setup bridging instead of NAT in VMware configuration.

ipcalc xx.xx.xx.xx

ifconfig <iface> xx.xx.xx.xx
ifconfig <iface> xx.xx.xx.xx/24   
ifconfig <iface> xx.xx.xx.xx netmask 255.xx.xx.xx

echo nameserver xx.xx.xx.xx > /etc/resolv.conf


IPv4 Address Ranges

Class Range
Class A Private Address Range 10.0.0.0 - 10.255.255.255
Class B Private Address Range 172.16.0.0 - 172.31.255.255
Class C Private Address Range 192.168.0.0 - 192.168.255.255
  127.0.0.0 - 127.255.255.255


IPv4 Subnet Table

CIDR Decimal Mask Number of Hosts
/31 255.255.255.254 1 Host
/30 255.255.255.252 2 Hosts
/29 255.255.255.249 6 Hosts
/28 255.255.255.240 14 Hosts
/27 255.255.255.224 30 Hosts
/26 255.255.255.192 62 Hosts
/25 255.255.255.128 126 Hosts
/24 255.255.255.0 254 Hosts
/23 255.255.254.0 512 Host
/22 255.255.252.0 1022 Hosts
/21 255.255.248.0 2046 Hosts
/20 255.255.240.0 4094 Hosts
/19 255.255.224.0 8190 Hosts
/18 255.255.192.0 16382 Hosts
/17 255.255.128.0 32766 Hosts
/16 255.255.0.0 65534 Hosts
/15 255.254.0.0 131070 Hosts
/14 255.252.0.0 262142 Hosts
/13 255.248.0.0 524286 Hosts
/12 255.240.0.0 1048674 Hosts
/11 255.224.0.0 2097150 Hosts
/10 255.192.0.0 4194302 Hosts
/9 255.128.0.0 8388606 Hosts
/8 255.0.0.0 16777214 Hosts