Subject: Re: how to get FreeBSD ping.c into NetBSD?
To: None <tech-net@NetBSD.org>
From: David Young <dyoung@pobox.com>
List: tech-net
Date: 11/22/2006 11:27:55
On Wed, Nov 22, 2006 at 06:17:15PM +0100, Gert Doering wrote:
> Hi folks,
> 
> today I was (again) in need of being able to "ping" with a specific source
> address, as opposed to "whatever interface the packet happens to leave via".
> 
> This is fairly regularily needed in environments where different source IPs
> are handled differently - for example due to IPSEC rules, or due to different
> firewall rules.
> 
> NetBSD ping doesn't have a "-S <src addr>" flag, while FreeBSD ping has
> - and just compiling the FreeBSD 6.x "ping.c" source on NetBSD made it 
> work (with two minor changes).

Gert,

ping -I does what you want, however, you wouldn't know it from reading
the manual page:

     -I ifaddr
             Send multicast datagrams on the network interface specified by
             the interface's hostname or IP address.

Dave

-- 
David Young             OJC Technologies
dyoung@ojctech.com      Urbana, IL * (217) 278-3933