LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   iptables forward traffic (https://www.linuxquestions.org/questions/linux-networking-3/iptables-forward-traffic-367520/)

alaios 09-27-2005 11:14 AM

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

SkyEye 09-28-2005 04:43 AM

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)


All times are GMT -5. The time now is 04:13 AM.