Bridging networks with a Synology NAS

    Bridging networks with a Synology NAS

    Warning: potentially bad idea ahead

    For various reasons, I had to reorganize my working setup at home, including moving my home office to the room where my Synology NAS is. In this room, I had only one Ethernet outlet, but I needed two connections, one for the NAS and one for my desktop. I was too lazy to go to the nearest electronic shop to buy a switch this evening and I didn't want to unplug the NAS, but then I had an idea:

    My NAS has two Ethernet ports. What if I use it as a sort of router, connecting the second Ethernet port directly to my desktop?

    Let's give it a shot. I connected the desktop to the NAS. Both of them perceive that there is something connected, but no IP addresses are assigned.

    I tried to fool around in the Control Panel of the Synology to enable a DHCP server for the second LAN interface. Eventually I got an IP on the desktop and I could load the Synology server, but I couldn't access the internet.

    After some DuckDuckGo-ing and wading through all the posts saying that this is a bad idea and it's not how the Synology should be used, I found a Github repo that said it can bridge the two networks of a Synology. The script there is a bit of an overkill for what I needed, so here is the gist that I needed to get things working:

    First, enable vSwitch:

    Where to find the vSwitch Settings

    Then SSH into the NAS and run the following two commands:

    > sudo ovs-vsctl del-br ovs_eth1
    > sudo ovs-vsctl add-port ovs_eth0 eth1
    > sudo ovs-vsctl show 
        Bridge "ovs_eth0"
            Port "eth1"
                Interface "eth1"
            Port "eth0"
                Interface "eth0"
            Port "ovs_eth0"
                Interface "ovs_eth0"
                    type: internal

    If the output of the final command shows a bridge and two associated Ports, you're good to go and browse the Internet!

    I don't actually intend to keep this as a long term solution. A NAS is not meant to function as a router or switch, so it's not optimized for this. A real switch is probably faster, but a Speedtest shows that I have 250 Mb/s download, so it's pretty good for now, until I get around to buying a switch.

    I’m publishing this as part of 100 Days To Offload - Day 13.