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 11-19-2010, 02:25 AM   #1
chayan.ju
LQ Newbie
 
Registered: Nov 2010
Posts: 6

Rep: Reputation: 0
Packet Redirecting to another interface of the box


Hi,

I have to interfaces eth0(10.0.0.7) and wlan1(10.0.0.8) in my box. An application is listening (say, udp socket) at 10.0.0.7:5888.

Now if someone sends packet at 10.0.0.8:5888, I want to forward them to 10.0.0.7:5888.

I have tried this -
iptables -t nat -A PREROUTING -p udp --dport 5888 -d 10.0.0.8 -j DNAT --to-destination 10.0.0.7

But Packets(with destination addr 10.0.0.8) are not received by the application (But they are received by the box, I have checked using wireshark). I have also enabled ip_forwarding.

Am I doing anything wrong? Please suggest accordingly.

Any other suggestion (without using iptable) is also welcome.

Chayan
 
Old 11-19-2010, 12:37 PM   #2
user100
Member
 
Registered: Aug 2010
Posts: 64

Rep: Reputation: 0
Change or add a port to 10.0.0.7:

Code:
--to-destination 10.0.0.7:5888
I'm not sure about the application though. Can it receive those packets and analyze it though...?

But in any case this is how it should forward traffic from 10.0.0.8:5888 to 10.0.0.7:5888.
 
  


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
packet coming through one interface route out via another interface and SNAT also saiyen2002 Linux - Networking 2 09-14-2009 06:56 PM
Packet Sniffer Box amadkow Linux - Networking 5 01-09-2006 02:40 PM
why i see same packet twice on network interface? cranium2004 Linux - Networking 6 11-26-2004 09:42 AM
How to get the IP header of packet going through an interface thanh Programming 1 06-12-2004 12:26 PM
packet reception by virtual network interface seeker321in Linux - Networking 0 04-19-2002 01:48 PM

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

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