LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Linux IP forwarding question (https://www.linuxquestions.org/questions/linux-networking-3/linux-ip-forwarding-question-213995/)

odomae 08-05-2004 06:02 PM

Linux IP forwarding question
 
I have a linux machine with 3 NIC cards on it.
I want to be able to forward packets from eth3 to eth2 .
I have ip forwarding enabled in the /sys/net/ipv4/ip_forward file.
IP address of eth2 : 1.1.1.1
IP address of eth3 : 2.2.2.2

I set up the routing table .

I have ethereal listening on eth1 . I used a traffic generator to send pkt to eth2.
But I dont see the pkt on eth1.

What am I missing?

win32sux 08-05-2004 06:47 PM

what happened to eth0???

odomae 08-05-2004 07:04 PM

I am not using eth0 at all - I just need forwarding between eth1 and eth2.

jdelaros1 08-06-2004 08:06 AM

This is what I do to enable forwarding, I have 2 NICs, eth0 and eth1, and I forward packets back and forth between them (I'm running Fedora, don't know if it matters):

1. Modify in /etc/sysctl.conf:
net.ipv4.ip_forward = 0 to net.ipv4.ip_forward = 1

2. Create /etc/sysconfig/network-scripts/ifcfg-ethX:
The important entry is: GATEWAYDEV=ethY

Create /etc/sysconfig/network-scripts/ifcfg-ethY:
The important entry is: GATEWAYDEV=ethX

- where X and Y are the 2 interfaces you're forwarding packets between

3. Add to /etc/sysconfig/network:
FORWARD_IPV4 = yes

4. Modify /proc/sys/net/ipv4/ip_forward:
Change to 1

odomae 08-06-2004 10:32 AM

I will try this out. I can't connect the 2 interfaces using crossover (since I need to pump traffic into eth2 from a traffic generator). So can I connect the 2 interfaces through a switch?
And, I need to set up the routing table too, right?


All times are GMT -5. The time now is 03:07 PM.