LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 04-03-2009, 02:43 PM   #1
exceed1
Member
 
Registered: Mar 2008
Location: oslo
Distribution: debian,redhat
Posts: 199

Rep: Reputation: 31
What is the meaning of the IP address 0.0.0.0


Hi

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 ?

All help is appericiated
 
Old 04-03-2009, 03:02 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
well they're all right in different scenario's. normally it basically means "anything", especially when accompanied with a /0 netmask.

context is your friend.
 
Old 04-03-2009, 03:19 PM   #3
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,077

Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
i have a hosts file that redirects unwanted web addresses to 0.0.0.0
eg
Code:
0.0.0.0	a.answers.com
0.0.0.0	richmedia.yahoo.com
0.0.0.0	ads.yimg.com
0.0.0.0	servedby.advertising.com
0.0.0.0	ad.doubleclick.net
0.0.0.0	img-cdn.mediaplex.com
0.0.0.0	us.adserver.yahoo.com
0.0.0.0 pixel.quantserv.com#
0.0.0.0 edge.quantserv.com
0.0.0.0	ads.web.aol.com
0.0.0.0 r1.beta.ace.advertising.com
0.0.0.0	pagead2.googlesyndication.com
0.0.0.0	gator.com
0.0.0.0	zedo.com
0.0.0.0	maxserving.com
0.0.0.0	targetnet.com
0.0.0.0	ads.targetnet.com
0.0.0.0	ad.targetnet.com
0.0.0.0	z1.adserver.com
0.0.0.0	jedonkey.cjt1.net
 
Old 04-03-2009, 04:36 PM   #4
exceed1
Member
 
Registered: Mar 2008
Location: oslo
Distribution: debian,redhat
Posts: 199

Original Poster
Rep: Reputation: 31
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 ?

Last edited by exceed1; 04-03-2009 at 04:46 PM.
 
Old 04-03-2009, 08:41 PM   #5
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,077

Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
yes i am null routing them, to block them out so when an ad site is requested it gets rerouted to 127.0.0.1
 
Old 04-04-2009, 09:39 AM   #6
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Rep: Reputation: 35
Quote:
Originally Posted by acid_kewpie View Post
context is your friend.
Can you expand on "context" please?

Is it Distro Specific?
 
Old 04-04-2009, 10:52 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
http://www.answers.com/context ;-)
 
Old 04-04-2009, 05:06 PM   #8
exceed1
Member
 
Registered: Mar 2008
Location: oslo
Distribution: debian,redhat
Posts: 199

Original Poster
Rep: Reputation: 31
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 ?
 
Old 02-27-2011, 11:11 PM   #9
patrickchavez32161
LQ Newbie
 
Registered: Feb 2011
Posts: 4

Rep: Reputation: 0
is 0.0.0.0 a valid IP address?

Is 0.0.0.0 a valid IP address or not, seems like it kind of is, yet not really.
 
Old 02-28-2011, 02:43 PM   #10
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by patrickchavez32161 View Post
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 "::").
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What are the meaning of these macros.. iamjayanth Linux - Kernel 1 12-10-2008 02:45 AM
The meaning of SU... custangro Linux - General 32 04-15-2007 01:59 PM
Meaning of -R, --g, -G shipon_97 Linux - Newbie 1 11-23-2006 11:02 AM
What is the meaning of 'linuxrc'? leonzheng Linux - Newbie 4 11-13-2006 09:04 AM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 04:33 AM


All times are GMT -5. The time now is 05:31 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration