I know that I could achieve the desired result with an Ethernet switch, but I'm curious if I can get this with some cheaper solution.The idea is as follows:Rapsberry Pi has two Ethernet ports - one is the built-in port and the other will be some cheap USB-Ethernet adapterone of the ports is connected directly to my local router and receives a DHCP IP address. Let's say it is 192.168.1.2.the other port will be attached to some other device. I need this device to think that it is attached directly to the same router and to receive a DHCP IP address from the router. Let's say, the address is 192.168.1.3.Essentially, I'd like RPi to behave like an Ethernet switch, which requests one IP for itself and then routes other requests from/to the other device.Here is an image which explains how I'd do it with a switch:And here is how I'd like it to work:Now imagine that I have five (or more) such pairs RPi plus Device X and you'll understand why I would want to get rid of the switch, if possible - I could buy five USB-Ethernet dongles instead of five 3 port switches, which would require separate power supply and two additional wires.Are there any Linux configuration options to make this setup to work with RPi's Ethernet port and an Ethernet dongle?
How to make Raspberry Pi to receive an IP from a router and also pass another IP to another device?
networking;iptables
You should be able to achieve this by setting up a bridge between your two network interfaces.Assuming your integrated ethernet interface is eth0 and that the on via the USB adapter is eth1, a configuration like this in /etc/network/interfaces should work (provided you've installed the bridge-utils package and that your kernel supports it):auto lo br0iface lo inet loopbackiface eth0 inet manualiface eth1 inet manualiface br0 inet dhcp    bridge_ports eth0 eth1If you run ifconfig, you should then see a br0 interface (probably with the MAC address of eth0 if I remember well). This one will effectively be the merge interface of your RPi and get its IP address from your router.The traffic coming from your other device should flow through the bridge, and it should get its IP address too. If the traffic doesn't go through, you may need to allow it via iptables. You may also be interested in this article.(As a side note, this wouldn't necessarily work with wireless LAN adapters, since many cannot use multiple MAC addresses at the same time.)