LinuxQuestions.org
Visit Jeremy's Blog.
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 02-11-2006, 01:35 PM   #1
ALInux
Member
 
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676
Blog Entries: 7

Rep: Reputation: 32
Question ping through a specific interface


I want to ping through a specific interface...I looked up man ping...and from what I read I must:

ping -I "desired interface" www.google.com

But Iam a little bit confused about the result I got "never mind about that" can anybody confirm the above command ??
 
Old 02-11-2006, 02:10 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
works fine for me...

Code:
ping -I eth1 google.com

ping -I eth2 google.com
etc... etc... etc...
 
Old 02-11-2006, 02:14 PM   #3
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
I can run ping -I ppp0 www.google.com and get replies - I can also run ping -I eth0 www.google.com and get destination host unreachable messages. What was the exact command you ran?
 
Old 02-11-2006, 03:20 PM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
BTW, when i said "works fine" i did of course mean that i'd get echo replies when pinging google.com through my internet interface, and a " Destination Host Unreachable" message when pinging it through my LAN interface - which is exactly what is supposed to happen - and is the reason i know the command "works fine"...
 
Old 02-12-2006, 06:58 AM   #5
ALInux
Member
 
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676

Original Poster
Blog Entries: 7

Rep: Reputation: 32
when I do ping www.google.com or ping -I ppp0 www.google.com ....the ping command resolves the IP and that is it it just sits and replies nothing at all....
so I tried ping -I ppp0 -c 3 -W 10 www.google.com

[root@localhost Desktop]# ping -I ppp0 -c 3 -W 30 www.google.com
PING www.l.google.com (66.249.93.99) from 11.0.5.218 ppp0: 56(84) bytes of data.

--- www.l.google.com ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms

Any remedy for this issue ? I need it to check my connection
 
Old 02-12-2006, 12:37 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Do you have a firewall that could be dropping the packets?
 
Old 02-12-2006, 03:42 PM   #7
ALInux
Member
 
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676

Original Poster
Blog Entries: 7

Rep: Reputation: 32
highly unlikely that it is something on my part...I checked my firewall and windows ping times out
 
Old 02-12-2006, 03:45 PM   #8
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
so it doesn't work from windows either?? are you sure your ISP isn't filtering PINGs??
 
Old 02-13-2006, 03:42 AM   #9
ALInux
Member
 
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676

Original Poster
Blog Entries: 7

Rep: Reputation: 32
Well ...that is most propably the case...anyway to overcome that hurdle..I was trying to implement a script to check if my connection is up...since teh debian box has no monitor ...I use ssh...so that does not seem to help me out alot..
 
Old 02-11-2010, 11:52 AM   #10
web_developer
LQ Newbie
 
Registered: Feb 2010
Posts: 1

Rep: Reputation: 0
I found the following worked on Debian.

ping -I <from-ip-address> <destination>

For example, if I have 2 cards in my machine
I can use:

ping -I 192.168.1.1 www(dot)google(dot)com

and

ping -I 192.168.1.2 www(dot)google(dot)com

My 2 cards would of course be assigned
192.168.1.1 and 192.168.1.2 IP addresses
in this example.
 
  


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
ssh forwarding : bind to a specific interface flupke Linux - Networking 9 12-09-2011 05:24 PM
Kernel programming - rerouting packets to a specific interface Solemn Phoenix Linux - Networking 2 08-16-2004 12:15 PM
Can't ping anywhere past the external interface! Ironica Linux - Networking 2 05-25-2004 04:57 PM
Traffi forcing on a specific interface kbassyouny Linux - Software 0 07-04-2003 04:53 AM
limiting bandwidth on a specific network interface. Passive Linux - Networking 3 05-01-2002 04:20 AM

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

All times are GMT -5. The time now is 11:38 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