All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Oğuz Yarımtepe" <comp.ogz@gmail.com>
To: netfilter@lists.netfilter.org
Subject: 3 ethernet card package transfer
Date: Thu, 6 Sep 2007 23:08:12 +0300	[thread overview]
Message-ID: <200709062308.12951.comp.ogz@gmail.com> (raw)

Hi,

In my machine i have 3 ethernet cards: eth0, eth1 and eth2

eth0 had 192.168.1.20, eth1 192.168.1.1 and eth2 had 10.0.0.1 ip. eth1 and 
eth2 are connection to pcs that have the gateway information of those ips. 
What i was trying was to send a package using eth1 to eth2, so i was sending 
tcp packagex using hping2 from the pc that has the gateway of 192.168.1.1 
(pc1, 192.168.1.2) to the other pc that has the gateway of 10.0.0.1 (pc2, 
10.0.0.2). Every ethernet card was plugged to the same switch, also pc1 and 
pc2. What my expectation was to see a traffic at eth1 and eth2 after the 
iptables rules here: http://rafb.net/p/8bLvVP45.html and after adding 
iptables -I FORWARD 1 -s 192.168.1.2 -d 10.0.0.2 -j ACCEPT

But i saw a traffic at eth0 and eth2. 

First, how can i fix it with iptables configuration?

When change 192.168.1.1 ip to 172.16.0.1 and configure the pc1 according to 
that gateway i saw only traffic at eth1 and eth2, so it seems the problem was 
beeing in the same network. 

If i change eth1 to 192.168.1.1, eth2 to 192.168.2.1 and eth0 to 192.168.3.1 
will it work again, which will fix being on a different network?

And my last question at the 172.16. example, that is when the packages are 
being transfered from eth1 to eth2, a routing is done internally. Is that 
done automatically, or how can the the machine decide when it gets a package 
from eth1 and sees the destination ip and say ok i should send to the eth2?

Thanx.
-- 
Oğuz Yarımtepe
http://www.yarimtepe.com/en


             reply	other threads:[~2007-09-06 20:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-06 20:08 Oğuz Yarımtepe [this message]
2007-09-07  7:09 ` 3 ethernet card package transfer Grant Taylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200709062308.12951.comp.ogz@gmail.com \
    --to=comp.ogz@gmail.com \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.