• Question about netstat -r -n Genmask when it ends up being all zeros

    From Alphonse Arnaud@110:110/2002 to All on Wed Sep 10 23:12:20 2014
    If, when I run "netstat -r -n", I see a "Genmask" of 128.0.0.0
    and a "Destination" of 0.0.0.0, and a "Gateway" of 192.168.1.1,
    what does that mean in terms of how the "netmask" works?

    Googling, I find that I need to do a binary bitwise boolean AND: http://en.wikiversity.org/wiki/EE_Digital_Electronics/Lecture_Digital_Logic_Gat es#The_AND_function

    So, to convert the IP address to binary, I went here for a lookup: http://www.pawprint.net/designresources/netmask-converter.php
    Where it seems that the Genmask of 128.0.0.0 is really a netmask
    of 128.0.0.0, which is really a netmask of the following 32 bits:
    10000000 00000000 00000000 00000000

    From http://www.sput.nl/internet/cidr-routing.html, it seems that
    I need to run this calculation manually to figure what is going on:

    Addr 0.0.0.0
    Mask 128.0.0.0
    AND --------------------------------------------
    Net ?.?.?.?

    Addr 0000 0000 1010 1000 0000 0000 0000 0000
    Mask 1000 0000 0000 0000 0000 0000 0000 0000
    AND --------------------------------------------
    Net 0000 0000 0000 0000 0000 0000 0000 0000

    I must admit, I'm confused.
    I "think" I did all the right math.
    But, what does all zeros tell me about the route?





    --- MBSE BBS v1.0.1 (GNU/Linux-i386)
    * Origin: albasani.net (110:110/2002@linuxnet)
  • From Jonathan N. Little@110:110/2002 to All on Thu Sep 11 00:55:09 2014
    Subject: Re: Question about netstat -r -n Genmask when it ends up
    being all zeros

    Alphonse Arnaud wrote:
    If, when I run "netstat -r -n", I see a "Genmask" of 128.0.0.0
    and a "Destination" of 0.0.0.0, and a "Gateway" of 192.168.1.1,
    what does that mean in terms of how the "netmask" works?

    Googling, I find that I need to do a binary bitwise boolean AND:

    http://en.wikiversity.org/wiki/EE_Digital_Electronics/Lecture_Digital_Logic_Gat es#The_AND_function

    So, to convert the IP address to binary, I went here for a lookup: http://www.pawprint.net/designresources/netmask-converter.php
    Where it seems that the Genmask of 128.0.0.0 is really a netmask
    of 128.0.0.0, which is really a netmask of the following 32 bits:
    10000000 00000000 00000000 00000000

    From http://www.sput.nl/internet/cidr-routing.html, it seems that
    I need to run this calculation manually to figure what is going on:

    Addr 0.0.0.0
    Mask 128.0.0.0
    AND --------------------------------------------
    Net ?.?.?.?

    Addr 0000 0000 1010 1000 0000 0000 0000 0000
    Mask 1000 0000 0000 0000 0000 0000 0000 0000
    AND --------------------------------------------
    Net 0000 0000 0000 0000 0000 0000 0000 0000

    I must admit, I'm confused.
    I "think" I did all the right math.
    But, what does all zeros tell me about the route?





    <http://www.cyberciti.biz/faq/what-is-a-routing-table/>

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com

    --- MBSE BBS v1.0.1 (GNU/Linux-i386)
    * Origin: LITTLE WORKS STUDIO (110:110/2002@linuxnet)
  • From detha@110:110/2002 to All on Thu Sep 11 06:49:18 2014
    Subject: Re: Question about netstat -r -n Genmask when it ends up being all zeros

    On Wed, 10 Sep 2014 23:12:20 +0000, Alphonse Arnaud wrote:

    If, when I run "netstat -r -n", I see a "Genmask" of 128.0.0.0 and a "Destination" of 0.0.0.0, and a "Gateway" of 192.168.1.1, what does that
    mean in terms of how the "netmask" works?

    Googling, I find that I need to do a binary bitwise boolean AND:

    http://en.wikiversity.org/wiki/EE_Digital_Electronics/Lecture_Digital_Logic_Gat es#The_AND_function

    So, to convert the IP address to binary, I went here for a lookup: http://www.pawprint.net/designresources/netmask-converter.php Where it
    seems that the Genmask of 128.0.0.0 is really a netmask of 128.0.0.0,
    which is really a netmask of the following 32 bits:
    10000000 00000000 00000000 00000000

    From http://www.sput.nl/internet/cidr-routing.html, it seems that I need
    to run this calculation manually to figure what is going on:

    Addr 0.0.0.0
    Mask 128.0.0.0
    AND -------------------------------------------- Net ?.?.?.?

    Addr 0000 0000 1010 1000 0000 0000 0000 0000 Mask 1000 0000 0000
    0000 0000 0000 0000 0000 AND
    -------------------------------------------- Net 0000 0000 0000 0000
    0000 0000 0000 0000

    I must admit, I'm confused.
    I "think" I did all the right math.
    But, what does all zeros tell me about the route?

    It tells you that traffic to all destinations with the highest bit being 0 (i.e. 0.0.0.0 to 127.255.255.255) will be sent to 192.168.1.1, unless
    there is a more specific route for that destination. To select the gateway
    for a destination, the system takes the destination, ANDs with the netmask
    for each route, and compares that with the destination of the route. If
    that matches exactly, the route is a possible choice. The most specific
    route (i.e. the one with the most bits matching) wins.

    I have seen VPN clients do this, they install two routes, one for 0.0.0.0
    and one for 128.0.0.0, both with netmask 128.0.0.0. This way, they create
    a 'default' route through the VPN tunnel without having to remember what
    the original default route (0.0.0.0 mask 0.0.0.0) was for when the tunnel
    goes down. As long as the tunnel is up, the more specifics are selected,
    and when the tunnel goes down all the vpn client has to do is remove the
    more specifics it installed, and selection falls back to your original
    default route.

    -d

    --- MBSE BBS v1.0.1 (GNU/Linux-i386)
    * Origin: whoever pays best (110:110/2002@linuxnet)