Dear community,
hope, I'm not the only one trying to set up OpenWRT on Xen...
Since a couple of days I'm playing with passing PCI devices (A Gigabit Ethernet interface and WLAN) to an OpenWRT domU. The success is limited to excluding PCI devices from being exposed to dom0, to pass it to OpenWRT. OpenWRT itself does not see the devices.
Current setup:
Alpine Linux 3.6.2 as Xen dom0 on APU3 board (from pcengines)
PCI device 04:00.0 passthrough (WLE200NX with Atheros AR9280)
PCI device 01:00.0 passthrough (Intel i210AT / i211AT)
OpenWRT (openwrt-15.05.1-x86-xen_domu-combined-ext4.img and openwrt-15.05.1-x86-xen_domu-vmlinuz) as guest
It took me a while to get the two mentioned devices under control of pciback... This is stable now, and after logging into the system, the command xl pci-assignable-list outputs correctly the two mentioned PCI devices.
Remaining to dom0 are
eth1 (will be connected to the intranet and is bridged to br1, to make it available to other domU's) and
eth2 (used as pure management interface),
which are configured in
/etc/network/interfaces
#loopback adapter
auto lo
iface lo inet loopback
#hotpluggable networkinterfaces
#auto eth0 > pciback to openwrt
auto eth1
auto eth2
#auto wlan0 > pciback to openwrt
#auto br0 > currently not used, in favor or pciback'ing eth0 to openwrt
auto br1
### bridge for all WAN-connected domU's
#iface br0 inet dhcp
# bridge-ports eth0
# bridge-ifaces eth0
# up ifconfig eth0 up
### bridge for all LAN-connected domU's
iface br1 inet static
bridge-ports eth1
bridge-ifaces eth1
bridge-stp 0
address 192.168.0.1
netmask 255.255.255.0
up ifconfig eth1 up
### WAN interface
# iface eth0 inet6 dhcp
# iface eth0 inet6 auto
#iface eth0 inet manual
#iface eth0 inet dhcp
# hostname alp.wan
### LAN interface ###
iface eth1 inet manual
### Management interface ###
iface eth2 inet dhcp
hostname alp.lan
### WLAN interface ###
#iface wlan0 inet static
# hostapd /etc/hostapd/hostapd.conf
# up hostapd /etc/hostapd/hostapd.conf
# wireless-ssid IOT_GW
# wireless-key xxxxxxxxxx
# wireless-mode master
# address 10.128.1.1
# netmask 255.255.255.0
The Xen domU for openwrt is configured in
/etc/xen/openwrt.conf
name = 'openwrt'
hostname = 'openwrt.home'
kernel = '/vm/openwrt-15.05.1-x86-xen_domu-vmlinuz'
root = '/dev/xvda2 rw'
disk =['file:/vm/openwrt-15.05.1-x86-xen_domu-combined-ext4.img,xvda,w']
memory = '256'
vcpus = '4'
#cpus = '1'
localtime = 0
serial = 'pty'
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'
#extra = "console=hvc0 xencons=tty"
extra = "iommu=soft swiotlb=force console=hvc0 xencons=tty"
pci = ['01:00.0','4:00.0']
vif = ['bridge=br1']
[edit]
Using dmesg there's evidence that the devices are visible to the domU, but there are no drivers associated to it:
[ 1.596557] xenbus_probe_frontend: Device with no driver: device/vif/0
[ 1.596580] xenbus_probe_frontend: Device with no driver: device/pci/0
How can the pci = ['01:00.0','4:00.0'] devices be made "known" to OpenWRT?
From dmesg I assume that only one of the interfaces passed through is detected. But which one is it?
What drivers are required and how to embed them, since no network connection is detected / available inside OpenWRT (vif doesn't work either, so the entire OpenWRT is isolated from any network)?
[/edit]
Thanks a lot,
Mike
(Last edited by enlightment on 27 Jul 2017, 21:54)