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.

I understood the interface file in linux needs to be edited and the corresponding lines added.

I don't understand what network and broadcast are for, it seems extra versus a windows static ip configuration. In my case my gateway is 192.168.5.1 and my machine ip is 192.168.5.101, what would be my network and broadcast address, is the below correct and what exactly do they mean?

iface eth0 inet static
       address 192.168.5.101  
       gateway 192.168.5.1
       netmask 255.255.255.0
       network 192.168.5.0
       broadcast 192.168.5.255
share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

As you can see from the official documentation, those parameters (network and broadcast) are not required.

In fact,

(network, broadcast and gateway are optional)

In your example, your network would be 192.168.5.0/24 and your broadcast 192.168.5.255. These can be derived from your address and netmask parameters. To understand these parameters and how to determine them, you need to read up on IP subnetting.

In my opinion, the network and broadcast parameters can usually be omitted.

Quick primer

In IP, you usually have an address (192.168.5.101) and a netmask (255.255.255.0).

The netmask explains how many of the bits in the address refer to the network and how many refer to the host. In this example, it's 24bits (that's what the netmask means, and that's what the /24 means which you often see in this context).

These 24bits are exactly the 192.168.5 part of your address. This means, all machines with an address, that starts with 192.168.5 and a netmask of /24, are in your same network.
The remaining part (the 101) is your host part. It identifies your single machine.

When taking an address and fill the host part with zeros (in binary), that is equivalent to the network (so, 192.168.5.0). If you fill the host part with ones (in binary), you get the default broadcast address (192.168.5.255).

enter image description here
Source

share|improve this answer
    
I just ran some tests it seems there's a consistent 1ms slower response with a ping when they are not there –  user64908 Jul 5 '12 at 15:12
1  
@user64908, a performance difference seems extremely unlikely. The applied network configuration will be exactly the same unless you supplied and invalid/unusual network/broadcast. –  Zoredache Jul 5 '12 at 16:08
add comment

The network and broadcast values are details of your subnet setup. I'm a bit rusty on this but the config you have above seems correct.

If you want to find out more about the Broadcast address and Network mask then I'd suggest reading up on subnetting: http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a00800a67f5.shtml and http://en.wikipedia.org/wiki/IP_Subnetting#Subnetting

share|improve this answer
add comment

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.