Solved

fping with source interface

Posted on 2002-04-02
8
1,076 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

 
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
 
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 Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

623 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