Using my YNH server as a wired router

Hello, FTTH was just installed at home and i’m thrilled but my routeur is heavily lowering up and down speeds. So i wondered : could i bypass it, plug th ONT straight into my YNH server and use it as a router ? The current router would then only be used as a wifi hotspot where speed is not as critical…

The server has two ethernet slots (one built in enp0s25, one pci card enp1s0), adguard could be my trusty dhcp server and i have an 8 port gigabit switch that could dispatch traffic to ethernet cables in the walls and to the wifi-hotspot/ex-router. Seems kinda straightforward but i struggle to find tutorials or tips on how to get it up and running. I found some topics on the forum :

But it kinda does not fit my usecase. Do you have any tutorial, recommandations or magic trick ? Thanks !

From what i understand (please correct me if i’m wrong) i should :

  • connect enp1s0 interface on the server to the ONT (thus conecting the server to the internet and removing the need to forward ports, now only the YNH firewall configuration is important)
  • configure enp1s0 with something like
auto enp1s0
iface enp1s0 inet static
    address xxx.xxx.xxx.xxx //public ipv4, there may be something to do about ipv6 somewhere
    netmask xxx.xxx.xxx.xxx
    gateway xxx.xxx.xxx.xxx
  • configure adguardhome to be my dhcp provider with enp0s25 configured statically as 192.168.0.5 (which is the static ip my server traditionnally uses)
  • connect enp0s25 to my LAN switch
  • configure it with something like
auto enp0s25
iface enp0s25 inet static
    address 192.168.0.5
    network 192.168.0.0
    netmask 255.255.255.0
    broadcast 192.168.0.255
  • somehow tell the server to forward traffic from one to another ethernet interface, this is critical but also where i get totally lost.
  • profit !

i’m trying to put together things that i merely understand so maybe steps are not in the right order, maybe i’m completely missing the point, maybe there’s a simpler way…

Hi !
I have checked the two other possibilities (aka buying a real router or building one) but my server already has 2 ethernet plugs and i’m really broke so i’m sticking to my first idea…
If someone could comment my rant or point me to the right direction i would be very grateful !

Well i bought a router and i’ll OPNsense it…

Just for your information, I think you probably missed this point :

It created a DHCP server on my usb ethernet adapter. All devices connected to this eth1 interface go through my VPN at ARN. It works like a charm but after some testing it looks like it requires the hotspot_ynh wifi app.
[RÉSOLU] Configuration d'un hotspot filaire - #15 by gauthier67
Did you try installing hotspot_ynh before running GitHub - alexAubin/ynh-extraeth: Configure an extra ethernet interface (typically usb adapter) on an internet cube

I only tested this a while ago on a server that was connected using the vpnclient_ynh app, but it should work without much tweaking…