Endereço IP 0.0.0.0 é usado ou não? [duplicado]

1

Eu realmente me pergunto se um endereço IP com todos os seus bits desligados pode ser usado ou não. Por favor, responda se você sabe onde é usado ou não pode ser usado.

    
por Chirag 25.01.2015 / 08:22

2 respostas

7

Referência Endereços IP com significados especiais :

0.0.0.0

“Me”: (Alternately, “this host”, or “the current/default host”). Used by a device to refer to itself when it doesn't know its own IP address. The most common use is when a device attempts to determine its address using a host-configuration protocol like DHCP. May also be used to indicate that any address of a multihomed host may be used.

Referência Qual é o significado do endereço IP 0.0.0.0 :

"0.0.0.0" is a valid address syntax. So it should parse as valid wherever an IP address in traditional dotted-decimal notation is expected. Once parsed, and converted to workable numeric form, then its value determines what happens next.

The all-zero value does have a special meaning. So it is "valid", but has a meaning that may not be appropriate (and thus treated as not valid) for particular circumstances. It is basically the "no particular address" placeholder. For things like address binding of network connections, the result can be to assign an appropriate interface address to the connection. If you are using it to configure an interface, it can remove an address from the interface, instead. It depends on the context of use to determine what "no particular address" really does.

In the context of a route entry, it usually means the default route. That happens as a result more of the address mask, which selects the bits to compare. A mask of "0.0.0.0" selects no bits, so the compare will always succeed. So when such a route is configured, there is always somewhere for packets to go (if configured with a valid destination).

In some cases, merely "0" will also work and have the same effect. But this is not guaranteed. The "0.0.0.0" form is the standard way to say "no particular address" (in IPv6 that is "::0" or just "::").

Referência 0.0.0.0 :

In the Internet Protocol version 4 the address 0.0.0.0 is a non-routable meta-address used to designate an invalid, unknown or non applicable target. To give a special meaning to an otherwise invalid piece of data is an application of in-band signaling.

Uses include:

  • The address a host claims as its own when it has not yet been assigned an address. Such as when sending the initial DHCPDISCOVER
    packet when using DHCP.
  • The address a host assigns to itself when address request via DHCP has failed, provided the host's IP stack supports this. This usage has been replaced with the APIPA mechanism in modern operating
    systems.
  • A way to specify "any IPv4-host at all". It is used in this way when specifying a default route.
  • A way to explicitly specify that the target is unavailable.1
  • A way to specify "any IPv4 address at all". It is used in this way when configuring servers (i.e. when binding listening sockets). This is known to TCP programmers as INADDR_ANY. (bind(2) binds to
    addresses, not interfaces.)

In IPv6, the all-zeros-address is written as "::".

Descoberta / solicitação de DHCP:

Referência Compreensão e solução de problemas do DHCP no Catalyst Switch ou Enterprise Networks

When a client boots up for the first time, it is said to be in the Initializing state, and transmits a DHCPDISCOVER message on its local physical subnet over User Datagram Protocol (UDP) port 67 (BootP server). Since the client has no way of knowing the subnet to which it belongs, the DHCPDISCOVER is an all subnets broadcast (destination IP address of 255.255.255.255), with a source IP address of 0.0.0.0. The source IP address is 0.0.0.0, since the client does not have a configured IP address. If a DHCP server exists on this local subnet and is configured and operating correctly, the DHCP server will hear the broadcast and respond with a DHCPOFFER message. If a DHCP server does not exist on the local subnet, there must be a DHCP/BootP Relay Agent on this local subnet to forward the DHCPDISCOVER message to a subnet that contains a DHCP server.

This relay agent can either be a dedicated host (for example, Microsoft Windows Server), or router (for example, a Cisco router configured with interface level IP helper statements).

...

After the client receives a DHCPOFFER, it responds with a DHCPREQUEST message, indicating its intent to accept the parameters in the DHCPOFFER, and moves into the Requesting state. The client may receive multiple DHCPOFFER messages, one from each DHCP server that received the original DHCPDISCOVER message. The client chooses one DHCPOFFER and responds to that DHCP server only, implicitly declining all other DHCPOFFER messages. The client identifies the selected server by populating the Server Identifier option field with the DHCP server's IP address. The DHCPREQUEST is also a broadcast, so all DHCP servers that sent a DHCPOFFER will see the DHCPREQUEST, and each will know whether its DHCPOFFER was accepted or declined. Any additional configuration options that the client requires will be included in the options field of the DHCPREQUEST message. Even though the client has been offered an IP address, it will send the DHCPREQUEST message with a source IP address of 0.0.0.0. At this time, the client has not yet received verification that it is clear to use the IP address.

...

Client-Server Conversation for Client Obtaining DHCP Address Where Client and DHCP Server Reside on Same Subnet

enter image description here

Rota padrão:

Referência Configurando um gateway de Último recurso usando comandos de IP

This document explains how to configure a default route, or gateway of last resort. These IP commands are used:

  • ip default-gateway

  • ip default-network

  • and ip route 0.0.0.0 0.0.0.0

ip route 0.0.0.0 0.0.0.0

Creating a static route to network 0.0.0.0 0.0.0.0 is another way to set the gateway of last resort on a router. As with the ip default-network command, using the static route to 0.0.0.0 is not dependent on any routing protocols. However, ip routing must be enabled on the router.

Note: IGRP does not understand a route to 0.0.0.0. Therefore, it cannot propagate default routes created using the ip route 0.0.0.0 0.0.0.0 command. Use the ip default-network command to have IGRP propagate a default route.

    
por 25.01.2015 / 09:41
0

Obrigado por investigar, mas encontrei a resposta. Para o seu conhecimento e o meu também, gostaria de dizer que o endereço IP 0.0.0.0 é usado quando uma nova rede é formada e o servidor DHCP está ligado nessa rede, então como uma nova rede nenhuma das estações de trabalho está tendo IP próprio, portanto, para configurar e obter o computador IP gera o pacote com o IP de origem 0.0.0.0 e este pacote é recebido automaticamente para o servidor DHCP como por configuração.

    
por 25.01.2015 / 09:18

Tags