Route all traffic between two ethernet interfaces

I have a Linux box with 3 ethernet cards:

  • eth0 - connected to internet (dhcp)
  • eth1 - 192.168.0.1 connected to embedded device1
  • eth2 - 192.168.0.1 also connected to embedded device2
    (both eth1/eth2 have to be in identical, though separate, private networks).

Also, on eth0 I have two tunnel endpoints:

  • vlan1 - 192.168.1.1 - virtual lan dev (OpenVPN or n2n)
  • vlan2 - 192.168.2.1 - like previous

I would like to have access (from internet) to one of the embedded devices at a time through one of vlan devices (i.e. if I want to work with device1 I'll connect to vlan1 and at the same time someone else could work with device2 using vlan2 tunnel). Ah - both embedded devices have the same MAC addresses (I know it is wrong, but I cannot change their MACs).

OpenVPN in bridge mode is working only partially - it forwards ICMP traffic, even FTP, but not TCP/UDP packets (I've tried 'fragment' option, so it's not a problem of too big packets). What is more, the tunnel fails when embedded device restarts.

Hence my question - how to route/transfer/bridge all traffic from one ethernet device to another (eth1 <-> vlan1, eth2 <-> vlan2)?

I have used the arp commands to make something like a route, saying a particular host's mac supports an IP, and when the packets get there, a route there, or another arp lie, can get it delivered. I forget why we did not use a manual route! Maybe we wanted the routing protocol to think it decided everything!

FTP is a sub-protocol of TCP. TCP is one of 512 sub-protocols of IP, along with ICMP (ping and such) and UDP. IP is encapulated in Ethernet. Or more pragmatically, each layer has its own header. So if FTP s routing, TCP is routing. Routing is an IP level activity.