LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-10-2011, 09:33 AM   #1
zealer
LQ Newbie
 
Registered: Apr 2010
Distribution: Fedora
Posts: 10

Rep: Reputation: 0
ping question


Hello everyone

I have a machine that is connected to two different ISP's. One of them is currently my default GW, the other one is unused.

I need to constantly ping a known internet host (e.g. google) through each of these ISPs. I was pretty confident that a script that loops through 'ping -I interface_1 8.8.8.8' and 'ping -I interface_2 8.8.8.8' will do the job.

But it turned out that my ping always transmits packets from the egress interface (that has the default route configure). This is useless for me - I cannot change the default gateway everytime the loop continues. My internet connection would suffer greatly from this.

How can I ping an internet host from two different interfaces?

Thank you in advance,
Simeon
 
Old 11-10-2011, 09:55 AM   #2
zealer
LQ Newbie
 
Registered: Apr 2010
Distribution: Fedora
Posts: 10

Original Poster
Rep: Reputation: 0
maybe some pf trick could do the job?

Last edited by zealer; 11-10-2011 at 10:10 AM.
 
Old 11-10-2011, 10:16 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Would you like to share the solution in case someone else has a similar requirement?
 
Old 11-10-2011, 10:40 AM   #4
zealer
LQ Newbie
 
Registered: Apr 2010
Distribution: Fedora
Posts: 10

Original Poster
Rep: Reputation: 0
it was not a solution

i got confused because it seemed to work. But actually it's not doing what I need it to do: ping from 2 different interfaces...
 
Old 11-10-2011, 07:43 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,976

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
You have to change the default gateway or set a rule that directs activity to a route based on ip range or single ip setup.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Ping Issue - Can't ping localhost but can ping others on LAN code_slinger Linux - Networking 15 03-30-2015 02:39 PM
I cannot ping with command 'ping IP' address but can ping with 'ping IP -I eth0' sanketmlad Linux - Networking 2 07-15-2011 05:32 AM
Simple question about command syntax ping/log ping results ohalnet Linux - Networking 1 07-25-2006 04:46 AM
Ping question mikeshn Linux - Networking 2 06-01-2003 07:42 PM
Question about ping. jayakrishnan Linux - General 2 04-10-2002 01:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration