Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-15-2012, 01:42 PM
|
#1
|
|
LQ Newbie
Registered: Jun 2010
Posts: 2
Rep:
|
Loop back IP packets to a NIC?
Hi Folks,
In order to do efficient bidirectional network testing, I would like to return all IP packets incoming to e.g. eth0, i.e. sapping source and destination address of all incomming packets and return them to eth0. Is this possible using iptables and NAT? Of course this can be done for a single port in user space but the gut feeling is that it should be possible and more efficient if done in the same way as conventional NAT.
Thanks
|
|
|
|
12-17-2012, 02:30 PM
|
#2
|
|
Guru
Registered: Mar 2008
Posts: 8,552
|
Create a loopback cable? Many loopback issues within a nic are not true full nic tests. The nic actually may never get the packet or only into half the nic and then returned to system.
|
|
|
|
12-19-2012, 10:18 AM
|
#3
|
|
LQ Newbie
Registered: Jun 2010
Posts: 2
Original Poster
Rep:
|
Well, a loopback cable is not really IP-savy.
I tried:
iptables -t nat -A PREROUTING -p tcp -m tcp -d 192.168.1.3 -j DNAT --to-destination 192.168.1.4
where 192.168.1.3 is the reflector machine (the one I am issuing the command on) and 192.168.1.4 is the machine to receive the redirected packets, i.e. the sender. However, no success... (to test I telnet 192.168.1.3 and would expect to connect to 192.168.1.4)
Any better ideas or do I miss something?
|
|
|
|
01-04-2013, 02:17 AM
|
#4
|
|
Member
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 741
Rep:
|
IMO you need to do redirect port or call port forward for each program,
eg, telnet run on port 23 and create iptables rules this way
Code:
$IPT -t nat -I PREROUTING -p tcp -d 192.168.1.3 --dport 23 -j DNAT --to 192.168.1.4:23
or
$IPT -t nat -I PREROUTING -p tcp -d 192.168.1.3 --dport 23 -j DNAT --to 192.168.1.4
try it
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:17 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|