LinuxQuestions.org
Review your favorite Linux distribution.
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 08-05-2004, 06:02 PM   #1
odomae
LQ Newbie
 
Registered: Jun 2003
Posts: 10

Rep: Reputation: 0
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?
 
Old 08-05-2004, 06:47 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
what happened to eth0???
 
Old 08-05-2004, 07:04 PM   #3
odomae
LQ Newbie
 
Registered: Jun 2003
Posts: 10

Original Poster
Rep: Reputation: 0
I am not using eth0 at all - I just need forwarding between eth1 and eth2.
 
Old 08-06-2004, 08:06 AM   #4
jdelaros1
LQ Newbie
 
Registered: Sep 2003
Location: Austin, TX USA
Distribution: Fedora 1.0, 2.0 & SuSE 9.2
Posts: 20

Rep: Reputation: 0
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
 
Old 08-06-2004, 10:32 AM   #5
odomae
LQ Newbie
 
Registered: Jun 2003
Posts: 10

Original Poster
Rep: Reputation: 0
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?
 
  


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
Port Forwarding Question leedsmunich Linux - Networking 1 10-03-2005 09:17 AM
Port Forwarding Question caps_phisto Linux - Networking 1 07-10-2005 10:33 PM
Port forwarding question Doolspin Linux - Networking 2 09-03-2004 10:11 PM
port forwarding question larry Linux - Networking 2 06-10-2004 10:34 AM
Ip Forwarding Question NUX Linux - Security 4 08-12-2002 01:26 PM

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

All times are GMT -5. The time now is 01:21 AM.

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