This is an old revision of the document!


virt KVM 8

references

Network brige

par defautl il y a un switch virtuel (bridge virtbr0) qui fit du NAT avec les VM , elles se voient entre elles mais apparaisent avec l'IP de l'Hote et non sont pas directement accessible de l'exterieur (NAT)

ici on souhaite associer un nouveau bridge où nos VM auront leur propore IP directement attaché a l'interface Ethernet de l'hote .

cf https://www.techotopia.com/index.php/Creating_a_RHEL_KVM_Networked_Bridge_Interface

default bridge NAT

[root@localhost ~]# virsh net-list --all
 Nom       État    Démarrage automatique   Persistent
-------------------------------------------------------
 default   actif   Oui                     Oui

[root@localhost ~]# virsh net-dumpxml default
<network connections='1'>
  <name>default</name>
  <uuid>dacd1fb3-7bda-4f2f-afd6-ce27d112e453</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:00:39:e6:60'/>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254'/>
    </dhcp>
  </ip>
</network>



[root@localhost ~]# nmcli con show
NAME                                UUID                                  TYPE      DEVICE 
eno2                                e80109d2-4b12-4e5a-b331-6ab602f0ed9d  ethernet  eno2   
tun0                                4047e6a5-1927-41ab-b384-95b822b2c079  tun       tun0   
virbr0                              1d44c04e-9d67-4f68-ba2c-0983cca8beb6  bridge    virbr0 

ajout bridge

on ajout un autre bridge sur notre interface ethernet physique (ici eno2) et affichage des fichier txt créés a l'occasion (pour voir ce qui est fait en background)

[root@localhost ~]# nmcli con add ifname br0 type bridge con-name br0
Connexion « br0 » (d997c203-8b07-4f8c-820b-cc60f45968ee) ajoutée avec succès.
[root@localhost ~]# ls -ltr /etc/sysconfig/network-scripts/ | tail -1 
-rw-r--r--  1 root root 311  3 sept. 16:49 ifcfg-br0
[root@localhost ~]# nmcli con add type bridge-slave ifname eno2 master br0
Connexion « bridge-slave-eno2 » (8c9f5da5-4664-40ae-9afc-3fed2b7d1db4) ajoutée avec succès.
[root@localhost ~]# ls -ltr /etc/sysconfig/network-scripts/ | tail -1 
-rw-r--r--  1 root root 113  3 sept. 16:50 ifcfg-bridge-slave-eno2
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-bridge-slave-eno2
TYPE=Ethernet
NAME=bridge-slave-eno2
UUID=8c9f5da5-4664-40ae-9afc-3fed2b7d1db4
DEVICE=eno2
ONBOOT=yes
BRIDGE=br0
docpublic/systemes/linux/virt_kvm8.1630681370.txt.gz · Last modified: 2021/09/03 15:02 by adminjp
CC Attribution-Noncommercial-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0