Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have googled for some time now and i have found a lot of different answers to what the IP address 0.0.0.0 actually is. Its seems like this address has different meaning depending on how it is used.
These are some of the explanations i found:
- The IP address 0.0.0.0 specifies all IP addresses on all interfaces on the system
- It specifies that you dont have any IP address
- It is the IP address you have before you get an IP address from DHCP, using 0.0.0.0 as the source address when sending a broadcast
- It is the default route
This makes me a little confused. I see this address in netstat, server configs, routing tables and more. What is the actual meaning of the 0.0.0.0 IP address ?
frieza: are you nullrouting packets sent to these domains to the 0.0.0.0 address? If so, wouldnt they just be sent through the default route specified in the kernel routing table since you use 0.0.0.0 (since this address means the default route in the ip routing table)?
In the case when using netstat, would the following line mean that all ip addresses on the machine is listening on TCP port 32773 ?
Code:
Proto Recv-Q Send-Q Local Address Foreign Address Stat
tcp 0 0 0.0.0.0:32773 0.0.0.0:* LISTEN
If so, then i dont really understand the column where it says "0.0.0.0:*" because this is set in the "foreign address" column. The syntax isnt a problem, i guess it listens on all ports on all IP addresses(?), but why would there be anything in this column at all, should it only be an address in the "local address" field ?
I also have problems understanding what the 0.0.0.0 address means when using the route command, example output:
Code:
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
84.215.0.0 0.0.0.0 255.255.192.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 84.215.0.1 0.0.0.0 UG 0 0 0 eth1
From what i understand the routing table says that, if a packet is sent to the 84.215.0.0 net it should be sent to 84.215.0.1 ?
I have a few more questions regarding my 4th post. I understand that the local address 0.0.0.0 in netstat means that all IP addresses is listening on port 32773, but i dont understand why there is an IP address of 0.0.0.0 in the foreign address field when this is just a listening socket, could someone explain ?
When it comes to the route command, from my understanding the 0.0.0.0 is the default route, so when it displays that the "Destination" address is "84.215.0.0 and the "Gateway" address is "0.0.0.0" ..and there is a default route of "0.0.0.0", does this mean that all packets sent to the 84.215.0.0 net goes to the default route 0.0.0.0 which is 84.215.0.1 ?
Is 0.0.0.0 a valid IP address or not, seems like it kind of is, yet not really.
Wow! Dredging up really OLD threads, eh? Afraid to start a new one?
"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 "::").
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.