3 ethernet card package transfer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux