Connecting two machines with an ethernet bridge

Hello,

I want to connect 2 machines with a bridge between them to control the traffic i.e. delay, loss rate, etc.
I am using the following solution:
2 end machines with ip-adresses 192.168.0.8 and 192.168.0.16.
1 machine with 2 NIC interface cards: 192.168.0.40 and 192.168.0.41
I have directly connected 192.168.0.8 to 192.168.0.41 and 192.168.0.16 to 192.168.0.40 using cables.
I intend to use a bridge using brctl to relay the traffic between the 2 interfaces in the bridge machine.
Then, I want to use dummynet in the bridge machine to control the traffic flow between the 2 end machines.

Now, my question is whether my setup is correct to obtain my objective?
If NO, then how should I setup to achieve my requirements.

Another connectivity issue is:
192.168.0.8 is able to ping both 192.168.0.40 and 192.168.0.41. Why?
192.168.0.16 not able to ping 192.168.0.40 and neither 192.168.0.40 is able to ping 192.168.0.16 Why?
I have not set any bridge currently and all firewall options are disabled.
I am using Mandriva 2010 in all the machines.

Any help will be highly appreciated!
Thanks!

Am I picturing this right:

0.16 <----> ( 0.40, 0.41 ) <----> 0.8

What you're trying to do should be possible, I think, at least in linux, which can do this odd kind of pseudo-routing. The finer details of it sometimes puzzle me.

I think you get ping responses because those interfaces are on the same subnet as far as that machine's concerned.

Do their MAC addresses at least show up in your ARP tables when they try to ping each other?

What is your default gateway on each host ? and is ip forwarding switched on or off on the router ?

Default gateway isn't needed for hosts on the same subnet.

true ... so next guess would be weird subnet masks ...

Thanks for replying!
I mentioned in my first post that I need to control traffic flowing between 2 machines using a bridge. All are in the same subnet with subnet mask of 255.255.255.0 in all interfaces in all machines.
I have connected the machines directly back to back with the configurations mentioned in my first post.
X.40/24 is eth1 and X.41/24 is eth0 in bridge machine.
Other 2 host machines are: X.8/24 and X.16/24 where X=192.168.0 in all the machines.
I have directly connected X.41->X.8 and X.40->X.16
Now my prob is I am able to ping X.41->X.8 both ways correctly.
But X.40->X.16 is not able to ping both ways. Moreover, X.8 is able to ping X.40 though not directly connected.

Latest observation is, when I disconnect X.41->X.8 connection then X.40->x.16 is able to ping both ways perfectly.
So the problem happens when both the cables are connected in the bridge machine interfaces X.40 and X.41
So, the problem is not related to ip/subnet addressing errors!

The arp tables look as follows:
At X.16-->arp- a gives ? (192.168.0.40) at <incomplete> on eth0
At X.40-->arp -a gives ? (192.168.0.16) at <incomplete> on eth1

So, it seems that the arp tables entries are missing.
But when I disconnect the connection of X.41->X.8 then the arp table entries show correctly in X.40 and X.16 and are also able to ping each other as already mentioned.

Any help will be highly appreciated!
Thanks!

---------- Post updated at 01:08 PM ---------- Previous update was at 12:53 PM ----------

The connection:

is absolutely correct.
Not able to ping: X.40<------>X.16
Able to ping: X.41<--------->X.8
Removing the connection X.41<------->X.8 the ping works perfectly in X.40<------->X.16

Ignoring the private network joining the two computers for the moment.
Are 192.168.0.8 and 192.168.0.16 plugged into the same physical network, or do you have two class C networks with the same IP address range?

Thanks ll for replying!
My objective is to control the traffic between X.8<--->X.16 by using a bridge machine in between with 2 NIC cards so that the configuration is like:
X.8<------>(X.41 X.40)<------->X.16
All are with /24 subnet mask.
I intend to add X.40 and X.41 interface to the bridge using brctl and then use dummynet pipes to control the traffic between X.8<---->X.16 so that all the traffic flowing between X.8 and X.16 passes through the bridge machine.

I have no router/hubs connected in the network and the only physical connections are between X.8<---->X.41 and X.16<----->X.40 directly back to back with cables.
Now the X.8<---->X.41 connectivity is OK using ping but no connectivity between X.16<---->X.40 ping fails both side (Destination Host Unreachable).

The problem only arises when both cables are connected in the bridge machine of X.40 and X.41 interfaces. With single connections both paths work perfectly.

My question is: why X.16<----->X.40 ping fails even they are directly connected.
Moreover, X.8----->X.40 is giving ping replies even though not directly connected nor bridging is enabled.

Summarizing, only the X.16---->X.40 ping is not working...all other connections are OK.

Any help will be highly appreciated!
Thanks!

I repeat:

arp is a lower level of communication than most firewalls and can communicate even on a severely mis-configured network. When you try and do any sort of communication between hosts, whether they succeed or not they should at least get each other's MAC addresses in their ARP tables. If they don't even see each other on ARP, I suspect a hardware or cable issue.

If you don't know how to check ARP, /sbin/arp -n.

Thanks to all for replying!
I am able to solve the problem by adding a bridge between X.40 and X.41 so that now end-to-end X.8<---->X.16 works perfectly. I don't care other connectivity issues since this is what was required by me. Moreover, by adding dummynet pipes, I am able to control the traffic between X.8<--->X.16 which was my objective.

Thanks!