The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Daniel Brockman <daniel@brockman.se>
To: linux-kernel@vger.kernel.org
Subject: Re: Where do packets sent to 255.255.255.255 go?
Date: Thu, 25 Aug 2005 12:01:06 +0200	[thread overview]
Message-ID: <873boys5ct.fsf@wigwam.deepwood.net> (raw)
In-Reply-To: 430D7E8D.2070305@lifl.fr

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 255.255.255.255 packages
>>     through all network interfaces?  (I realize that
>>     this is probably not a Linux-specific question.)
>
> IIRC, Linux treats 255.255.255.255 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 255.255.255.255
> and with mask 255.255.255.255 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. :-)


Regards,

-- 
Daniel Brockman <daniel@brockman.se>


  reply	other threads:[~2005-08-25 10:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-25  1:02 Where do packets sent to 255.255.255.255 go? Daniel Brockman
2005-08-25  8:17 ` Eric Piel
2005-08-25 10:01   ` Daniel Brockman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-09-19  5:35 PATCH: Fix race in cpu_down (hotplug cpu) Nigel Cunningham
2005-09-19  7:43 ` Where do packets sent to 255.255.255.255 go? Wei-Che, Hsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873boys5ct.fsf@wigwam.deepwood.net \
    --to=daniel@brockman.se \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox