Subject: Re: how to get FreeBSD ping.c into NetBSD?
To: None <>
From: David Young <>
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).


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.


David Young             OJC Technologies      Urbana, IL * (217) 278-3933