Bash script to subdivide a given subnet into a pre-defined number of smaller subnets.

Discussion in 'Programming/Scripts' started by rias, Oct 24, 2015.

  1. rias

    rias New Member

    Bash script to subdivide a given subnet into a pre-defined number of smaller subnets. Show network/broadcast address, number of hosts and assign gateway.

    For example:

    Input:

    ./subnetter.sh 192.168.0.0/243
    Output:

    192.168.0.0/128 subnet 192.168.0.0 broadcast 192.168.0.127 gateway 192.168.0.100 hosts 125192.168.0.128/192 subnet 192.168.0.128 broadcast 192.168.0.191 gateway 192.168.0.150 hosts 61192.168.0.192/192 subnet 192.168.0.192 broadcast 192.168.0.255 gateway 192.168.0.200 hosts 61
     
  2. sjau

    sjau Local Meanie Moderator

    no real idea what you want to achieve.
     

Share This Page