14 Replies Latest reply: Oct 1, 2012 11:31 PM by Nadeem RSS

    Special IP addresses

    Nadeem

      Can anyone explain to me what is the main purpose of IPs written bellow and how should I understand it:

       

      1. 255.255.0.0/32

      2. 255.255.0.0/0

      3. 255.255.255.255/0

      4. 255.255.255.255/32

      5. 0.0.0.0/0

      6. 0.0.0.0/32

      7. 192.168.34.5/0

      8. 192.168.34.5/32

      9. 0.0.0.0/24

      10. 255.255.255.255/24

        • 1. Re: Special IP addresses
          Nadeem

          I'm asking this in context of ACLs.

          • 2. Re: Special IP addresses
            lp4nb

            All entries with /0  will match everything.

            All entries with /32 will match exact part  a.a.a.a/32 - will only match a.a.a.a and nothing else.

            the entry with /24 must have first 3 octet as 0, and fourth could be anything.

            ----------

            • 3. Re: Special IP addresses
              Nadeem

              I think you're wrong: /0 will match only one IP address and /32 will be used for 'any'.

               

              But what is the meaning and purpose of those addresses? I mean why should you use one those addresses, if you have normal private IPs such as those in A,B,C classes or the public ones? It's special address, but I dont know for what it should be used, specialy with those masks, and how it's processed by IOS?

              • 4. Re: Special IP addresses
                lp4nb

                I think you're wrong: /0 will match only one IP address and /32 will be used for 'any'.

                ?? how

                But what is the meaning and purpose of those addresses? I mean why should you use one those addresses, if you have normal private IPs such as those in A,B,C classes or the public ones? It's special address, but I dont know for what it should be used, specialy with those masks, and how it's processed by IOS?

                 

                not all the listed one are special IP addresses.

                0.0.0.0/0 -- means all ip address.

                0.0.0.0/32 is host ip add, kind of a broadcast, RFC 5735, 1700 may help.

                 

                255.255.255.255/32 is broadcast address on the local to a network, as router won't forward it.

                I don't see any other special route here.

                • 5. Re: Special IP addresses
                  Nadeem

                  You're right, in one moment everything messed up in my head. What I was try to ask is about wildcards not subnet masks. However I figured it out.

                   

                  Things I didn't understand are:

                   

                  First, some ACL rules:

                   

                  deny ip host 0.0.0.0 any

                  deny ip host 255.255.255.255 any

                  deny ip 0.0.0.0 0.255.255.255 any

                  deny ip 166.55.73.138 255.255.255.255 any

                   

                  Second, what is difference between those:

                  ip route 0.0.0.0 0.0.0.0 180.96.40.112

                  ip route any 180.96.40.112

                   

                  And third, what is difference between

                  - ip default-gateway

                  - ip default-network

                  - and default route

                   

                  IOS commands, are they doing the same thing?

                  • 6. Re: Special IP addresses
                    cadetalain

                    Hi,

                     

                    ip route any 180.96.40.112  is not a valid syntax

                    default route   is the catch all route

                    default-gateway only used if not routing

                    default-network is for EIGRP: you say hey guys if you want to go to a destination you don't know about go the same way you would go for this network.

                     

                    Regards.

                     

                    Alain

                    • 7. Re: Special IP addresses
                      Nadeem

                      Thank you Alain, that was valuable.

                       

                      But what about those ACLs? This is something more important to me.

                      • 8. Re: Special IP addresses
                        cadetalain

                        Hi,

                        deny ip host 0.0.0.0 any  --> denies src IP= 0.0.0.0 to any dst IP

                        deny ip host 255.255.255.255 any ---> denies src IP= 255.255.255.255 to any dst IP

                        deny ip 0.0.0.0 0.255.255.255 any --->  denies any src IP to any dst IP

                        deny ip 166.55.73.138 255.255.255.255 any ---> same as above

                         

                        Regards.

                         

                        Alain

                        • 9. Re: Special IP addresses
                          Nadeem

                          OK I know that, but what I don't understand is how to interpret those ACLs.

                           

                          I mean what is host 0.0.0.0 - is that interpreted as "any"? (first case)

                          The same question is for host 255.255.255.255? (second case)

                          Also network 0.0.0.0/8  - is that special adress or regular net address? (third case)

                          And how to interperpred an IP address with 32 bit mask (

                          166.55.73.138 255.255.255.255)?

                           

                           

                           

                          Of course those questions are in the context of ACLs: What those deny statements are doing, and why we need them?

                          • 10. Re: Special IP addresses
                            Luke Savage

                            Hello Nadeem,

                             

                            Host 0.0.0.0 would deny the individual host with IP address 0.0.0.0 however the 0.x.x.x range is not generally assigned to devices(see comment below).
                            Host 255.255.255.255 would only deny indivudal address 255.255.255.255 and this is a broadcast address. So having the entry in the destination field of the ACL would block all IP broadcasts.

                            Network 0.0.0.0/8 - Current network (only valid as source address) RFC 1700. I'm not sure what effect this would have on an ACL.

                            166.55.73.138 255.255.255.255 is the same as "any any" or "0.0.0.0 255.255.255.255" and would deny all traffic.

                             

                            Remember, in extended ACL's you must always specify source and destination addresses.

                             

                            Luke

                            • 11. Re: Special IP addresses
                              Nadeem

                              Thank you Luke for your answer.

                               

                              1. Can I conclude that 0.0.0.0 is regular IP address or something like that, just like 255.255.255.255 for broadcast?

                               

                              2. Also some IP with wildcard 0.0.0.0 is the same as host IP and IP with 32-bit wildcard is the same as "any" - is that correct?

                               

                              Of course I'm talking in context of ACLs.

                              • 12. Re: Special IP addresses
                                Luke Savage

                                1. I did a bit more reading and it's not quite the same. Addresses on the 0.0.0.0/8 network appear to refer to devices on "this network". "This network" being whatever network the machine is attached to. This would be used if the device cannot obtain a DHCP address and has been replaced by APIPA in Windows machines.

                                 

                                "0.0.0.0/8 - Addresses in this block refer to source hosts on "this"

                                network.  Address 0.0.0.0/32 may be used as a source address for this

                                host on this network; other addresses within 0.0.0.0/8 may be used to

                                refer to specified hosts on this network ([RFC1122], Section

                                3.2.1.3)." - http://tools.ietf.org/html/rfc5735

                                 

                                2. Yes, when configuring ACL's 0.0.0.0 in the wildcard section is the same as specifying host and 255.255.255.255 is the same as saying any address.


                                Example:
                                All of the below ACL commands would result in all IP traffic being permitted.

                                access-list 111 permit IP any any

                                access-list 111 permit IP 0.0.0.0 255.255.255.255 0.0.0.0 255.255.255.255

                                access-list 111 permit IP 0.0.0.0 255.255.255.255 any
                                access-list 111 permit IP any 0.0.0.0 255.255.255.255
                                access-list 111 permit IP 192.168.2.5 255.255.255.255 52.62.1.23 255.255.255.255 < not much point in this line but you get the idea.

                                 

                                Luke

                                • 13. Re: Special IP addresses
                                  cadetalain

                                  Hi,

                                  1) windows APIPA aka IPv4 link-local aka 169.254.x.x/16 is not 0.0.0.0

                                     0.0.0.0 is unspecified address used when a client without any IP first tries to contact  a DHCP server

                                  2) in wildcard mask: a zero is a "care bit" and a 1 is a "don't care" bit

                                      so 0.0.0.0 means match all bits so= host and 255.255.255.255 means don't care

                                     to match any bits = any

                                    so you could put any ip address with a wildcard mask of all 1s it still would mean any, the IP address is just a placeholder.

                                   

                                  Regards.

                                   

                                  Alain

                                  • 14. Re: Special IP addresses
                                    Nadeem

                                    Luke and Alain, thank you so much, your aswers cleared up many things in my head.

                                    Again, thank you.