LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Bcast ever different on two eth0:* devices? (https://www.linuxquestions.org/questions/linux-networking-3/bcast-ever-different-on-two-eth0-%2A-devices-271545/)

cormander 12-29-2004 11:17 AM

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:

Code:

/sbin/ifconfig

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

eth0

eth0:1

eth0:2

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.

-Corey

denver1980 01-05-2005 05: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 06: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 192.168.1.1 and a subnet mask of 255.255.255.0. In this case, the network address is 192.168.1.0 and the broadcast address is 192.168.1.255.
However, if I were to change the subnet mask to 255.255.255.224, the network address stays at 192.168.1.0 but the broadcast address is now 192.168.1.31.

If the IP address is 192.168.1.67 with a subnet mask of 255.255.255.224, the network address is 192.168.1.64 and the broadcast address is 192.168.1.95.

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 10:24 AM.