Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Suppose I use ifconfig or some similar command to setup my network interface, and I assign 0.0.0.0 to the mask parameter. Does it have a special meaning? What implications could this have?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

0.0.0.0 generally means that the network interface isn't bound to any network at all, not even localhost requests will be acknowledged. If anything it's a way of the operating system to present the interface as available but inactive and un-routed.

share|improve this answer
    
Would ARP Request from the host owning said interface work? –  dario_ramos Jul 3 '11 at 21:58
    
I don't think it would, it doesn't in Windows in any case. –  Ruairi Fullam Jul 3 '11 at 22:10

From ArsTechnica:

Think of a subnet mask as a filter for outbound traffic. The subnet mask helps the IP protocol decide which is local "LAN" traffic and what traffic needs to be forwarded to a router.

In effect a 0.0.0.0 subnet mask would make it so all outbound traffic is 'local' and nothing will ever be forwarded to a router. This configuration should work fine if there is no router (aka Default Gateway) on the network.

If you do need to route you can always add static routes on the house by using the ROUTE ADD command (Windows, other OS's should have the same/similar command).

In this case (with a few edits for brevity). I can add a /0 or 0.0.0.0 netmask to an interface, and it will work on loopback and link-local:

root@host:/tmp# ip addr add 10.0.0.0/0 dev eth0
root@host:/tmp# ip addr show
root@host:/tmp# ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> ...
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> ...
    link/ether fe:dc:ba:98:76:54 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.0/0 scope global eth0
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> ...
    link/ether 01:23:45:67:89:ab brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.5/24 brd 192.168.1.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::226:c6ff:fe4b:e38e/64 scope link 
       valid_lft forever preferred_lft forever
root@host:/tmp# ping 10.0.0.0
PING 10.0.0.0 (10.0.0.0) 56(84) bytes of data.
64 bytes from 10.0.0.0: icmp_seq=1 ttl=64 time=0.033 ms
64 bytes from 10.0.0.0: icmp_seq=2 ttl=64 time=0.036 ms
^C
--- 10.0.0.0 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.033/0.034/0.036/0.006 ms
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.