LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-06-2012, 03:24 AM   #1
minipop4747
LQ Newbie
 
Registered: Sep 2011
Posts: 5

Rep: Reputation: Disabled
Thumbs up ping to destination ip by using source ip


I want to ping destination public ip using source ip in the command line

How can i do that ?
 
Old 09-06-2012, 04:33 AM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,254

Rep: Reputation: 314Reputation: 314Reputation: 314Reputation: 314
You can use iptables SNAT, for example
Code:
iptables -t nat -A POSTROUTING -p icmp -d destination_ip_here -j SNAT --to-source source_ip_here
But few things you should known. Pings will not return to your host, but will or will not be delivered to your spoofed IP, it depends on security settings. If you use private IP range, routers will not route packets to hosts on public IP. Your router/provider can block spoofed source addresses and alert administrator about anomalies on network. You can be easily tracked down if you cause harm to other system.

Last edited by eSelix; 09-06-2012 at 06:15 PM.
 
Old 09-06-2012, 11:34 AM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 16,883

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
Dual post??

Last edited by jefro; 09-06-2012 at 11:36 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Ping a destination server passing by a certain gateway madpsycho Linux - Networking 2 11-16-2011 11:42 AM
Ping: Destination Host Unreachable parashuram2011 Linux - Networking 3 10-21-2011 03:27 PM
Fedora 14, Ping: Destination host unreachable The Godfather Linux - Networking 1 05-06-2011 02:21 PM
ssh, ping and Destination Port Unreachable noir911 Linux - Server 5 04-02-2009 12:44 AM
when ping I get Destination host unreachable Fuzia Linux - Networking 1 06-19-2006 01:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:43 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration