Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am following the guide here to configure a fresh Ubuntu 12.04 server installation (running in VirtualBox) with a static IP address. The recommended configuration in /etc/network/interfaces is:

auto lo
iface lo inet loopback


auto eth0
iface eth0 inet static
    address 192.168.1.100
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255
    gateway 192.168.1.1

Due to my router, I will be giving the server the address 192.168.1.55, and the gateway will be 192.168.1.254 (which is the IP of my BT HomeHub), and the Netmask is fine as it is.

But I'm interested to know: What are the functions of 'network' and 'broadcast' here?

Can I leave these as they are in the example above, or do they need to point somewhere specific based on my home network?

share|improve this question

closed as off topic by Michael Hampton, Magellan, HopelessN00b, pauska, EEAA Nov 1 '12 at 14:13

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

up vote 6 down vote accepted

network here is for network ID, and broadcast is an IP broadcast address.

Both addresses can be calculated* from the ip and the network mask, and don't have to be written to the config, but sometimes it's easier for the admin to see them there, and not have to calculate them (it's simple with /8, /16, /24 networks, but on a sleepless coffeeless night, calculating this for a /27 is error-prone).

Since both your network and netmask are same as the example, you can leave them the same as in the example config, or remove them.

*if you do a logical AND: IP && netmask, you get a network ID. If you swap all the zeros right of the netmask to 1s (binary ofcourse), you get the broadcast address.

share|improve this answer
1  
I have seen a package that created a hook in the if-up scripts that got wonky when the network/broadcast wasn't explicitly set, but that was back in the Deb 3.1 days. I am pretty sure that package got fixed. There is a slight possibility that some other tool still exists that might require them to be set. Though you can probably leave them unset, and add them if you are running something that needs them. –  Zoredache Oct 31 '12 at 19:32
    
Thanks, that's very helpful. –  Ade Oct 31 '12 at 21:31

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