LinuxQuestions.org
Register a domain and help support LQ
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 09-27-2005, 12:14 PM   #1
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,133

Rep: Reputation: 45
iptables forward traffic


Let me reexplain the problem plz
From src 143.233.222.253 starts some traffic that goes to the 143.233.222.77 this is the eth1 of the laptop
The laptop has also one more interface the 10.2.4.1 that is connected back to back (cross cable) with the interface of an other pc with ip address 10.2.4.2
IO want the traffic that reaches 143.233.222.77 reach the 10.2.4.2
This is the first step.. when i succesfully implement this then the next step is to forward this traffic from the pc to a second pc... ( i ll use the same methodology if step one works)
So now we can only focus to the first step
Plz take in mind that i dont have any firewall enables
/proc/sys/net/ipv4/ip_forward is set to 1. I have no other iptables rules applied... I will only apply what u ll write to do..
Before applying any iptables rules firstly i do
iptables -F
iptables -F -t nat
(if more flush commands are necessary plz say it so)
So i need your help to implement this simple task
 
Old 09-28-2005, 05:43 AM   #2
SkyEye
Member
 
Registered: Sep 2005
Location: Sri Lanka
Distribution: Fedora (workstations), CentOS (servers), Arch, Mint, Ubuntu, and a few more.
Posts: 441

Rep: Reputation: 40
Let's try to sort this. I assume your default policies are all set to ACCEPT. Use "iptables -L" to check this. Your flushing shoul be OK. If not you will see rules in the output of "iptables -L"

Then try this
Code:
iptables -t nat -A PREROUTING -i eth1 -j DNAT --to-destination 10.2.4.2
This shoul have immediate effect. No service to restart.

What this does is just change the destination (to 10.2.4.2) of the packets which reach the interface eth1 (143.233.222.77)
 
  


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
How can I forward all traffic to 10.10.0.10:80 to 10.10.0.20:8080 using IPtables? abefroman Linux - Networking 1 10-06-2005 04:19 PM
iptables FORWARD Ipolit Slackware 16 06-09-2005 05:35 PM
iptables forward? Bambi Linux - Security 2 10-02-2003 11:15 AM
Trying to forward web traffic through firewall w/ IPTABLES ShinySteelRobot Linux - Networking 6 08-17-2003 06:43 PM
iptables FORWARD ArnaudVR Linux - Security 6 07-07-2003 06:05 PM


All times are GMT -5. The time now is 06:18 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration