-   Linux - Networking (
-   -   Bcast ever different on two eth0:* devices? (

cormander 12-29-2004 12:17 PM

Bcast ever different on two eth0:* devices?
I've gone through many linux servers on different networks configuring NIC cards, and I've noticed that every IP address on a single interface always has the same Bcast address.

This command:



It lists the "Bcast" address on each of the eth0 interfaces,




etc etc

Althought the Bcast address may change from server to server, I've never ever seen it different from interface to interface on eth0

Is it possible to ever be different? And if so, in what case?

The reason I ask is because I'm configuring my firewall to drop packets pretending to be from the broadcast address, and wondered if I ever had to worry about there being a different value, then from the one that I always see there, if we were to add another IP address on the box.


denver1980 01-05-2005 06:14 AM

No the broadcast address is standart.
In TCP/IP x.x.x.255 is for broadcast and x.x.x.0 is the netmask.

Basically, broadcast is a kind of call "Anybody there?" that can be use when a comp wakes up on a network with no IP address and wants to reach the DHCP server.

On the other hand, netmask is for "isolate" your IP address in a range of address.

cowanrl 01-05-2005 07:25 AM

The network address and broadcast address on an IP subnet are determined by the subnet mask. Lets say you have eth0 with an IP address of and a subnet mask of In this case, the network address is and the broadcast address is
However, if I were to change the subnet mask to, the network address stays at but the broadcast address is now

If the IP address is with a subnet mask of, the network address is and the broadcast address is

An IP address always has 2 parts, the network address and the host address. How much of the address is the network address and how much is the host address is determined by the subnet mask. If you look at the IP address from a binary standpoint, for any IP subnet, the network address always has all zeros for the host portion and the broadcast address always has all ones for the host portion. These 2 addresses cannot be assigned to any host on that subnet.

This is the TCP/IP standard and is how you should find it on any network. However, in Linux it is possible to change the IP broadcast address on any interface. If you wanted to for some reason, you could change the IP broadcast address on every host on the network and things will probably still work. However, your better off to leave things as the default.

More than likely your router is always going to detect the broadcast address as what it is for that subnet according to the subnet mask. Most, if not all routers, will block broadcasts by default.

If someone were to configure a host so that the broadcast address no longer has a host portion with all ones on that subnet, that address now becomes a unicast address and your router should treat it as such.

All times are GMT -5. The time now is 03:45 AM.