Hot-plugging two persistent network interfaces to connect two routers
The following figure shows how to hot-plug two persistent network interfaces on two routers so that the two routers are connected to the same network.
- Log in to the VM guest.
- Change the directory to /home/Vyatta/.
- Create the r1.xml file and set its contents to the following:
<interface type='network'> <mac address='52:54:00:11:11:11'/> <source network='net100'/> <model type='virtio'/> </interface>
- Save the r1.xml file in the /home/Vyatta/ directory.
- Create the r2.xml file and set its contents to the following:
<interface type='network'> <mac address='52:54:00:11:11:12'/> <source network='net100'/> <model type='virtio'/> </interface>
The only difference between r1.xml and r2.xml is the MAC address. Because these two interfaces are on the same network, the MAC addresses must be unique.
- Save the r2.xml file in the /home/Vyatta/ directory.
- Hot-plug an interface into the R1 router by entering the following command:
# virsh attach-device R1 --persistent./r1.xml
- Hot-plug an interface into the R2 router by entering the following command:
# virsh attach-device R2 --persistent./r2.xml