This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
docpublic:systemes:linux:virt_kvm [2017/02/19 14:49] procacci@tem-tsp.eu [network] |
docpublic:systemes:linux:virt_kvm [2017/02/22 18:21] (current) procacci@tem-tsp.eu [add 2nd network on specific NIC] |
||
---|---|---|---|
Line 74: | Line 74: | ||
===== network ===== | ===== network ===== | ||
- | https:// | + | * https:// |
+ | * https:// | ||
+ | * https:// | ||
+ | * http:// | ||
< | < | ||
Line 126: | Line 129: | ||
addn-hosts=/ | addn-hosts=/ | ||
[root@localhost ~]# cat / | [root@localhost ~]# cat / | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== add 2nd network on specific NIC ==== | ||
+ | |||
+ | * https:// | ||
+ | * https:// | ||
+ | |||
+ | definition manuelle du nouveau reseau | ||
+ | |||
+ | < | ||
+ | [root@localhost ~]# cat / | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | [root@localhost ~]# virsh net-list --all | ||
+ | | ||
+ | ---------------------------------------------------------- | ||
+ | | ||
+ | |||
+ | [root@localhost ~]# virsh net-define p4p1-net.xml | ||
+ | Réseau p4p1_routed défini depuis p4p1-net.xml | ||
+ | |||
+ | [root@localhost ~]# virsh net-list --all | ||
+ | | ||
+ | ---------------------------------------------------------- | ||
+ | | ||
+ | | ||
+ | |||
+ | [root@localhost ~]# virsh net-start p4p1_routed | ||
+ | Réseau p4p1_routed démarré | ||
+ | |||
+ | [root@localhost ~]# virsh net-list --all | ||
+ | | ||
+ | ---------------------------------------------------------- | ||
+ | | ||
+ | | ||
+ | |||
+ | [root@localhost ~]# virsh net-autostart p4p1_routed | ||
+ | Réseau p4p1_routed marqué en démarrage automatique | ||
+ | |||
+ | [root@localhost ~]# virsh net-list --all | ||
+ | | ||
+ | ---------------------------------------------------------- | ||
+ | | ||
+ | | ||
+ | |||
+ | [root@localhost ~]# ls / | ||
+ | autostart | ||
+ | [root@localhost ~]# cat / | ||
+ | <!-- | ||
+ | WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE | ||
+ | OVERWRITTEN AND LOST. Changes to this xml configuration should be made using: | ||
+ | virsh net-edit p4p1_routed | ||
+ | or other application using the libvirt API. | ||
+ | --> | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <forward dev=' | ||
+ | < | ||
+ | </ | ||
+ | <bridge name=' | ||
+ | <mac address=' | ||
+ | <ip address=' | ||
+ | < | ||
+ | <range start=' | ||
+ | </ | ||
+ | </ip> | ||
+ | </ | ||
+ | [root@localhost ~]# | ||
+ | </ | ||
+ | |||
+ | ==== retrait reseau ==== | ||
+ | |||
+ | < | ||
+ | |||
+ | [root@localhost ~]# virsh net-list --all | ||
+ | | ||
+ | ---------------------------------------------------------- | ||
+ | | ||
+ | | ||
+ | |||
+ | [root@localhost ~]# virsh net-destroy p4p1_routed | ||
+ | Réseau p4p1_routed détruit | ||
+ | |||
+ | [root@localhost ~]# virsh net-list --all | ||
+ | | ||
+ | ---------------------------------------------------------- | ||
+ | | ||
+ | | ||
+ | |||
+ | [root@localhost ~]# virsh net-undefine p4p1_routed | ||
+ | Le réseau p4p1_routed n'est plus défini | ||
+ | |||
+ | [root@localhost ~]# virsh net-list --all | ||
+ | | ||
+ | ---------------------------------------------------------- | ||
+ | | ||
+ | |||
+ | [root@localhost ~]# ls / | ||
+ | autostart | ||
+ | </ | ||
+ | |||
+ | ==== ajout 2eme interface ===== | ||
+ | |||
+ | < | ||
+ | [root@localhost ~]# brctl show | ||
+ | bridge name bridge id STP enabled interfaces | ||
+ | virbr0 8000.5254005d4f0b yes virbr0-nic | ||
+ | vnet0 | ||
+ | virbr1 8000.525400f6a6f4 yes virbr1-nic | ||
+ | [root@localhost ~]# virsh attach-interface --domain pfsense --type bridge --source virbr1 --target eth2 --model virtioInterface attached successfully | ||
+ | |||
+ | [root@localhost ~]# virsh domiflist pfsense | ||
+ | Interface | ||
+ | ------------------------------------------------------- | ||
+ | vnet0 bridge | ||
+ | eth2 | ||
+ | |||
</ | </ | ||