Configure linux machine as bridge/switch and end device

At my home, I have two desktop PCs in two rooms. The router / DSL modem is in one of these rooms. Now I want to configure a home server (having 2 LAN ports, running 24/7) in the corridor between the two rooms, using only one LAN cable at each door. This gives me the following physical configuration:

     (door)          (door)
 .----/-/----.  .-----/-/----------._ FritzBox
 |           |  |             .----´´ DSL Router
PC1         Server            |
                             PC2 

As just said, the server has 2 network interfaces and is running Ubuntu.

What I need now is a network configuration which enables both the server and PC1 to connect to the router. I think the server needs to serve as a bridge or switch.

Currently, all computers are configured having static IP addresses. If I'm understanding it correctly, a bridge / switch doesn't have its own IP address, but as the server needs to be configured as an own end device, it needs to have one. My first question is, do I have to configure both interfaces separately, giving both the same static IP address?

My next question is, how do I bridge the two physical networks into one? I have basic understanding (but am always confused again and again) of bridges and switches, but I don't know how to configure it in software. I only know that it's possible to do so :)

The third question is: Is it possible to configure this in a way that network packets from/to PC1 to/from the router only go through hardware or only consume low CPU in the server?

Can you help me? Thanks in advance!


Solution 1:

You have two options:

  1. Run the server as a router. In this case, PC1 and PC2 will be located in two different subnets. IP forwarding should be enabled on the server and each NIC will be assigned a different IP.
  2. Bridge the network interfaces of server and in this case the IP is assigned to the bridge interface of server. Also, both PCs will be assigned IPs from same subnet.

Solution 2:

Bridges

A bridge is a layer 2 device that works at the data link layer and delivers packets based on the destination MAC address. Bridges can be used to segment network traffic and reduce the collision domain; the amount of devices competing for the same bandwidth. Even though you may not realize it bridges are most commonly seen in network switches. Traffic only leaves a particular port on a switch if the destination MAC address is available on that port. This differs from the older hub that sent traffic out on each port of the hub regardless of the data-link address. [Source]

Here is how to implement an Ethernet bridge on Ubuntu 16.04 LTS.