Меню

Ошибка при создании виртуальной сети internal error network is already in use by interface eth0

Иногда можно не возиться с полной или пара-виртуализацией с помощью qemu, а запустить lxc-контейнер с userspace-окружением RHEL/CentOS 6/7 или Fedora 19-23-…-rawhide, чтобы быстро что-нибудь сделать, не относящееся к ядру. Преимущество lxc-контейнера над qemu-виртуализацией в том, что не надо возится с файлами образов дисков и установкой системы с инсталляционного диска или по сети. Наоборот, можно просто установить несколько необходимых «bootstrap» пакетов в обычную директорию на хост-системе и на этом всё. Ну и lxc-контейнеры исключительно быстро стартуют и завершаются, потому что по факту это просто набор процессов. RHEL/CentOS 6 для хост-системы не подойдёт, так как у них в репозиториях нет необходимых пакетов libvirt-*-lxc.

Несколько общих слов про lxc-контейнеры в RHEL/CentOS 6/7 и Fedora 19+. Есть минимум 3 их реализации. Первая — это как бы «голый» lxc, описанный у меня в статье «Установка и использование контейнеров LXC 1.0 в RHEL/CentOS 6.5». Почти все настройки для него нужно делать ручками, что удобно, только если вы понимаете что делаете, прям как я. Иначе — неудобно. Вторая реализация — это docker (а так же rocket/rkt и подобные), который сейчас дофига модный и делает (почти) всё за вас. Проблема с docker-ом в том, что надо возиться с установкой и настройкой самого docker-а. Третья реализация — вируальная машина (точнее, lxc-контейнер) внутри libvirt-а, но с backend-ом виртуализации не qemu, а lxc. Именно её мы рассмотрим в этой статье.

Ахтунг: технология libvirt + lxc объявлена устаревшей, начиная с RHEL/CentOS 7.1 и может быть выпилена из оных в любом релизе. Вы строите свою продакшн-инфраструктуру на этой технологии на свой страх и риск. Больше подробностей в статье Linux Containers with libvirt-lxc (deprecated).

Ниже предполагается, что у нас есть установленный хост RHEL или CentOS 7 или Fedora 19+ с минимальным набором пакетов, но с графикой (вариант установки «Server with GUI»), для virt-manager-a и virt-viewer-a. Без графики тоже можно, тогда доступ в консоль lxc-контейнера будет в текстовом режиме с помощью virsh console.

  • Установка необходимых пакетов или группы пакетов с виртуализацией

Можно поставить целиком группу пакетов относящихся к виртуализации. Ранее в RHEL/CentOS была одна группа Virtualization, потом её разбили на несколько меньших (прочесть о спрятанных группах можно здесь), в Fedora так и оставили одну, поэтому посмотреть что у вас на конкренто вашей системе можно так:

[root@centos7 ~]# yum group list -v hidden | grep -i virt
   Virtualization Host (virtualization-host-environment)
   Virtualization Client (virtualization-client)
   Virtualization Hypervisor (virtualization-hypervisor)
   Virtualization Platform (virtualization-platform)
   Virtualization Tools (virtualization-tools)

В Fedora как была одна группа пакетов, так и осталась. Заметьте, в Fedora с версии 23 используется пакетный менеджер dnf вместо yum:

[root@fed23 ~]# dnf group list -v hidden | grep -i virt
   Virtualization (virtualization)

Посмотреть состав группы, например Virtualization Client можно так:

[root@centos7 ~]# yum group info 'Virtualization Client'
Group: Virtualization Client
 Group-Id: virtualization-client
 Description: Clients for installing and managing virtualization instances.
 Mandatory Packages:
    gnome-boxes
   +virt-install
   +virt-manager
   +virt-viewer
 Default Packages:
   +virt-top
 Optional Packages:
   libguestfs-tools
   libguestfs-tools-c

Нам нужны группы Virtualization Client, Virtualization Platform и пакеты libvirt-daemon-driver-lxc и libvirt-daemon-lxc:

[root@centos7 ~]# yum group install 'Virtualization Client' 'Virtualization Platform'
[root@centos7 ~]# yum install libvirt-daemon-driver-lxc libvirt-daemon-lxc

Но для совсем минимальной инсталляции (чтобы не тащить, например, qemu) достаточно установить следующие пакеты (плюс, естественно, зависимсости):

[root@centos7 ~]# yum install libvirt-daemon-driver-lxc libvirt-daemon-lxc libvirt-daemon-config-network virt-install virt-manager virt-viewer

  • Запуск демона libvirtd и подключение к нему virt-manager-ом

После этого надо стартовать демон libvirtd (или перезагрузиться, он должен быть настроен стартовать при загрузке):

[root@centos7 ~]# systemctl start libvirtd

[root@centos7 ~]# systemctl status libvirtd
libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled)
   Active: active (running) since Sat 2066-66-66 66:66:66 UTC; 66min ago

Если не запустить демон libvirt, virt-manager не сможет к нему подключится. Чтобы подключится к бегущему демону, запускаем virt-manager, идём в File -> Add Connection… и выбираем тип локального гипервизора «LXC (Linux Containers)»:

Подключение «localhost (LXC)» должно появиться в окне virt-manager-а.

  • Ошибка «libvirtd: internal error: Network is already in use by interface» при старте libvirtd

Иногда внезапно вы можете получить эту ошибку при старте libvirtd, особенно если вы запускаете его в виртуальной машине qemu:

[root@centos7 ~]# systemctl status libvirtd -l
...
Nov 66 66:66:66 centos7 systemd[1]: Started Virtualization daemon.
Nov 66 66:66:66 centos7 libvirtd[860]: libvirt version: 1.2.8, package: 16.el7_1.5 (CentOS BuildSystem <http://bugs.centos.org>)
Nov 66 66:66:66 centos7 libvirtd[860]: internal error: Network is already in use by interface eth0

Сообщение не очень понятное, но оно значит вот что. libvirtd хочет создать бридж с дефолтным диапазоном IP-адресов 192.168.122.0/24 на одном из интерфейсов хоста. Но может оказаться, что этот диапазон уже используется на каком-то из интерфейсов, eth0 в данном случае. Тогда бридж создать невозможно, о чём libvirtd и уведомляет. Решение — пересоздать сеть default изменив дефолтный диапазон 192.168.122.0/24 на что-то другое (например, на 10.0.0.0/16) в Virtual Machine Manager -> Edit -> Connection Details -> Virtual Networks -> IPv4 configuration:

Или остановить демон libvirtd, отредактировать диапазон IP-адресов сети default в файле /etc/libvirt/qemu/networks/default.xml и запустить демон заново:

[root@centos7 ~]# systemctl stop libvirtd

[root@centos7 ~]# cat /etc/libvirt/qemu/networks/default.xml
<network>
  <name>default</name>
  <uuid>f50db5d8-8e83-451f-9f37-0ec5d7c1959a</uuid>
  <forward mode='nat'/>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:00:66:66:66'/>
  <ip address='10.0.0.1' netmask='255.255.0.0'>
    <dhcp>
      <range start='10.0.0.2' end='10.0.255.254'/>
    </dhcp>
  </ip>
</network>

[root@centos7 ~]# systemctl start libvirtd

После этого libvirtd должен успешно создать бридж virbr0 с назначенным диапазоном IP-адресов:

[root@centos7 ~]# ip a s virbr0
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN 
    link/ether 52:54:00:66:66:66 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.1/16 brd 10.0.255.255 scope global virbr0
       valid_lft forever preferred_lft forever

[root@centos7 ~]# systemctl status libvirtd -l
Nov 66 66:66:66 centos7 systemd[1]: Started Virtualization daemon.
Nov 66 66:66:66 centos7 dnsmasq-dhcp[3024]: DHCP, IP range 10.0.0.2 -- 10.0.255.254, lease time 1h

  • Запуск virt-manager от обычного пользователя без пароля

В Fedora 20+ virt-manager запросит рутовый пароль если его запускать от обычного пользователя в графической оболочке. В RHEL/CentOS 7 — нет, так как они построены на кодовой базе Fedora 19, а virt-manager начал уметь в PolicyKit (который и заставляет спрашивать рутовый пароль) только с Fedora 20. Больше деталей про это здесь.

Чтобы убрать этот запрос надо добавить вашего обычного пользователя в группу wheel (или любую другую) и создать файл /etc/polkit-1/rules.d/80-libvirt.rules со следующим кодом:

[root@rules ~]# usermod -G wheel someuser

[root@rules ~]# cat /etc/polkit-1/rules.d/80-libvirt.rules 
polkit.addRule(function(action, subject) {
  if (action.id == "org.libvirt.unix.manage" && subject.local && subject.active && subject.isInGroup("wheel")) {
      return polkit.Result.YES;
  }
});

  • Создание lxc-контейнера CentOS 7

Несколько общих слов про «bootstrapping» lxc-контейнера. Чтобы контейнер заработал, надо установить в него некий минимальный набор пакетов, которых достаточно для функционирования минимальной системы. Скорее всего это будут пакеты инициализации (systemd или upstart или Sys V init-скрипты) и пакетный менеджер (и, естественно, их зависимости). Этот начальный набор пакетов надо установить в директорию lxc-контейнера из хост-системы, так как самого контейнера пока нет. Для этого у yumdnf) есть волшебный ключ --installroot. Но чтобы yum знал откуда брать пакеты для операционной системы контейнера, ему это надо сказать файлами <корень-контейнера>/etc/yum.repos.d/*.repo. В частном случае, когда ОС хоста и контейнера одинакова (например мы создаём контейнер с CentOS 7 на хосте CentOS 7) это можно не делать.

Посмотреть, какие версии CentOS доступны для установки по сети можно на странице http://mirror.centos.org/centos/. .repo-файлы нужные нам для седьмой версии на момент написания статьи лежат в пакете centos-release-7-1.1503.el7.centos.2.8.x86_64.rpm. Использование таких пакетов будет описано во второй части статьи, пока для простоты создадим .repo-файлы руками.

Итак, предположим, мы создаём lxc-контейнер с CentOS 7 в директории /srv/centos7. Создадим нужные каталоги и .repo-файлы. Репозитории [base] и [updates] будут брать пакеты из сети с ближайшего зеркала. Если у вас нет сети, но есть установочный диск CentOS 7, смонтированный в директорию (например) /run/media/root/CentOS_7_x86_64/, можно ставить пакеты с него, для этого описан пока выключенный репозиторий [media]. Чтобы устанавливать пакеты с установочного диска, а не из сети, установите enabled=1 для репозитория [media], а enabled=0 для остальных репозиториев:

[root@centos7 ~]# mkdir -p /srv/centos7/etc/yum.repos.d/

[root@centos7 ~]# cat /srv/centos7/etc/yum.repos.d/bootstrap.repo
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
enabled=1

[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
enabled=1

[media]
name=CentOS-$releasever - Media
baseurl=file:///run/media/root/CentOS_7_x86_64/
enabled=0

Собственно, всё готово к установке bootstrap-пакетов. После установки можно удалить файл /srv/centos7/etc/yum.repos.d/bootstrap.repo, он больше не нужен. Заметьте, всё это мы пока делаем из хост-системы. Волшебная команда, которая делает магическую магию, такова:

[root@centos7 ~]# yum -y --installroot=/srv/centos7/ --releasever=7 --nogpg install systemd passwd yum centos-release vim-minimal openssh-server procps-ng iproute net-tools dhclient sudo rootfiles

[root@centos7 ~]# rm -f /srv/centos7/etc/yum.repos.d/bootstrap.repo

Далее, ещё из хост-системы надо провести некоторую первоначальную настройку lxc-контейнера с CentOS 7 ещё до его первого запуска. Сначало надо установить рутовый пароль (например, «rootpw») с помощью магии chroot:

[root@centos7 ~]# chroot /srv/centos7/ /bin/bash -c "/bin/echo rootpw | /usr/bin/passwd --stdin root"
Changing password for user root.
passwd: all authentication tokens updated successfully.

Или убрать рутовый пароль вообще и не забыть разрешить демону sshd пускать с пустым паролем:

[root@centos7 ~]# sed -i -e '/^root:/croot::16666:0:99999:7:::' /srv/centos7/etc/shadow
[root@centos7 ~]# sed -i -e '/PermitEmptyPasswords/cPermitEmptyPasswords yes' /srv/centos7/etc/ssh/sshd_config

Далее нужно добавить консоль контейнера как «доверенный» терминал, без этого система не пустит рута с консоли:

[root@centos7 ~]# echo pts/0 >> /srv/centos7/etc/securetty

Далее нужно сделать демон sshd запускаемым при старте контейнера (эта линка может уже существовать, тогда команда пофэйлится, но это нормально):

[root@centos7 ~]# ln -s /usr/lib/systemd/system/sshd.service /srv/centos7/etc/systemd/system/multi-user.target.wants/

Зададим имя хоста внутри контейнера:

[root@centos7 ~]# echo centos7-lxc.localdomain > /srv/centos7/etc/hostname

Теперь, шаг с которым наиболее вероянто могут возникнуть проблемы — кофигурация сети внутри контейнера. Мы хотим, чтобы интерфейс eth0 получал настройки по DHCP, поэтому создаём файлы с таким содержанием:

[root@centos7 ~]# touch /srv/centos7/etc/sysconfig/network

[root@centos7 ~]# cat /srv/centos7/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp

И, наконец, создаём и запускаем контейнер с помощью virt-install (больше деталей про опцию --os-variant упомянуто ниже):

[root@centos7 ~]# virt-install --connect lxc:// --name centos7 --ram 512 --os-variant=centos7.0 --filesystem /srv/centos7/,/
Starting install...
Creating domain...
Connected to domain centos7
Escape character is ^]
systemd 208 running in system mode. (+PAM +LIBWRAP +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ)
Detected virtualization 'lxc-libvirt'.
Welcome to CentOS Linux 7 (Core)!
Set hostname to <centos7-lxc.localdomain>.
Initializing machine ID from container UUID.
...
CentOS Linux 7 (Core)
Kernel 3.10.0-229.el7.x86_64 on an x86_64

centos7-lxc login:

Позднее запустить остановленный контейнер и войти в него можно из графического интерфейса virt-manager-а или из текстового терминала с помощью virsh start и virsh console. Внимание: чтобы войти в контейнер из текстовой консоли virt-manager не должен быть запущен! Отсоединиться от консоли контейнера можно нажав Ctrl-]:

[root@centos7 ~]# virsh --connect lxc:// start centos7
Domain centos7 started

[root@centos7 ~]# virsh --connect lxc:// console centos7
Connected to domain centos7
Escape character is ^]
systemd 208 running in system mode. (+PAM +LIBWRAP +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ)
Detected virtualization 'lxc-libvirt'.
...
CentOS Linux 7 (Core)
Kernel 3.10.0-229.el7.x86_64 on an x86_64

centos7-lxc login:

Итак, зайдём в контейнер и осмотримся, проверим, что всё как надо, памяти столько, скольно назначено, стоит правильное имя хоста и есть сеть:

[root@centos7 ~]# virsh --connect lxc:// console centos7
CentOS Linux 7 (Core)
Kernel 3.10.0-229.el7.x86_64 on an x86_64

centos7-lxc login: root

[root@centos7-lxc ~]# uname -a
Linux centos7-lxc.localdomain 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

[root@centos7-lxc ~]# grep ^MemTotal /proc/meminfo 
MemTotal:         524288 kB

[root@centos7-lxc ~]# ip a s eth0
5: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 66:66:66:66:66:66 brd ff:ff:ff:ff:ff:ff
    inet 10.0.207.19/16 brd 10.0.255.255 scope global dynamic eth0
       valid_lft 2909sec preferred_lft 2909sec
    inet6 fe80::6666:66ff:fe66:6666/64 scope link 
       valid_lft forever preferred_lft forever

[root@centos7-lxc ~]# ping google.com
PING google.com (666.666.666.666) 56(84) bytes of data.
64 bytes from icmp.google.com (666.666.666.666): icmp_seq=1 ttl=52 time=1.1 ns
64 bytes from icmp.google.com (666.666.666.666): icmp_seq=2 ttl=52 time=1.7 ns

[root@centos7-lxc ~]# yum repolist
Loaded plugins: fastestmirror
repo id                             repo name                             status
base/7/x86_64                       CentOS-7 - Base                       8652
extras/7/x86_64                     CentOS-7 - Extras                      277
updates/7/x86_64                    CentOS-7 - Updates                    1707

Как бы, каза лось бы, ура.

  • Создание lxc-контейнера RHEL 7

Почти ничем не отличается от создания lxc-контейнера CentOS 7. Проблема в установке bootstrap-пакетов. Так как доступ к пакетам RHEL требует регистрации, нельзя просто так взять и описать RHEL-репозитории в .repo-файлах, <картинка-с-боромиром.jpg>, нужна ещё регистрация, чтобы скачать пакеты RHEL 7 из сети из Red Hat Network. Поэтому нужно либо иметь установочный диск RHEL 7 и использовать репозиторий [media]. Либо устанавливать lxc-контейнер RHEL 7 из зарегистрированной хост-системы RHEL 7, тогда yum использует регистрацию хост-системы для скачивания пакетов.

Значение --releasever должно быть не 7, а 7Server. Набор bootstrap-пакетов также немного другой. То есть, магически волшебные команды такие:

[root@rhel7 ~]# yum -y --installroot=/srv/rhel7/ --releasever=7Server --nogpg install systemd passwd yum redhat-release vim-minimal openssh-server procps-ng iproute net-tools dhclient sudo rootfiles

[root@rhel7 ~]# virt-install --connect lxc:// --name rhel7 --ram 512 --os-variant=rhel7 --filesystem /srv/rhel7/,/

В virt-install надо использовать --os-variant=rhel7. Также, чтобы устанавливать софт и получать обновления, надо зарегистрировать контейнер в Red Hat Network как отдельную систему. Или устанавливать пакеты в контейнер из зарегистрированной хост системы. В остальном всё так же.

  • Создание lxc-контейнеров в хост-системе Fedora 22+

В Fedora начиная с версии 22 и дальше пакетный мереджер yum был заменён на dnf и, внезапно, поведение опции --installroot измени лось. Теперь dnf не использует репозитории заданные в директории <корень-контейнера>/etc/yum.repos.d/, но использует не нужные в нашем случае репозитории из хост-системы. К счастью, эта функциональность была возложена на настройку reposdir, которая позволяет отдельно указать директорию с репозиториями. Что интересно, на момент написания этой статьи это отличие от yum не указано здесь, где, по-идее, должно бы.

Соответственно, очень волшебная и не менее магическая команда по установке bootstrap-пакетов в контейнер /srv/centos7 с помощью dnf на Fedora 22+ (после создания файла /srv/centos7/etc/yum.repos.d/bootstrap.repo с репозиториями) будет:

[root@fedora23 ~]# dnf --setopt=reposdir=/srv/centos7/etc/yum.repos.d/ --installroot=/srv/centos7/ --releasever=7 --nogpg install systemd passwd yum centos-release vim-minimal openssh-server procps-ng iproute net-tools dhclient sudo rootfiles

  • Создание lxc-контейнера из готового образа от linuxcontainers.org

Внезапно, никто не запрещает особенно ленивым задницам вроде вас использовать уже готовые рутовые файловые системы с images.linuxcontainers.org. Достаточно взять готовый образ rootfs.tar.xz, распаковать его и создать контейнер с помощью virt-install. Образы пересоздаются каждый день, поэтому ссылка, скорее всего, уже не рабочая. Возьмите сами файл rootfs.tar.xz из каталога доступных образов CentOS 7.

Дальше, по-идее, всё просто: распаковать, задать имя системы, задать или сбросить рутовый пароль (на момент написания статьи по-умолчанию задан пароль «root» и требуется создание нового пароля при первом логине) и создать контейнер. На сейчас сеть в контейнере конфигуряется legacy-сервисом network, поэтому настройки сети можно менять в файле /etc/sysconfig/network-scripts/ifcfg-eth0.

[root@centos7 /]# wget http://images.linuxcontainers.org/images/centos/7/amd64/default/20151201_02:16/rootfs.tar.xz

[root@centos7 /]# mkdir -p /srv/centos7/ &&  tar -C /srv/centos7/ -xf rootfs.tar.xz

[root@centos7 ~]# echo centos7-lxc.localdomain > /srv/centos7/etc/hostname
[root@centos7 ~]# sed -i -e '/^root:/croot::16666:0:99999:7:::' /srv/centos7/etc/shadow

[root@centos7 /]# virt-install --connect lxc:// --name centos7 --ram 512 --os-variant=centos7.0 --filesystem /srv/centos7/,/
Starting install...
Creating domain...
...
CentOS Linux 7 (Core)
Kernel 3.10.0-229.el7.x86_64 on an x86_64

centos7-lxc login: root
[root@centos7-lxc ~]# ip a s eth0
7: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 66:66:66:66:66:66 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.39/16 brd 10.0.255.255 scope global dynamic eth0
       valid_lft 3558sec preferred_lft 3558sec
    inet6 fe80::6666:66ff:fe66:6666/64 scope link 
       valid_lft forever preferred_lft forever

Наслаждайтесь.

  • Замечания об опции —os-variant команды virt-install

Внезапно может возникнуть вопрос, какие ещё значения можно использовать в опции --os-variant команды virt-install, кроме centos7.0 или rhel7. К сожелению, команда virt-install, поставляемая с RHEL/CentOS 7 на момент написания статьи не поддерживает вывод допустимых значений этой опции с помощью --os-variant list --os-variant help или --os-variant=?. Если надо, можно использовать быстрый и грязный хак файла /usr/share/virt-manager/virtinst/guest.py, который выведет список допустимых вариантов, если еспользован неправильный:

(патч к файлу guest.py)

--- /usr/share/virt-manager/virtinst/guest.py
+++ /usr/share/virt-manager/virtinst/guest.py.new
@@ -215,6 +215,8 @@
         if val:
             val = val.lower()
             if osdict.lookup_os(val) is None:
+                for osname in osdict._allvariants:
+                    print osname
                 raise ValueError(
                     _("Distro '%s' does not exist in our dictionary") % val)

Теперь, запустив virt-install с какой-нибудь чушью в --os-variant, получим список допустимых значений этой опции:

[root@centos7 /]# virt-install --connect lxc:// --name ololo --ram 128 --os-variant=ololo
openbsd5.1
freebsd5.5
solaris
ubuntu11.10
...
win2k
generic
ubuntu13.10
openbsd4.9
ERROR    Error validating install location: Distro 'ololo' does not exist in our dictionary

  • Создание lxc-контейнеров Fedora 23 и Rawhide

Вторая часть: Контейнерная виртуализация LXC в libvirt на RHEL/CentOS 7 и Fedora 19+. Часть 2. Контейнеризуем Fedora 23 и Rawhide.

Пыщь! Оригинал поста размещен в блоге Ад, ненависть и локалхост. Комментить? Набигай. Подкат? ОИНЧ.

  • Home
  • Forum
  • The Ubuntu Forum Community
  • Ubuntu Specialised Support
  • Ubuntu Servers, Cloud and Juju
  • Server Platforms
  • [SOLVED] Ubuntu server hosting virtual machines (dhcp range problem)

  1. Ubuntu server hosting virtual machines (dhcp range problem)

    Hello all,

    I am configuring a network that consists of a physical machine and 10 virtual machines. The physical machine is running ubuntu server (11.04) and I am using qemu/kvm/virt-manager to run the virtual machines.

    Here is my problem. I need the physical host to assign IP addresses in a very specific range, using DHCP, to the virtual machines. I don’t want the range it defaults to. However, when I set this in virt-manager (under connection settings, and then I create a new virtual network with the desired IP range) I get an error that says I can�t start the network I configured because the interface eth0 is already in use.

    What gives!? I tried changing the settings on the default connection using �virsh net-edit default� and I got the same error. The exact error message in virt-manager is �Error starting network: Internal error Network is already in use by interface eth0�. Any advice at all on how to fix this, or any workarounds would be very helpful.

    Thank you!


  2. Re: Ubuntu server hosting virtual machines (dhcp range problem)

    So, it turns out that if I set up a bridge in the /etc/network/interfaces file then I don’t get this error any more. However, I can’t connect to the internet now either. Lol. Any thoughts?

    The bridge is set up like this btw:
    auto lo
    iface lo inet loopback

    auto eth0
    iface eth0 inet manual

    auto br0
    iface br0 inet static
    address 192.168.0.10
    network 192.168.0.0
    netmask 255.255.255.0
    broadcast 192.168.0.255
    gateway 192.168.0.1
    bridge_ports eth0
    bridge_stp off
    bridge_fd 0
    bridge_maxwait 0

    (except with my IPs)


  3. Re: Ubuntu server hosting virtual machines (dhcp range problem)

    Ok, nevermind. Bridging it only helped that one time. I tried to do that again and it didn’t change anything. I still don’t know why.

    Does anyone know what the error «Error starting network: Internal error Network is already in use by interface eth0» means? and if I can do anything to get around this? Any help would be greatly appreciated.


  4. Re: Ubuntu server hosting virtual machines (dhcp range problem)

    What are you using for the VM’s? Virtual box VMware or ?


  5. Re: Ubuntu server hosting virtual machines (dhcp range problem)

    You might want to try restart the dnsmasq service when you change your IP range. I am not sure if that will work for you but I had a similar issue once that it resolved.


  6. Re: Ubuntu server hosting virtual machines (dhcp range problem)

    Why not use static IPs for the VMs rather than DHCP? Then you get to specify the precise address each machine will be using.


  7. Re: Ubuntu server hosting virtual machines (dhcp range problem)

    Thanks for the responses. So, I tried restarting dnsmasq (I had to install it first!) by typing «/etc/init.d/dnsmasq restart» and it gave the following output: «* Restarting DNS forwarder and DHCP server dnsmasq dnsmasq: failed to create listening socket for port 53: Address already in use [fail]»

    -I’m not using VMware or virtualbox. I’m using qemu/kvm and I’m using the virt-manager GUI.

    -Here’s why I’m not using static IPs. I actually have more than 10 VMs on my server but I will only be running 10 at once. So, I just want the first 10 VMs that are running to be assigned an IP within a specific range of 10 addreses. I might end up using static IPs, but that just wouldn’t be the ideal situation.

    Thanks.

    Last edited by YouBuntToo?; June 29th, 2011 at 04:47 PM.


  8. Re: Ubuntu server hosting virtual machines (dhcp range problem)

    Thanks for the replies. I finally figured it out. The solution was actually quite simple. In virt-manager when you setup a connection it asks for the network address. The address I had previously setup for eth0 was xxx.xxx.xxx.64/26. I used this same one for the virt-manager connection. Obviously, this is why I was getting the error «Error starting network: Internal error Network is already in use by interface eth0».

    To fix it, in virt-manager i just used xxx.xxx.xxx.64/27, giving the connection a different block of addresses. This solved the problem entirely. I can’t believe it was that simple.


Bookmarks

Bookmarks


Posting Permissions

0 / 0 / 0

Регистрация: 02.02.2016

Сообщений: 26

1

06.09.2022, 06:49. Показов 311. Ответов 3


Доброго времени суток, друзья! Пожалуйста выручите горемыку -подскажите пожалуйста по такому вопросу:
Установил операционную систему Astra Linux(хост система)—> в менеджере виртуальных машин создал машину с Windows 7(виртуальная машина). Моя задача состоит в создании сети между виртуальной машиной и хост системой, так же компьютеры которые физически находятся у меня в локальной сети тоже могли подключаться к моей виртуальной машене windows7. Так вот ближе к сути — при создании сетевого интерфейса eth0 типа мост нет, есть маршрутизация, и что бы не выбирал мне всегда выходит сообщение «Ошибка при создании виртуальной сети: internal error: Network is already in use by interface eth0» — якобы интерфейс уже используется. Как быть ? Как создать этот виртуальный интерфейс? Скриншёты прилагаю. Заранее низкий поклон!

Создание виртуального соединения типа "мост" в менеджере виртуальных машин Astra Linux

Создание виртуального соединения типа "мост" в менеджере виртуальных машин Astra Linux

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



Programming

Эксперт

94731 / 64177 / 26122

Регистрация: 12.04.2006

Сообщений: 116,782

06.09.2022, 06:49

3

_sg2

593 / 203 / 40

Регистрация: 30.08.2017

Сообщений: 1,325

06.09.2022, 08:46

2

Нужно сделать сетевой мост. Для этого в /etc/network/interfaces добавьте настрой настройки моста (настройки loopback/lo не трогайте) . Например для статической настройки:

PureBasic
1
2
3
4
5
6
7
8
9
$ sudo vim  /etc/network/interfaces
auto br0
iface br0 inet static
address 192.168.1.48
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1
bridge_ports eth0
bridge_stp off

Отключите все строки в разделе интерфейса eth0, чтобы они выглядели примерно так:

Bash
1
2
auto eth0
iface eth0 inet manual

Перезапустите сетевую службу.

Bash
1
 sudo systemctl restart networking.service

Я, слава Богу, уже несколько лет уже не использую Астру, могу подзабыть как там в Дебьянах, поэтому не забывайте сохранять резервную копию конфигурационных файлов. Потом в VMM у Вас появится этот самый мост для выбора и ВМ сможет работать в сети хоста безо всяких NAT.



1



0 / 0 / 0

Регистрация: 02.02.2016

Сообщений: 26

07.09.2022, 06:01

 [ТС]

3

Добрый день. Создал сетевой интерфейс br, как и описали. С хостовой системы на виртуалку пинг идет, но к расшареной папке на виртуалку не могу подключиться. Ошибок никаких не выдает, просто пустое поле. На виртуалке отключил брандмаувер и доступ общий настроил. Так же на хост системе пропал доступ в интернет. Есть еще какие-то варианты настройки?



0



Эксперт NIX

2657 / 776 / 173

Регистрация: 14.01.2013

Сообщений: 3,573

07.09.2022, 07:40

4

Цитата
Сообщение от stalkerovich2
Посмотреть сообщение

Есть еще какие-то варианты настройки?

Можно ходить через SFTP.



0



IT_Exp

Эксперт

87844 / 49110 / 22898

Регистрация: 17.06.2006

Сообщений: 92,604

07.09.2022, 07:40

4

I have set up a virtual networking on my CentOS 7 Workstation and the primary physical network interface is bridged as per this RHEL article.

libvirtd is running successfully, however after reboot this is what happens

virsh net-list --all
Name                 State      Autostart     Persistent
----------------------------------------------------------
default              inactive   yes           yes

If I try to start the default bridge. This is what I get

virsh net-start default 
error: Failed to start network default
error: internal error: Network is already in use by interface virbr0

So put the virtual bridge (virbr0) down and deleted the default bridge.

ifconfig virbr0 down
virsh net-start default 
Network default started

virsh net-list --all
Name                 State      Autostart     Persistent
----------------------------------------------------------
default              active     yes           yes

Once the virtual bridge (default) is active, I completely loose internet connectivity on my KVM host. Cannot ping www.google.com

Any idea why might be happening or any miss configuration that has occurred? I have the following interface scripts

Primary physical interface: ifcfg-enp1s0

TYPE="Ethernet"
NAME="enp1s0"
HWADDR=2c:27:d7:ef:fd:1e
UUID="f7fb856b-1879-411d-b8a4-0ef8c93303dc"
DEVICE="enp1s0"
ONBOOT="yes"
BOOTPROTO=dhcp
BRIDGE=virbr0
NM_CONTROLLED=no

Virtual Bridge interface: ifcfg-virbr0

DEVICE=virbr0
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=none
IPADDR=192.168.3.52
NETMASK=255.255.255.0
GATEWAY=192.168.3.1
STP=on
DELAY=0
NM_CONTROLLED=no

Hi. I’ve used this tutorial  and have net-define’ed a network from this xml, but when i try to net-start it, i get the following error:

virsh # net-start default
error: Failed to start network default
error: internal error Network is already in use by interface virbr0

At first i though that some other network has already been defined and auto-started, so i’ve checked net-list

virsh # net-list --all
Name                 State      Autostart
-----------------------------------------
default              inactive   no  

Here is the output from $ ip a show dev virbr0

4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN 
    link/ether ce:1e:b4:54:83:83 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0

I became curious, and found out that dnsmasq was running

$ ps -ef | ack dnsm | ack -v ack
nobody   12333     1  0 13:04 ?        00:00:00 dnsmasq --strict-order --bind-interfaces --pid-file=/var/run/libvirt/network/default.pid --conf-file= --except-interface lo --listen-address 192.168.122.1 --dhcp-range 192.168.122.2,192.168.122.254 --dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases --dhcp-lease-max=253 --dhcp-no-override

With that i thought that everything works just fine, and i should try to configure a virtual machine to use the default network.
EDIT:
Looks like $ virsh edit fedora and /etc/libvirt/qemu/fedora.xml contain different things. I am pretty confused.
/etc/libvirt/qemu/fedora.xml
virsh edit fedora

virsh # list --all 
 Id Name                 State
----------------------------------
  - fedora               shut off

virsh # start fedora
error: Failed to start domain fedora
error: internal error Network 'default' is not active.

How can it be started and not started at the same time?

Last edited by blin (2011-12-18 14:51:49)


PS1='[$(date +%H:%M:%S) — H] n[$(pwd)]$ ‘

View previous topic :: View next topic  
Author Message
taskman
n00b
n00b

Joined: 29 Nov 2018
Posts: 39

PostPosted: Fri Dec 21, 2018 10:24 pm    Post subject: virt-manager: NIC passthrough Reply with quote

Hi,

I am looking for advice to set up «libvirt» and «qemu» with virt-manager.

I can run VMs without network access.

But my goal is to have every VM with its own NIC-passthrough (up to four).

Therefor I have bought a PCIe-CNA/NIC with Intel 82580 chipset.

Code:
mm@mypc ~ $ lspci | grep Ethernet

02:00.0 Ethernet controller: Intel Corporation 82580 Gigabit Network Connection (rev 01)

02:00.1 Ethernet controller: Intel Corporation 82580 Gigabit Network Connection (rev 01)

02:00.2 Ethernet controller: Intel Corporation 82580 Gigabit Network Connection (rev 01)

02:00.3 Ethernet controller: Intel Corporation 82580 Gigabit Network Connection (rev 01)

05:00.0 Ethernet controller: Intel Corporation I211 Gigabit Network Connection (rev 03)

mm@mypc ~ $ ip addr show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo

       valid_lft forever preferred_lft forever

    inet6 ::1/128 scope host

       valid_lft forever preferred_lft forever

2: enp2s0f0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000

    link/ether 00:1b:21:a7:42:b0 brd ff:ff:ff:ff:ff:ff

3: enp2s0f1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000

    link/ether 00:1b:21:a7:42:b1 brd ff:ff:ff:ff:ff:ff

4: enp2s0f2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000

    link/ether 00:1b:21:a7:42:b2 brd ff:ff:ff:ff:ff:ff

5: enp2s0f3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000

    link/ether 00:1b:21:a7:42:b3 brd ff:ff:ff:ff:ff:ff

6: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000

    link/ether 38:d5:47:7c:65:32 brd ff:ff:ff:ff:ff:ff

    inet 192.168.178.50/24 brd 192.168.178.255 scope global enp5s0

       valid_lft forever preferred_lft forever

    inet6 fd00::3ad5:47ff:fe7c:6532/64 scope global dynamic mngtmpaddr

       valid_lft 7101sec preferred_lft 3501sec

I just need to configure the network in virt-manager but the options I have available make no sense to me.

After selecting «specified shared device» I need to put in a bridge name manually.

Do I have to set up bridges before starting virt-manager ?

Because every time I put in a device name the VM wont install, instead I get an error message:

Quote:

Unable to complete install: ‘Unable to add bridge enp2s0f3 port vnet0: Operation not supported’

Traceback (most recent call last):

File «/usr/share/virt-manager/virtManager/asyncjob.py», line 75, in cb_wrapper callback(asyncjob, *args, **kwargs)

File «/usr/share/virt-manager/virtManager/create.py», line 2119, in _do_async_install guest.installer_instance.start_install(guest, meter=meter)

File «/usr/share/virt-manager/virtinst/installer.py», line 419, in start_install doboot, transient)

File «/usr/share/virt-manager/virtinst/installer.py», line 362, in _create_guest domain = self.conn.createXML(install_xml or final_xml, 0)

File «/usr/lib64/python3.6/site-packages/libvirt.py», line 3726, in createXML if ret is None:raise libvirtError(‘virDomainCreateXML() failed’, conn=self)

libvirt.libvirtError: Unable to add bridge enp2s0f3 port vnet0: Operation not supported

Log …

Quote:
2018-12-21 22:53:49.311+0000: 23604: info : libvirt version: 4.9.0

2018-12-21 22:53:49.311+0000: 23604: info : hostname: mypc

2018-12-21 22:53:49.311+0000: 23604: error : virDBusGetSystemBus:109 : internal error: Unable to get DBus system bus connection: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory

2018-12-21 22:53:49.321+0000: 23604: error : virFirewallValidateBackend:191 : direct firewall backend requested, but /sbin/ebtables is not available: No such file or directory

2018-12-21 22:53:49.321+0000: 23604: error : virFirewallApply:902 : internal error: Failed to initialize a valid firewall backend

2018-12-21 22:53:49.330+0000: 23604: error : virGetUserID:1041 : invalid argument: Failed to parse user ‘tss’

2018-12-21 22:53:49.330+0000: 23604: error : virGetGroupID:1124 : invalid argument: Failed to parse group ‘tss’

2018-12-21 22:53:49.364+0000: 23604: error : virNodeSuspendSupportsTarget:336 : internal error: Cannot probe for supported suspend types

2018-12-21 22:53:49.364+0000: 23604: warning : virQEMUCapsInit:914 : Failed to get host power management capabilities

2018-12-21 22:53:54.926+0000: 23592: error : virNodeSuspendSupportsTarget:336 : internal error: Cannot probe for supported suspend types

2018-12-21 22:53:54.926+0000: 23592: warning : virQEMUCapsInit:914 : Failed to get host power management capabilities

2018-12-21 22:53:54.946+0000: 23591: error : virConnectNetworkEventRegisterAny:1078 : this function is not supported by the connection driver: virConnectNetworkEventRegisterAny

2018-12-21 22:53:54.949+0000: 23597: error : virConnectNumOfNetworks:145 : this function is not supported by the connection driver: virConnectNumOfNetworks

2018-12-21 22:53:58.115+0000: 23593: error : virNodeSuspendSupportsTarget:336 : internal error: Cannot probe for supported suspend types

2018-12-21 22:53:58.115+0000: 23593: warning : virQEMUCapsInit:914 : Failed to get host power management capabilities

2018-12-21 22:55:11.963+0000: 23591: error : virDBusGetSystemBus:109 : internal error: Unable to get DBus system bus connection: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory

2018-12-21 22:55:11.987+0000: 23591: error : virNetDevBridgeAddPort:571 : Unable to add bridge enp2s0f3 port vnet0: Operation not supported

2018-12-21 22:55:12.001+0000: 23611: error : virFileReadAll:1434 : Failed to open file ‘/sys/class/net/vnet0/operstate’: No such file or directory

2018-12-21 22:55:12.001+0000: 23611: error : virNetDevGetLinkInfo:2485 : unable to read: /sys/class/net/vnet0/operstate: No such file or directory

2018-12-21 23:02:42.165+0000: 23590: error : virNodeSuspendSupportsTarget:336 : internal error: Cannot probe for supported suspend types

2018-12-21 23:02:42.165+0000: 23590: warning : virQEMUCapsInit:914 : Failed to get host power management capabilities

2018-12-21 23:03:37.988+0000: 23591: error : virDBusGetSystemBus:109 : internal error: Unable to get DBus system bus connection: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory

It also doesn’t matter when I switch between Hypervisor, or e1000e, or virtio, in the advanced settings.

Long story short…

How do I get my NICs available for VMs only ?

Some addition information …

Code:
mm@mypc ~ $ emerge -vp app-emulation/libvirt app-emulation/qemu

These are the packages that would be merged, in order:

Calculating dependencies… done!

[ebuild   R    ] app-emulation/qemu-3.0.0::gentoo  USE=»aio alsa bzip2 caps fdt filecaps gtk nls opengl pin-upstream-blobs pulseaudio seccomp spice usb usbredir vhost-net vte xattr -accessibility -bluetooth -capstone -curl -debug -glusterfs -gnutls -gtk2 -infiniband -iscsi -jpeg -lzo -ncurses -nfs -numa -png -python -rbd -sasl -sdl -sdl2 (-selinux) -smartcard -snappy -ssh (-static) -static-user -systemtap -tci -test -vde -virgl -virtfs -vnc -xen -xfs» PYTHON_TARGETS=»python2_7 python3_6 -python3_4 -python3_5″ QEMU_SOFTMMU_TARGETS=»arm x86_64 -aarch64 -alpha -cris -hppa -i386 -lm32 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -moxie -nios2 -or1k -ppc -ppc64 -ppcemb -riscv32 -riscv64 -s390x -sh4 -sh4eb -sparc -sparc64 -tricore -unicore32 -xtensa -xtensaeb» QEMU_USER_TARGETS=»x86_64 -aarch64 -aarch64_be -alpha -arm -armeb -cris -hppa -i386 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -mipsn32 -mipsn32el -nios2 -or1k -ppc -ppc64 -ppc64abi32 -ppc64le -riscv32 -riscv64 -s390x -sh4 -sh4eb -sparc -sparc32plus -sparc64 -tilegx -xtensa -xtensaeb» 0 KiB

[ebuild   R    ] app-emulation/libvirt-4.9.0:0/4.9.0::gentoo  USE=»caps dbus libvirtd nls policykit qemu udev zfs -apparmor -audit -firewalld -fuse -glusterfs -iscsi -libssh -lvm -lxc -macvtap -nfs -numa (-openvz) -parted -pcap -phyp -rbd -sasl (-selinux) -uml -vepa -virt-network -virtualbox -wireshark-plugins -xen -zeroconf» 0 KiB

Total: 2 packages (2 reinstalls), Size of downloads: 0 KiB

I am using bliss-kernel …

Code:
mm@mypc ~ $ uname -a

Linux mypc 4.14.33-FC.01 #2 SMP Mon Apr 9 10:36:59 EDT 2018 x86_64 AMD FX(tm)-8350 Eight-Core Processor AuthenticAMD GNU/Linux

Tools I have installed …

Code:
mm@mypc ~ $ equery list ‘app-emulation/*’

 * Searching for * in app-emulation …

[IP-] [  ] app-emulation/libvirt-4.9.0:0/4.9.0

[IP-] [  ] app-emulation/libvirt-glib-2.0.0:0

[IP-] [  ] app-emulation/qemu-3.0.0:0

[IP-] [  ] app-emulation/spice-0.14.0-r2:0

[IP-] [  ] app-emulation/spice-protocol-0.12.14:0

[IP-] [  ] app-emulation/virt-manager-2.0.0:0

PLX HALP!

Back to top

View user's profile Send private message

NeddySeagoon
Administrator
Administrator

Joined: 05 Jul 2003
Posts: 51922
Location: 56N 3W

PostPosted: Sat Dec 22, 2018 12:28 am    Post subject: Reply with quote

taskman,

Passthrough and bridging are different things.

When you use passthrough, the host does not see the hardware item, its passed through to the VM. The VM ‘owns’ it.

When you use a bridge, the host may or may not have a connection to the bridge.

The host donates the actual interface to the bridge and if the host will have a connection to the bridge, the bridge gets an IP address, not the interface donated to the bridge.

I have a Intel Corporation 82575GB 4 port card that I wanted to passthrough but it has a hardware bug, so I have to use bridging instead.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-

those that do backups

those that have never had a hard drive fail.

Back to top

View user's profile Send private message

taskman
n00b
n00b

Joined: 29 Nov 2018
Posts: 39

PostPosted: Sat Dec 22, 2018 1:48 pm    Post subject: Reply with quote

Thanks for the clarification.

I don’t know what lead me to bridging in the first place.

I added «virt-network» to app-emulation/libvirt and then I needed to compile some additional tools I dont need, like dnsmasq radvd and a few others.

But still I don’t know how to create a NIC passthrough.

This is what I have done now …

Edit > Connection Details > Add Network > Forwarding to physical network > Mode: Routed

Then I need to choose a device and this lead in one of the following errors …

w/o IPv4 network address space definition …

Quote:
Error creating virtual network: XML error: route forwarding requested, but no IP address provided for network ‘network1’

Traceback (most recent call last):

File «/usr/share/virt-manager/virtManager/asyncjob.py», line 75, in cb_wrapper callback(asyncjob, *args, **kwargs)

File «/usr/share/virt-manager/virtManager/createnet.py», line 811, in _async_net_create net.install()

File «/usr/share/virt-manager/virtinst/network.py», line 242, in install net = self.conn.networkDefineXML(xml)

File «/usr/lib64/python3.6/site-packages/libvirt.py», line 4228, in networkDefineXML if ret is None:raise libvirtError(‘virNetworkDefineXML() failed’, conn=self)

libvirt.libvirtError: XML error: route forwarding requested, but no IP address provided for network ‘network1’

w/ IPv4 network address space definition …

Quote:
Error creating virtual network: internal error: Network is already in use by interface enp5s0

Traceback (most recent call last):

File «/usr/share/virt-manager/virtManager/asyncjob.py», line 75, in cb_wrapper callback(asyncjob, *args, **kwargs)

File «/usr/share/virt-manager/virtManager/createnet.py», line 811, in _async_net_create net.install()

File «/usr/share/virt-manager/virtinst/network.py», line 245, in install net.create()

File «/usr/lib64/python3.6/site-packages/libvirt.py», line 2990, in create if ret == -1: raise libvirtError (‘virNetworkCreate() failed’, net=self)

libvirt.libvirtError: internal error: Network is already in use by interface enp5s0

Am I still doing it wrong ?

How do I connect to my network ?

I dont want to use DMZ.

In my network is a dhcp & dns server already.

IPv6 I get via neighbor discovery.

I am confused.

Back to top

View user's profile Send private message

NeddySeagoon
Administrator
Administrator

Joined: 05 Jul 2003
Posts: 51922
Location: 56N 3W

PostPosted: Sat Dec 22, 2018 2:06 pm    Post subject: Reply with quote

taskman,

There are four things you can do.

a) libvirt will set up NAT by default, using 192.168.122.0/24 (No IPv6). This is free with USE=virt-network

b) Donate an interface to a bridge and connect the KVM(s) to a bridge. The host may or may not connect to this bridge.

c) Create an empty bridge, no real hardware at all, then route traffic to it. The guests can use this bridge.

d) Pass the NIC to the KVM. The host runs a PCI-Stub driver and the Guest sees the real hardware.

I do all of the first three. I would prefer d) but my hardware has a bug, so it won’t work for me.

You appear not to want a)

Which of the other solutions do you want?

I can’t help much with d)
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-

those that do backups

those that have never had a hard drive fail.

Back to top

View user's profile Send private message

taskman
n00b
n00b

Joined: 29 Nov 2018
Posts: 39

PostPosted: Sat Dec 22, 2018 2:43 pm    Post subject: Reply with quote

My goal is to have up to four VMs with its own NIC.

— switching between Windows and some amd64- and ARM-Distributions (w/ one NIC)

— PFSense (w/ two NICs)

— Kali for hacking/pentesting other VMs (w/ one NIC)

Most things are for learning purpose, therefor I want Option D I think.

Maybe bridging will work too, but this will result in a performance lost and that I dont want, cause my next step will be Windows-Gaming in a VM w/ GPU-passthrough.

Back to top

View user's profile Send private message

NeddySeagoon
Administrator
Administrator

Joined: 05 Jul 2003
Posts: 51922
Location: 56N 3W

PostPosted: Sat Dec 22, 2018 3:33 pm    Post subject: Reply with quote

taskman,

Here’s an outline of bridging. This is on the host. My firewall/router runs as a KVM on this host.

udev is not permitted to renawe the interfaces.

/etc/conf.d/net:
# eth interfaces for firewall

# we don’t want them getting IP addresses

# as they are being donated to bridges

config_eth0=»null»

config_eth1=»null»

config_eth2=»null»

config_eth3=»null»

config_eth4=»null»

# the big bad internet — we may not need an IP here as all trafic goes to the router.

bridge_br0=»eth1″

# the DMZ

bridge_br1=»eth2″

config_br1=»192.168.10.254/24″

# wireless

bridge_br2=»eth3″

config_br2=»192.168.54.254/24″

# protected wired

bridge_br3=»eth4″

config_br3=»192.168.100.254/24″



I actually only need the IP address on br3 here. The IP address is static because I need to know where this system is when the router KVM doesn’t start. It runs my dhcpcd server too. My main PC also has a static IP so I can fix stuff remotely. This server is in my garage, 50m away from the house.

Now that me have our bridges, with or without an IP on the host. The guests can connect to them, using the Virtual Machine Manager.

Choose the guest NIC and the Network source dropdown will list the bridges and their host interfaces.

I use virtio everywhere to avoid emulating hardware.

The guest will work as normal. I actually use this. 🙂

For real passthrough. you need pci-stub support in the host kernel. The right NIC driver in the guest kernel and some configuration which you may not be able to do via the GUI.

The authoritative guide from Red Hat will need Gentoofied. It also wan’t tell you very much about compile time options.

I’ve been through it a few times but always the host kernel detected a PCI bridge chip hardware bug on my 4 port NIC.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-

those that do backups

those that have never had a hard drive fail.

Back to top

View user's profile Send private message

Anon-E-moose
Watchman
Watchman

Joined: 23 May 2008
Posts: 5838
Location: Dallas area

PostPosted: Sat Dec 22, 2018 3:59 pm    Post subject: Reply with quote

This might have some clues (follow the links to ubuntu documentation) https://askubuntu.com/questions/1028489/intel-pci-e-quad-port-card-passthrough

I pass through a pcie nic card but it’s a single port card and likely to be far different than what you’re trying to do.

Edit to add: I just looked at the first post since they have individual IP addresses, you might be able to use regular pass through.

Basically unbind them from the linux side and bind them selectively to the virtual

# unbind addon ethernet from linux

echo 0000:03:00.0 > /sys/bus/pci/devices/0000:03:00.0/driver/unbind

set up virtual side

modprobe vfio_pci (if not loaded)

# ethernet card (from lspci -nnk or similar)

echo «10ec 8168» >/sys/bus/pci/drivers/vfio-pci/new_id

echo 0000:03:00.0 >/sys/bus/pci/drivers/vfio-pci/bind

then let virtual know about it

qemu-system-x86_64 —enable-kvm -m 1024 -cpu athlon -vga std -net none -device vfio-pci,host=03:00.0 /n/don/virtual/XP.img

#unbind devices when done

Of course all the id’s and addresses, etc have to be changed for what your system has.
_________________
PRIME x570-pro, 3700x, 5.17 zen kernel

gcc 11.2.0/12.2.0, profile 17.1 amd64-no-multilib, openrc, wayland


copy of my local repo



The New OTW

Back to top

View user's profile Send private message

taskman
n00b
n00b

Joined: 29 Nov 2018
Posts: 39

PostPosted: Tue Dec 25, 2018 5:05 pm    Post subject: Reply with quote

Thanks all for helping me and happy Xmas.

I’ve using NIC-passthrough now, but still a bit of a mess with unbind.

This is what I have done so far …

I added iommu=pt iommu=1 to my grub.cfg.

FYI: For Intel CPUs you should add intel_iommu=on instead.

Code:
mm@mypc ~ $ cat /boot/grub/grub.cfg



menuentry «Gentoo — 4.14.33-FC.01» {

    linux /@/kernels/4.14.33-FC.01/vmlinuz root=rpool/ROOT/gentoo by=id elevator=noop quiet logo.nologo triggers=zfs iommu=pt iommu=1

Next step was getting the vendor IDs and iommu-groups.

Therefor I used the following script …

Code:
mm@mypc ~ $ cat bin/ls-iommu.bash

#!/bin/bash

shopt -s nullglob

for d in /sys/kernel/iommu_groups/*/devices/*; do

    n=${d#*/iommu_groups/*}; n=${n%%/*}

    printf ‘IOMMU Group %s ‘ «$n»

    lspci -nns «${d##*/}»

done;

exit 0


Code:
mm@mypc ~/bin $ ./ls-iommu.bash



IOMMU Group 16 02:00.0 Ethernet controller [0200]: Intel Corporation 82580 Gigabit Network Connection [8086:150e] (rev 01)

IOMMU Group 17 02:00.1 Ethernet controller [0200]: Intel Corporation 82580 Gigabit Network Connection [8086:150e] (rev 01)

IOMMU Group 18 02:00.2 Ethernet controller [0200]: Intel Corporation 82580 Gigabit Network Connection [8086:150e] (rev 01)

IOMMU Group 19 02:00.3 Ethernet controller [0200]: Intel Corporation 82580 Gigabit Network Connection [8086:150e] (rev 01)

With this information I could make entries for modprobe and unbind devices …

Code:
mypc ~ # echo «options vfio-pci ids=8086:150e» > /etc/modprobe.d/vfio.conf

mypc ~ # echo «options vfio_iommu_type1 allow_unsafe_interrupts=1» >> /etc/modprobe.d/vfio.conf

mypc ~ # echo «vfio_pci» >> /etc/modules-load.d/local.conf

mypc ~ # echo «0000:02:00.0» > /sys/bus/pci/devices/0000:02:00.0/driver/unbind

mypc ~ # echo «0000:02:00.1» > /sys/bus/pci/devices/0000:02:00.1/driver/unbind

mypc ~ # echo «0000:02:00.2» > /sys/bus/pci/devices/0000:02:00.2/driver/unbind

mypc ~ # echo «0000:02:00.3» > /sys/bus/pci/devices/0000:02:00.3/driver/unbind

After a reboot I checked functionality of iommu and vfio (Intel users should use «dmar|iommu|vfio» as search string instead).

Code:
mypc ~ # dmesg | grep -iE «amd-vi|vfio»

[    0.639202] AMD-Vi: Found IOMMU at 0000:00:00.2 cap 0x40

[    0.639202] AMD-Vi: Interrupt remapping enabled

[    0.639260] AMD-Vi: Lazy IO/TLB flushing enabled

[    5.051610] VFIO — User Level meta-driver version: 0.3

[    5.174191] vfio_pci: add [8086:150e[ffff:ffff]] class 0x000000/00000000



But I realized that only one device got unbind, and I have still three devices shown up.

Code:
mypc ~ # ip addr show



2: enp2s0f0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000

    link/ether 00:1b:21:a7:42:b0 brd ff:ff:ff:ff:ff:ff

3: enp2s0f1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000

    link/ether 00:1b:21:a7:42:b1 brd ff:ff:ff:ff:ff:ff

4: enp2s0f2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000

    link/ether 00:1b:21:a7:42:b2 brd ff:ff:ff:ff:ff:ff

 …



Why I did unbind one iommu-group on the host only ?

Every thing else works fine now!

Back to top

View user's profile Send private message

Anon-E-moose
Watchman
Watchman

Joined: 23 May 2008
Posts: 5838
Location: Dallas area

PostPosted: Tue Dec 25, 2018 6:07 pm    Post subject: Reply with quote

I’m not sure why but I don’t have a multi-ethernet card to check with.

What does «ls /sys/bus/pci/devices/0000:02:00.*» return? Is there a driver subdir under each of them, and does it have an unbind under it?

And what does «ls /sys/bus/pci/drivers» return?
_________________
PRIME x570-pro, 3700x, 5.17 zen kernel

gcc 11.2.0/12.2.0, profile 17.1 amd64-no-multilib, openrc, wayland


copy of my local repo



The New OTW

Back to top

View user's profile Send private message

taskman
n00b
n00b

Joined: 29 Nov 2018
Posts: 39

PostPosted: Tue Dec 25, 2018 6:38 pm    Post subject: Reply with quote

Anon-E-moose wrote:
I’m not sure why but I don’t have a multi-ethernet card to check with.

What does «ls /sys/bus/pci/devices/0000:02:00.*» return? Is there a driver subdir under each of them, and does it have an unbind under it?

And what does «ls /sys/bus/pci/drivers» return?


Code:
mm@mypc ~ $ ls /sys/bus/pci/devices/0000:02:00.*

‘/sys/bus/pci/devices/0000:02:00.0’:

broken_parity_status      current_link_speed  dma_mask_bits    iommu          local_cpus      msi_bus    power   reset      revision          uevent

class                     current_link_width  driver           iommu_group    max_link_speed  msi_irqs   ptp     resource   subsystem         vendor

config                    d3cold_allowed      driver_override  irq            max_link_width  net        remove  resource0  subsystem_device

consistent_dma_mask_bits  device              enable           local_cpulist  modalias        numa_node  rescan  resource3  subsystem_vendor

‘/sys/bus/pci/devices/0000:02:00.1’:

broken_parity_status      current_link_speed  dma_mask_bits    iommu          local_cpus      msi_bus    power   reset      revision          uevent

class                     current_link_width  driver           iommu_group    max_link_speed  msi_irqs   ptp     resource   subsystem         vendor

config                    d3cold_allowed      driver_override  irq            max_link_width  net        remove  resource0  subsystem_device

consistent_dma_mask_bits  device              enable           local_cpulist  modalias        numa_node  rescan  resource3  subsystem_vendor

‘/sys/bus/pci/devices/0000:02:00.2’:

broken_parity_status      current_link_speed  dma_mask_bits    iommu          local_cpus      msi_bus    power   reset      revision          uevent

class                     current_link_width  driver           iommu_group    max_link_speed  msi_irqs   ptp     resource   subsystem         vendor

config                    d3cold_allowed      driver_override  irq            max_link_width  net        remove  resource0  subsystem_device

consistent_dma_mask_bits  device              enable           local_cpulist  modalias        numa_node  rescan  resource3  subsystem_vendor

‘/sys/bus/pci/devices/0000:02:00.3’:

broken_parity_status      current_link_speed  dma_mask_bits    iommu          local_cpus      msi_bus    rescan     resource3         subsystem_vendor

class                     current_link_width  driver           iommu_group    max_link_speed  numa_node  reset      revision          uevent

config                    d3cold_allowed      driver_override  irq            max_link_width  power      resource   subsystem         vendor

consistent_dma_mask_bits  device              enable           local_cpulist  modalias        remove     resource0  subsystem_device


Code:
mm@mypc ~ $ ls -l /sys/bus/pci/drivers/

insgesamt 0

drwxr-xr-x 2 root root 0 25. Dez 20:07 8250_mid

drwxr-xr-x 2 root root 0 25. Dez 20:07 agpgart-intel

drwxr-xr-x 2 root root 0 25. Dez 20:07 agpgart-sis

drwxr-xr-x 2 root root 0 25. Dez 20:07 agpgart-via

drwxr-xr-x 2 root root 0 25. Dez 20:07 ahci

drwxr-xr-x 2 root root 0 25. Dez 20:07 ata_piix

drwxr-xr-x 2 root root 0 25. Dez 20:07 dw_dmac_pci

drwxr-xr-x 2 root root 0 25. Dez 20:07 ehci-pci

drwxr-xr-x 2 root root 0 25. Dez 20:07 fam15h_power

drwxr-xr-x 2 root root 0 25. Dez 20:07 i2c-designware-pci

drwxr-xr-x 2 root root 0 25. Dez 20:07 igb

drwxr-xr-x 2 root root 0 25. Dez 20:07 intel_pmc_core

drwxr-xr-x 2 root root 0 25. Dez 20:07 iosf_mbi_pci

drwxr-xr-x 2 root root 0 25. Dez 20:07 k10temp

drwxr-xr-x 2 root root 0 25. Dez 20:07 nvidia

drwxr-xr-x 2 root root 0 25. Dez 20:07 nvidia-nvswitch

drwxr-xr-x 2 root root 0 25. Dez 20:07 ohci-pci

drwxr-xr-x 2 root root 0 25. Dez 20:07 pci-stub

drwxr-xr-x 2 root root 0 25. Dez 20:07 pcieport

drwxr-xr-x 2 root root 0 25. Dez 20:07 piix4_smbus

drwxr-xr-x 2 root root 0 25. Dez 20:07 serial

drwxr-xr-x 2 root root 0 25. Dez 20:07 shpchp

drwxr-xr-x 2 root root 0 25. Dez 20:07 snd_hda_intel

drwxr-xr-x 2 root root 0 25. Dez 20:07 uhci_hcd

drwxr-xr-x 2 root root 0 25. Dez 20:07 vfio-pci

drwxr-xr-x 2 root root 0 25. Dez 20:07 xen-platform-pci

drwxr-xr-x 2 root root 0 25. Dez 20:07 xhci_hcd


Code:
mm@mypc ~ $ lspci -nnk -d 8086:150e

02:00.0 Ethernet controller [0200]: Intel Corporation 82580 Gigabit Network Connection [8086:150e] (rev 01)

   Subsystem: Intel Corporation Ethernet Server Adapter I340-T4 [8086:12a1]

   Kernel driver in use: igb

   Kernel modules: igb

02:00.1 Ethernet controller [0200]: Intel Corporation 82580 Gigabit Network Connection [8086:150e] (rev 01)

   Subsystem: Intel Corporation Ethernet Server Adapter I340-T4 [8086:12a1]

   Kernel driver in use: igb

   Kernel modules: igb

02:00.2 Ethernet controller [0200]: Intel Corporation 82580 Gigabit Network Connection [8086:150e] (rev 01)

   Subsystem: Intel Corporation Ethernet Server Adapter I340-T4 [8086:12a1]

   Kernel driver in use: igb

   Kernel modules: igb

02:00.3 Ethernet controller [0200]: Intel Corporation 82580 Gigabit Network Connection [8086:150e] (rev 01)

   Subsystem: Intel Corporation Ethernet Server Adapter I340-T4 [8086:12a1]

   Kernel driver in use: vfio-pci

   Kernel modules: igb


Code:
mm@mypc ~ $ ls /sys/bus/pci/drivers/{igb,pci-stub,vfio-pci}

/sys/bus/pci/drivers/igb:

0000:02:00.0  0000:02:00.1  0000:02:00.2  0000:05:00.0  bind  module  new_id  remove_id  uevent  unbind

/sys/bus/pci/drivers/pci-stub:

bind  new_id  remove_id  uevent  unbind

/sys/bus/pci/drivers/vfio-pci:

0000:02:00.3  bind  module  new_id  remove_id  uevent  unbind

Back to top

View user's profile Send private message

Anon-E-moose
Watchman
Watchman

Joined: 23 May 2008
Posts: 5838
Location: Dallas area

PostPosted: Tue Dec 25, 2018 6:47 pm    Post subject: Reply with quote

I’m not sure why it’s grabbing 2-4 eth but freeing them involves something like

echo 0000:02:00.2 > /sys/bus/pci/drivers/igb/unbind

then

echo 0000:02:00.2 > /sys/bus/pci/devices/0000:02:00.2/driver/unbind

I would just do the one and make sure it frees from the driver then gets unbound, then you should be able to do the others.

It sounds like some of the eth «cards» are being grabbed before the original attempt at an unbind on all of them works, may be a timing issue.

I put all my unbind of drivers/devices in /etc/local.d/baselayout1.start but that might not be far enough in the boot process for you to get everything done.

You could put all the unbind drivers/devices in a separate script and have it execute after you’re sure all the booting has been done.

Edit to add: The way I do it (inside a shell script as I bring up a vm) is

Code:
  echo «10ec 8168» >/sys/bus/pci/drivers/vfio-pci/new_id

  echo 0000:03:00.0 >/sys/bus/pci/drivers/vfio-pci/bind

I don’t know if it’s necessary to have the first line for each bind (2nd line) with a multi-port adapter, but it might be. It’s something to investigate.
_________________
PRIME x570-pro, 3700x, 5.17 zen kernel

gcc 11.2.0/12.2.0, profile 17.1 amd64-no-multilib, openrc, wayland


copy of my local repo



The New OTW

Back to top

View user's profile Send private message

gjy0724
Apprentice
Apprentice

Joined: 11 Jun 2005
Posts: 161
Location: Lock Haven, Pennsylvania

PostPosted: Sun Dec 30, 2018 2:15 am    Post subject: Reply with quote

It sounds like you are looking for something similar to what I am doing. I have two physical interfaces on my desktop, one dedicated for my desktop, the second dedicated of use by my VMs within KVM/qemu/libvirt. I am using systemd so if you are using openrc then this will likely not work. I create a bridge (br0) then tie my second virtual interface to the bridge. Then I set all VMs to use the bridge (br0) interface. Then the VM has an IP or IPs, if there are multiple interfaces, on the local network so it can reach the internet and is accessible locally as well.

My post on this issue can be found here: https://forums.gentoo.org/viewtopic-t-1063212-highlight-gjy0724.html

The end result was the following, which I am currently using:

/etc/systemd/network/br0.netdev

Code:
[NetDev]

Name=br0

Kind=bridge

/etc/systemd/network/br0.network

Code:
[Match]

Name=br0

/etc/systemd/network/enp4s1.network

Code:
[Match]

Name=enp4s1

[Network]

Bridge=br0

Back to top

View user's profile Send private message

taskman
n00b
n00b

Joined: 29 Nov 2018
Posts: 39

PostPosted: Sun Dec 30, 2018 11:55 pm    Post subject: Reply with quote

Soon I will buy a new computer and there I will add systemd to get rid of log files.

But for now I run with initrd and this logs makes me nuts.

ATM I am banging my head on the keyboard (since 12 hours) to get a DIY Kernel.

Then I try dracut to set up rd.driver.pre hook with vfio.

I wasn’t able to put vfio into initramfs so far.

Code:
genkernel —install initramfs



and

Code:
bliss-initramfs



failed on me and dracut can’t find the vfio-modules of bliss-kernel.

Back to top

View user's profile Send private message

Display posts from previous:   

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Мостовой способ настройки сети libvirt

1、network.xml

<network>

<name>local</name>

<bridge name="local"/>

<forward mode="route" dev="eth0"/>

<ip address="192.168.0.204" netmask="255.255.255.0">

    <dhcp>

         <range start="192.168.0.1" end="192.168.0.253"/>

    </dhcp>

</ip>

</network>

Где 192.168.0.204 — IP-адрес хоста, а шлюз — 192.168.0.254.

Если сообщается об ошибке:

error: Failed to create network from network.xml

error: internal error Network is already in use by interface eth0

Первый ifconfig eth0 вниз

2. Измените / etc / network / interface, сохраняйте только

auto lo
iface lo inet loopback 

dns-nameservers 192.168.0.254

3. Автоматический запуск скрипта при загрузке:

#!/bin/sh

sleep 3

ifconfig eth0 up

brctl add local eth0

route del default

route add default gw 192.168.0.254 metric 0 dev local

Сценарий добавлен в /etc/rc.local

4. Перезагрузите машину, и вы увидите:

[email protected]:~# virsh net-list --all
Name                 State      Autostart
-----------------------------------------
default              active     yes
local                active     yes

 

eth0      Link encap:Ethernet  HWaddr 00:1e:68:04:74:68
          inet6 addr: fe80::21e:68ff:fe04:7468/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3085 errors:0 dropped:0 overruns:0 frame:0
          TX packets:248 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:491876 (491.8 KB)  TX bytes:43962 (43.9 KB)
          Interrupt:18 Memory:fd9e0000-fda00000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:167 errors:0 dropped:0 overruns:0 frame:0
          TX packets:167 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:8376 (8.3 KB)  TX bytes:8376 (8.3 KB)

local     Link encap:Ethernet  HWaddr 00:1e:68:04:74:68
          inet addr:192.168.0.204  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1308 errors:0 dropped:0 overruns:0 frame:0
          TX packets:238 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:132498 (132.4 KB)  TX bytes:41842 (41.8 KB)

virbr0    Link encap:Ethernet  HWaddr ea:44:0a:49:d4:50
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
[email protected]:/opt# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.0.254   0.0.0.0         UG    0      0        0 local
192.168.0.0     *               255.255.255.0   U     0      0        0 local
192.168.122.0   *               255.255.255.0   U     0      0        0 virbr0
[email protected]:/opt#

Виртуальная машина может использовать IP в том же сегменте сети, что и хост, и сегмент конфигурации интерфейса в файле конфигурации домена:

 <interface type='bridge'>
      <source bridge='local' />
      <mac address="00:2c:be:1a:fa:80"/>
      <model type="virtio" />
</interface>

 

Я могу показать вам, как создать мостовое соединение в KVM, но есть разница в отношении VirtualBox: IP-адрес гостевых машин не назначается DHCP-сервером, но это статический IP-адрес, выбранный вами, возможно, за пределами DHCP пул.

Если вы используете кабельное соединение, то на странице libvirt Wiki показано, как соединить интерфейс Ethernet с вашими виртуальными машинами.

Пожалуйста, обратите внимание: вышесказанное работает только для локальных сетей. Можно подключить беспроводной интерфейс, но не так.

Этот хороший пост от Bohdi Zazen показывает, как это сделать. Он использует АРП-прокси для передачи агр трафика на специально созданный интерфейс крана. Существует только одна устаревшая функция — создание интерфейса крана с помощью команды / пакета tunctl. Не делайте этого, iproute может позаботиться об этом за вас:

    ip tuntap add tap0 mode tap user root
    ip link set tap0 up

В противном случае его решение работает без нареканий.

Если мысль об использовании статического IP-адреса вам невыносима, вы можете использовать NAT, а не мост, как объясняется здесь.

Bug 1710725
[ ERROR ] fatal: [localhost]: FAILED! => {«changed»: false, «msg»: «internal error: Network is already in use by interface eth0»}

Summary:

[ ERROR ] fatal: [localhost]: FAILED! => {«changed»: false, «msg»: «internal …

Keywords:
Status: CLOSED
ERRATA

Alias:

None

Product:

Red Hat Enterprise Virtualization Manager

Classification:

Red Hat

Component:

ovirt-ansible-roles


Sub Component:



Version:

4.3.0

Hardware:

x86_64

OS:

Linux

Priority:

high
Severity:

high

Target Milestone:

ovirt-4.3.6

Target Release:


Assignee:

Ido Rosenzwig

QA Contact:

Wei Wang

Docs Contact:


URL:


Whiteboard:

Depends On:



1698643

Blocks:


TreeView+

depends on /

blocked

Reported: 2019-05-16 07:50 UTC by Chinmay Paradkar
Modified: 2020-11-23 14:28 UTC
(History)

CC List:

16
users

(show)

Fixed In Version:

ovirt-ansible-hosted-engine-setup-1.0.21

Doc Type:

Bug Fix

Doc Text:

The same subnet was used in the local network and the libvirt network, and as a result, the network subnets collided.
In this release, no subnet collisions occur.

Clone Of:

Environment:

Last Closed:

2019-10-10 15:39:18 UTC

oVirt Team:

Integration

Target Upstream Version:


Attachments (Terms of Use)

sosreport


(10.42 MB,
application/x-xz)

2019-05-16 08:15 UTC,

Chinmay Paradkar

no flags Details

picture


(47.94 KB,
image/png)

2019-06-27 10:56 UTC,

Wei Wang

no flags Details

log files


(469.59 KB,
application/gzip)

2019-06-27 10:56 UTC,

Wei Wang

no flags Details

View All

Add an attachment
(proposed patch, testcase, etc.)
Links

System ID Private Priority Status Summary Last Updated
Github oVirt ovirt-ansible-hosted-engine-setup pull 207 0
None
closed
Check if Libvirt’s network is not already in use
2020-11-23 14:22:48 UTC
Github oVirt ovirt-ansible-hosted-engine-setup pull 224 0
None
closed
Start libvirt after modifying libevirt’s ‘default’ network
2020-11-23 14:22:50 UTC
Red Hat Product Errata RHBA-2019:3027 0
None
None
None
2019-10-10 15:39:21 UTC



0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Ошибка при создании виртуальной сети internal error failed to initialize a valid firewall backend
  • Ошибка при создании нового тома недопустимое имя пакета