hping wiki

hping outifa target

Return the address of the outgoing interface to reach target. Suppose you want to rewrite the ping program in hping, you need to know what is the interface used to send and receive packets for a given destination. The outifa subcommand does exactly this: it returns the IPv4 address of the outgoing interface for the target destination.
Assuming there are no bugs nor very strange configurations, the address returned will match at least one of the interface addresses returned with hping iflist. The implementation of this command may not work in all the cases in this beta version of hping.

hping3.0.0-alpha> hping outifa www.google.com
hping3.0.0-alpha> hping iflist
{lo 16436 {} {LOOPBACK}} {eth0 1500 {} {}}

As you can see is the eth0 unique address -- note that the host is configured with a as default gateway.

To write a Tcl procedure that returns the name of the interface with a given address is trivial, such a command (outifname) is included in the hping standard library hpingstdlib.htcl.
Edit this page Upload file Page history - Page last update: Wed Nov 24 05:28:02 GMT 2004 by | Your address: | Admin