Solved

fping with source interface

Posted on 2002-04-02
8
983 Views
Last Modified: 2008-02-26
Does anyone know how to use fping with different source interface (different source ip)?
0
Comment
Question by:cheechew
  • 5
  • 2
8 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6914294
AFAIK not possible
0
 
LVL 16

Expert Comment

by:The--Captain
ID: 6915246
Sure it is - why not

route add -host <host-to-fping> dev <desired-source-interface>

or

route add -host <host-to-fping> gw <gateway-for-desired-interface>

?

As long as <desired-source-interface> is connected to a network that can reach <host-to-fping> (1st example), or each different interface is on a different subnet and each subnet has a <gateway-for-desired-interface> that will route packets to <host-to-fping> (2nd example), I would think that the routing subsystem would take care of this for you...

I know the 2nd example works - haven't yet tried the 1st example...

-Jon

0
 
LVL 1

Author Comment

by:cheechew
ID: 6915311
I don't need to add route, all IP are on the same subnet with single physical interface. I am using fping to do ping.
0
 
LVL 16

Expert Comment

by:The--Captain
ID: 6916613
Sigh - why are you so willing to dismiss my ideas without trying them?  I have verified that my 1st example will work, with the addition of one more argument.

You need to use

route add -host <host-to-fping> gw <my-default-gateway> dev <interface-with-desired-IP>

One you add this route, all fpings to <host-to-fping> will go out with s source of <interface-with-desired-IP>.

I've tried it - it works (source IP verified with tcpdump).

No go try it, and don't tell me it won't work, because I just confimed it does.

-Jon

P.S.  Why bother asking for help, if you are so sure of what will work and what will not?

0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 16

Accepted Solution

by:
The--Captain earned 50 total points
ID: 6917429
Also, if both src and dest hosts are on the same subnet, my 1st original example will suffice.

I was sooooo tempted to post this as an "answer", since I am actually %100 sure one of the examples I provided will work if properly implemented, but I will refrain in the interests of the community.

cheechew - I didn't become a top-ten topic expert in this TA (linux networking) because I am clueless - In fact, I support myself financially via my own independant consulting service parceling out just such tidbits of knowledge.  Please try my advice.  Not every answer is the one you expect.  In this case, I think you expected specific arguments to fping - sorry, can't help you there.  What I *did* provide was another way to do the same thing.

Also, if you just want to restrict your route mangling to icmp, try policy routing using the iproute2 tools...

-Jon

P.S.  I also know this works because in addition to my tests performed yesterday, I have used exactly the same tactics to get around specific-IP blackholes against a multihomed host, when such a host was accidentally blocked on its primary IP, but not on its secondary IPs.

0
 
LVL 1

Author Comment

by:cheechew
ID: 6922547
Yes, it is a brilliant solution. Even fping do not have the capibility, but we can play around the route on the OS itself. I have tried on specifying both source gw interface and ip, but have not try on only specifying either of them.
0
 
LVL 16

Expert Comment

by:The--Captain
ID: 6923523
I am not sure if I would call it a "brilliant" solution, but I am confident as to its feasibility.  Let me know how it goes (and yes, you are correct, if I properly perceive the eventual conclusion to your statements) - this trick can indeed be used on any network tool in a similar situation (in which the user needs to specify the src addr, but the tool does not support configuration of the src addr via a direct argument).  As long as the network tool in question does not circumvent the routing subsystem function calls, the tool should correctly choose the proper outbound address on which to bind, given the according associations within the routing table.

Cheers,
-Jon

0
 
LVL 16

Expert Comment

by:The--Captain
ID: 6964973
Thanks!

-Jon
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now