How to install RTL8111 driver

I have a J1900 mini-pc with RTL8111 NIC and want to use it as a vyos router.

the install is successful, but it don’t have build-in driver for RTL8111 and using r8169 driver.

vyos@vyos:~$ show hardware pci detail 
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)
        Subsystem: Gigabyte Technology Co., Ltd Motherboard
        Kernel driver in use: r8169

it’s because r8111 driver is non-free and debian do it by default too.
but it’s easy to install it in debian.

just install r8168-dkms from apt and everything will ok. (r8111 and r8168 shares same driver, but r8169 not same).

I tried to add jessie source to /etc/apt/sources.list and install.
unfortunately, dkms depends on linux-headers and I can’t got correct version since it’s a vyos customized kernel and not in debian source.

vyos@vyos:~$ sudo apt install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package linux-headers-4.19.20-amd64-vyos
E: Couldn't find any package by regex 'linux-headers-4.19.20-amd64-vyos'

so the problem is: how to install linux-headers

Vyos does not install a kernel-headers package by default, but you could compile your own packages for it. take a look at the vyos-build repository in github. also you will not be able to install a dkms driver because of lack of a compile environment. i would sugest you to open an phabricator ticket for this so maby this driver could be added as a default component of vyos.

I opened a phabricator ticket but no reply these 2 days.

and I found this repo that contains linux-headers

with r8168-dkms package in official debian jessie repo, seems installed successful.

what is this repo? I can’t find it in any official description about that.

there is also a “debian” pool in, but it’s not a mirror of official debian repo, only includes a few packages.

well the driver installation is not really successful. after a reboot everything is gone :frowning: since vyos using a read-only file system…

how can I keep the installed driver?