Having two LAN, each one have its own gateway, DHCP and internet connexion
- LAN 1 - IPs: 192.168.0.0-255, Mask: 255.255.254.0, Gateway: 192.168.0.1
- LAN 2 - IPs: 192.168.1.1-255, Mask: 255.255.254.0, Gateway: 192.168.1.1
Connect them with a linux computer having two NIC, one for each LAN. The NIC connected to LAN 1 accept all packets sent to 192.168.1/24 (ips of LAN2) and sends them with the other NIC and vice-versa. It is seen as being all the other computers.
Is this possible ? Wich command should I type in the linux box to setup this "routes". The goal is that each LAN stay with their DHCP, current gateway and internet connexion, but able to reach the computers of the other LAN.
Please, don't tell me it is not the academic way to do it. The question is about guessing if this setup is possible or not and pointing out what will prevent it from working. I know it is not the usual way to do it, that it is not pretty, that I should setup routes on the gateways... But I want to have gigabit troughput and the routers are too weak for this.
EDIT AFTER QUESTION HAS BEEN CLOSED:
Despite the really hostile reactions this question rised, I managed to find an answer. What I was describing is called a pseudo-bridge. I managed connecting the subnets using a dual port NAS (Synology ds1812+). One port connected to each network and enabling both ip_forwarding and proxy_arp.
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp
echo 1 > /proc/sys/net/ipv4/conf/eth1/proxy_arp
Works like a charm at Gigabit speed and for free. Thanks to mfinni for shouting the answer in comments (as question was closed).
More info there http://www.cisco.com/en/US/tech/tk648/tk361/technologies_tech_note09186a0080094adb.shtml, http://en.wikipedia.org/wiki/Proxy_ARP and there http://www.sjdjweis.com/linux/proxyarp/