Skip to content

Instantly share code, notes, and snippets.

@kmpm
Last active January 17, 2019 16:32
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmpm/6022b4de1023c712cdf7 to your computer and use it in GitHub Desktop.
Save kmpm/6022b4de1023c712cdf7 to your computer and use it in GitHub Desktop.
How to get VyOS to use the RTL8111/8168B Ethernet Controller in a Shuttle DS437

VyOS on Shuttle DS437

vyos >= 1.2.0-rc11

Everything just works... The 2 ethernet interfaces turned up as eth0 and eth2 and the internal wireless as wlan0. Everything I have tested so far with the interfaces just work out of the box, even wireless.

lspci -nn
01:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8188CE 802.11b/g/n WiFi Adapter [10ec:8176] (rev 01)
02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c)
04:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c)

vyos <= 1.15

The barebone Shuttle DS437 would make a great router for VyOS, or so I thought. It has the great disadvantage of using a Realtek nic chipset that is not supported by VyOS 1.0.3. VyOS 1.1.5 seems to have this problem as well and as I can not find it in the sources of the 4.2.rc1 kernel either it's a big chance it won't work for a while.

How to tell if you have this controller

$ lspci -nn
02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller [10ec:8168] (rev 0c)
03:00.0 USB Controller [0c03]: Device [1b21:1142]
04:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller [10ec:8168] (rev 0c)

Preparations

  • Get a USB stick with at least a couple of MB free. It will be needed to transfer files.
  • Download the driver from here.
  • Download VyOS 1.0.3
  • Prepare a virtual machine or something that can get VyOS up with an internet connection.
  • boot vyos cd
  • login
install image
#follow instrucitons to install to hd
sudo reboot

Login again and configure a interface to get internet access. I use dhcp.

    config
    set interfaces ethernet eth0 address dhcp
    commit
    exit

Then I installed the linux headers and fixed so that the driver install could find it

sudo apt-get install linux-vyatta-kbuild
sudo ln -s /usr/src/linux-image/debian/build/build-amd64-none-amd64-vyatta /lib/modules/3.3.8-1-amd64-vyatta/build 
#for 1.1.5 it's ln -s /usr/src/linux-image/debian/build/build-amd64-none-amd64-vyos /lib/modules/3.13.11-1-amd64-vyos/build

To be able to actually do something you have to enable the debian squeeze apt repository. Add a line to /etc/apt/sources.list

deb http://ftp.us.debian.org/debian squeeze main

Then update the repositories and install nessecary packages. This might be tricky and require downgrading of some libraries on VyOS 1.1.5.

sudo apt-get update
sudo apt-get install build-essential

Download the driver on another computer and put the bz2 file on the USB stick.

Insert the USB stick into the running vyos instance and extract the downloaded driver to /tmp

#change /dev/sdb1 to whatever 
sudo mount /dev/sdb1 /mnt/ -t vfat
cd /tmp
tar -jxf /mnt/r8168-8.038.00.tar.bz2

Compiletime

Go to the extracted driver folder, compile and install

cd /tmp/r8168-8.038.00
make clean modules
sudo make install

Extraction and move

To get the needed files over to my "production" vyos i did the following to copy the modules to the USB stick for transfer to the "production" one.

sudo tar -zcf /mnt/rtl8168.tgz /lib/modules/3.3.8-1-amd64-vyatta/kernel/drivers/net/ethernet/realtek
sudo umount /mnt
sudo poweroff

To get the modules extracted on the "production" system.

sudo mount /dev/sdb1 /mnt -t vfat
cd /
sudo tar -zxf /mnt/rtl8168.tgz
@efpe
Copy link

efpe commented Aug 7, 2015

Thanks, this was helpful :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment