[lkml]   [2005]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Where do packets sent to go?
Hi Eric,

>> If I understand correctly, packets sent to the all-ones
>> broadcast address only go out through a single interface.
> I have some blur memories about this kind of issue, so my
> answer my be wrong on some points...

It turns out you are exactly right on all points. :-)

>> My question is threefold:
>> 1. Why doesn't Linux send packages
>> through all network interfaces? (I realize that
>> this is probably not a Linux-specific question.)
> IIRC, Linux treats as a normal IP address.
> Therefore it will follow the route for such an address and
> select the interface it is associated (probably eth0 if
> you are on a LAN).

That makes a lot of sense, and it appears to be the case.

>> 2. How does it choose which interface to send through?
>> My first guess was that it just took the first
>> Ethernet interface and used that for broadcasting.
>> But playing around with nameif, this seems not to
>> be the case.
> cf 1
>> 3. Can I set the default broadcast interface explicitly?
>> For example, say I wanted broadcasts to go out over
>> eth1 by default, instead of over eth0. What if I
>> wanted them to get sent through tap0?
> Again, I'm not sure, but I think that you can force the
> interface by adding a special route for IP
> and with mask to the interface you want.

Yes, this works! It's so simple --- I can't believe I
didn't try it before. I did mess around with iptables,
trying to add some weird PREROUTEing DNAT that would
redirect the packets, but I didn't know what I was doing.

> Hope this help, even if my memory is a bit confused,

Yes, it did help. Thanks a bunch, Eric! Your memory seems
to be in great shape. :-)


Daniel Brockman <>

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-08-25 12:06    [W:0.029 / U:15.204 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site