Lesson 5

Dates: 6/12/2017
Linux networking
Linux System Administration


Exercise: IP calculator

  • Network IP calculations with ipcalc
    On the desktop, install ipcalc by using APT:
    apt-get install ipcalc 
    
    Run ipcalc for network address 192.168.5.0 with subnet mask 255.255.255.0.
    ipcalc 192.168.5.0/255.255.255.0 
    
    See the output for Address, Netmask, Network, HostMin, HostMax, Broadcast, Hosts/Net.
    Notice the same results for the same network and the different representation of the netmask:
    ipcalc 192.168.5.0/24
    ipcalc 192.168.5.0/11111111.11111111.11111111.00000000
    
    Notice the same results for Netmask, Network, HostMin, HostMax, Broadcast, Hosts/Net if using the different IP addresses within the same network in ipcalc, for example:
    ipcalc 192.168.5.15/24
    ipcalc 192.168.5.34/24
    

    Run ipcalc for subnets (networks) 192.168.5.0/25 and 192.168.5.128/25:
    ipcalc 192.168.5.0/25
    ipcalc 192.168.5.128/25
    
    Notice the values for HostMin and HostMax in both the cases. By looking at the ranges [HostMin, HostMax], you can see, for example, that IP address 192.168.5.5 belongs to the first subnet and 192.168.5.250 to the second.
    You can verify that by running ipcalc on the IP addresses above and then comparing the Network values:
    ipcalc 192.168.5.5/25
    ipcalc 192.168.5.250/25
    





  • Take me to the Course Website