This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
docpublic:systemes:linux:virt_kvm8 [2021/09/03 14:55] adminjp created |
docpublic:systemes:linux:virt_kvm8 [2021/09/04 16:27] (current) adminjp [ajout bridge] |
||
|---|---|---|---|
| Line 8: | Line 8: | ||
| * https:// | * https:// | ||
| + | |||
| + | ===== Network brige ===== | ||
| + | |||
| + | par defautl il y a un switch | ||
| + | |||
| + | ici on souhaite associer un nouveau bridge où nos VM auront leur propore IP directement attaché a l' | ||
| + | |||
| + | cf https:// | ||
| + | |||
| + | ==== default bridge NAT ==== | ||
| + | |||
| + | |||
| + | < | ||
| + | [root@localhost ~]# virsh net-list --all | ||
| + | | ||
| + | ------------------------------------------------------- | ||
| + | | ||
| + | |||
| + | [root@localhost ~]# virsh net-dumpxml default | ||
| + | <network connections=' | ||
| + | < | ||
| + | < | ||
| + | <forward mode=' | ||
| + | <nat> | ||
| + | <port start=' | ||
| + | </ | ||
| + | </ | ||
| + | <bridge name=' | ||
| + | <mac address=' | ||
| + | <ip address=' | ||
| + | < | ||
| + | <range start=' | ||
| + | </ | ||
| + | </ip> | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | [root@localhost ~]# nmcli con show | ||
| + | NAME UUID TYPE DEVICE | ||
| + | eno2 e80109d2-4b12-4e5a-b331-6ab602f0ed9d | ||
| + | tun0 4047e6a5-1927-41ab-b384-95b822b2c079 | ||
| + | virbr0 | ||
| + | </ | ||
| + | |||
| + | ==== ajout bridge ==== | ||
| + | |||
| + | on ajout un autre bridge sur notre interface ethernet physique (ici eno2) et affichage des fichiers txt créés a l' | ||
| + | |||
| + | < | ||
| + | [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 / | ||
| + | -rw-r--r-- | ||
| + | [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 / | ||
| + | -rw-r--r-- | ||
| + | [root@localhost ~]# cat / | ||
| + | TYPE=Ethernet | ||
| + | NAME=bridge-slave-eno2 | ||
| + | UUID=8c9f5da5-4664-40ae-9afc-3fed2b7d1db4 | ||
| + | DEVICE=eno2 | ||
| + | ONBOOT=yes | ||
| + | BRIDGE=br0 | ||
| + | </ | ||
| + | |||
| + | puis ajout de ce bridge dans l' | ||
| + | |||
| + | < | ||
| + | [root@localhost ~]# cat / | ||
| + | < | ||
| + | < | ||
| + | <forward mode=" | ||
| + | <bridge name=" | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | integration | ||
| + | |||
| + | < | ||
| + | [root@localhost ~]# virsh net-define / | ||
| + | Réseau br0 défini depuis / | ||
| + | </ | ||
| + | |||
| + | demarrage | ||
| + | |||
| + | < | ||
| + | [root@localhost ~]# virsh net-start br0 | ||
| + | Réseau br0 démarré | ||
| + | </ | ||
| + | |||
| + | et autostart | ||
| + | |||
| + | < | ||
| + | [root@localhost ~]# virsh net-autostart br0 | ||
| + | Réseau br0 marqué en démarrage automatique | ||
| + | </ | ||
| + | |||
| + | list des reseaux libvirt | ||
| + | |||
| + | < | ||
| + | | ||
| + | | ||
| + | ------------------------------------------------------- | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | au final tout doit etre au vert, eventullement redemarer libvirt, NetworkManager | ||
| + | |||
| + | < | ||
| + | [root@localhost ~]# nmcli con show --active | ||
| + | NAME | ||
| + | br0 d997c203-8b07-4f8c-820b-cc60f45968ee | ||
| + | virbr0 | ||
| + | bridge-slave-eno2 | ||
| + | vnet0 4ff25561-bc3b-4d86-a5e8-0062b5e7911c | ||
| + | |||
| + | | ||
| + | bridge name bridge id STP enabled interfaces | ||
| + | br0 8000.3448ed33418e yes eno2 | ||
| + | vnet0 | ||
| + | virbr0 8000.52540039e660 yes virbr0-nic | ||
| + | |||
| + | </ | ||