Alias for ip range…



  • How can I create an alias for the ip range 192.168.20.50 … 192.168.21.250 ?

    Or isn't this possible..?

    cheers  hank



  • You could use the net type and use subnet notation to create one.

    IE: 192.168.1.0/24 would be 192.168.1.1-254



  • Btw, if you can't capture all IPs in networkranges and some single IPs are left add them to the same networks alias as /32 subnets  ;)



  • Address ranges are not necesarilly representable with CIDR, like f eks: i like to block 192.168.1.100-200 but that can't be "created" with a CIDR range. or am i wrong here and need to read upon CIDR ranges?



  • @mastrboy:

    i like to block 192.168.1.100-200

    download & unzip this:

    http://www.irbs.net/internet/postfix/0401/att-3032/cidr_range.pl.gz

    then,

    % perl cidr_range.pl 192.168.1.100 192.168.1.200

    returns:

    192.168.1.100/30
    192.168.1.104/29
    192.168.1.112/28
    192.168.1.128/26
    192.168.1.192/29
    192.168.1.200/32

    then, add those CIDR ranges to a Network alias.

    hth.



  • blokking .100 till .20 with submask's

    blokking 192.168.1.100/29  gives .100 till .103
    blokking 192.168.1.104/29 gives .104 till .111
    blokking 192.168.1.112/28 gives .112 till 127
    blokking 192.168.1.128/26 gives .128 till .191
    blokking 192.168.1.192/29 gives .192 till .199
    blokking 192.168.1.200/32 gives .200



  • thanks Tenzen, great tool to have :)

    (but still a little annoying to have so many aliases that could have been merged into one  :-\ )

    edit: se below post ;)



  • Thats kinda spiffy.  Would be nice if we had a CIDR lookup tool based on this type of thing.

    mastrboy: you mean multiple aliases, not rules, eh?  because you just plug all of these into an alias and then reference the alias inside your firewall rule (1 rule required, 1 alias with multiple entries).


Log in to reply