Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Aug 2016 22:43:36 +0100
From:      Paul Thornton <paul@prt.org>
To:        freebsd-net@freebsd.org
Subject:   Re: How can I send packets to 255.255.255.255 from the command line?
Message-ID:  <6bc1bbb9-c530-92bc-8e26-6d4ca7e4ecb9@prt.org>
In-Reply-To: <CAFMmRNzG_Xo=D0szCSv3=SBnZEiKmsv3arw=32k1dSoftnRR_w@mail.gmail.com>
References:  <CAFMmRNwXKhNUg35eYS4bE4UZQxTrAhYDatnokDuMtTT33SUMwQ@mail.gmail.com> <20160818204822.GB18759@workvm.myhome> <CAFMmRNzG_Xo=D0szCSv3=SBnZEiKmsv3arw=32k1dSoftnRR_w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 18/08/2016 21:55, Ryan Stone wrote:
> On Thu, Aug 18, 2016 at 4:48 PM, Paul A. Procacci <pprocacci@datapipe.com>
> wrote:
>
>> You should be able to ping the local subnet.
>> Alternatively you can use net/arping.
>>
>> ~Paul
>>
>
> I'm specifically looking to test the handling of 255.255.255.255, so a
> local broadcast address is out.  Unfortunately, arping doesn't seem to do
> the right thing on FreeBSD.  It manages to get the kernel to try arp'ing
> for 255.255.255.255.

This very likely comes under the heading of "horrible bodges" but when I 
needed to do this, after much experimenting I added a static route to 
255.255.255.0/24 pointing to the local LAN broadcast address.

For example, on a machine with address 192.168.10.10/24 the "fix" would be:
route add 255.255.255.0/24 192.168.10.255

My code could then happily send UDP to 255.255.255.255 without issue, 
and the packets make it out onto the wire with a broadcast destination 
MAC address.

This was under 10.1-RELEASE; things may have changed that make it no 
longer work.

I did warn you that it came under the heading of "horrible bodges" :)

Paul.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6bc1bbb9-c530-92bc-8e26-6d4ca7e4ecb9>