LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-12-2010, 10:59 AM   #1
mwjones
Member
 
Registered: Mar 2010
Posts: 31

Rep: Reputation: Disabled
IP catch-all?


Long time reader, first-time poster.

I'm setting up a malware analysis lab, and want to have all network traffic redirect to a Linux box. The DNS part of it has been figured out with bind9. But I'm having trouble figuring out how to route all IP traffic.

For example, if my Linux box is 10.1.1.1, and a system wants to communicate to 1.2.2.3, how do I make it believe 1.2.2.3 and 10.1.1.1 are the same? My initial guesses were iptables or maybe the route or ip commands, but thus far I have not been able to figure it out.

Many TIA!
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-12-2010, 03:50 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
You should be able to just use the redirect module, just like it's often used for a transparent proxy.

iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 100:200 -j REDIRECT --to-ports 100-200

Last edited by acid_kewpie; 03-12-2010 at 03:53 PM.
 
2 members found this post helpful.
Old 03-17-2010, 08:58 AM   #3
mwjones
Member
 
Registered: Mar 2010
Posts: 31

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by acid_kewpie View Post
You should be able to just use the redirect module, just like it's often used for a transparent proxy.

iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 100:200 -j REDIRECT --to-ports 100-200
Thanks! I actually found a smaller rule caught everything for me, including UDP, ICMP, etc.

Code:
iptables -t nat -A PREROUTING -i eth1 -j REDIRECT
Exactly what I needed. Thanks again!
 
  


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
why not use try and catch? lindylex Programming 5 01-21-2008 06:10 PM
rpm catch 22 littauer99 Red Hat 7 12-19-2004 02:46 PM
try catch(...) Sinner6 Linux - Newbie 3 06-25-2004 09:22 AM
Catch signals C++ moyacuba Programming 2 03-18-2004 12:28 PM
Well...I'll catch you all later... Whitehat General 30 03-11-2004 09:32 PM

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

All times are GMT -5. The time now is 07:26 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
Open Source Consulting | Domain Registration