If you are looking for a way to deploy a cloud-based router that supports Cisco IOS XR software features, you might want to try Cisco IOS XRv 9000 Router. This router is a virtual machine that runs on x86 server hardware and provides traditional provider edge services as well as virtual route reflector capabilities. In this article, we will show you how to download and install Cisco IOS XRv 9000 Router in QEMU, a popular open-source emulator that supports various disk image formats, including qcow2.
Cisco IOS XRv 9000 Router is based on Cisco IOS XR software, which is an industry-leading, carrier-class operating system that supports highly successful edge and core router platforms from Cisco. This modular OS provides a very high level of availability, scalability, performance, and security for service provider networks. By using Cisco IOS XRv 9000 Router, you can enhance your operational excellence and offerings based on physical routers and move them easily to a virtual form factor.
QEMU is a hosted virtual machine monitor that can emulate various processors and devices. It can run multiple operating systems on a single host machine and allows for live migration of virtual machines between hosts. QEMU supports many disk image formats that can grow as data is added, compress and encrypt data, and store changes made to a read-only base image using copy-on-write. One of these formats is qcow2, which stands for QEMU Copy-On-Write version 2.
qcow2 is the native format of QEMU emulator. It uses a disk storage optimization strategy that delays allocation of storage until it is actually needed. This allows for smaller file sizes than raw disk images, which allocate the whole image space to a file even if parts of it are empty. qcow2 also supports multiple snapshots using a newer, more flexible model for storing them. Snapshots are useful for saving the state of a virtual machine at a certain point in time and restoring it later.
Before you can install Cisco IOS XRv 9000 Router in QEMU, you need to have the following hardware and software requirements:
Once you have all the prerequisites, you can proceed to the installation steps.
The installation steps for Cisco IOS XRv 9000 Router in QEMU are as follows:
mkdir xrv9k scp xrv9k-fullk9-x.qcow2 user@server:/xrv9k mv xrv9k-fullk9-x.qcow2 virtioa.qcow2 chown user:user virtioa.qcow2 chmod 644 virtioa.qcow2 virsh define xrv9k-fullk9-x.virsh.xml virsh start xrv9k You can use the following command to check the status of the virtual machine:
virsh list --all You should see something like this:
Id Name State ---------------------------------------------------- 1 xrv9k running This means that the virtual machine is running successfully.
The configuration steps for Cisco IOS XRv 9000 Router in QEMU are as follows:
virsh console xrv9k You should see something like this:
Cisco IOS XRv 9000 Console Press RETURN to get started. RP/0/RP0/CPU0:ios# This means that you have successfully logged in to the router. You can now configure some basic settings, such as hostname, username, password, and interface IP addresses. For example, you can use the following commands to configure these settings:
RP/0/RP0/CPU0:ios#configure terminal RP/0/RP0/CPU0:ios(config)#hostname xrv9k RP/0/RP0/CPU0:ios(config)#username admin privilege 15 password admin RP/0/RP0/CPU0:ios(config)#interface GigabitEthernet0/0/0/0 RP/0/RP0/CPU0:ios(config-if)#ipv4 address 192.168.1.1 255.255.255.0 RP/0/RP0/CPU0:ios(config-if)#no shutdown RP/0/RP0/CPU0:ios(config-if)#commit RP/0/RP0/CPU0:ios(config-if)#end RP/0/RP0/CPU0:xrv9k# RP/0/RP0/CPU0:xrv9k#configure terminal RP/0/RP0/CPU0:xrv9k(config)#crypto key generate rsa The name for the keys will be: xrv9k Choose the size of the key modulus in the range of 360 to 2048 for your General Purpose Keys. Choosing a key modulus greater than 512 may take a few minutes. How many bits in the modulus [512]: 1024 % Generating 1024 bit RSA keys, keys will be non-exportable...[OK] RP/0/RP0/CPU0:xrv9k(config)#ssh server v2 RP/0/RP0/CPU0:xrv9k(config)#ssh server vrf default RP/0/RP0/CPU0:xrv9k(config)#commit RP/0/RP0/CPU0:xrv9k(config)#end RP/0/RP0/CPU0:xrv9k# You can now use SSH to connect to the router from another device, such as your laptop. For example, you can use the following command to connect to the router using the username and password you configured earlier:
You should see something like this:
ad...@192.168.1.1's password: Cisco IOS XRv 9000 Console RP/0/RP0/CPU0:xrv9k# This means that you have successfully connected to the router using SSH. You can also ping the router from another device to test the connectivity. For example, you can use the following command to ping the router from your laptop:
ping 192.168.1.1 You should see something like this:
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=2.34 ms 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=2.28 ms 64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=2.29 ms 64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=2.28 ms 64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=2.29 ms --- 192.168.1.1 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4006ms rtt min/avg/max/mdev = 2.280/2.296/2.340/0.039 ms This means that you have successfully pinged the router from your laptop.
You can use some common commands to check the router information, such as show version, show interfaces, show ip route, etc.
For example, you can use the following command to check the version of the router:
RP/0/RP0/CPU0:xrv9k#show version Cisco IOS XR Software, Version 7.x.x.x Build Information: Built By : ahoang Built On : Wed Aug 21 17:14:15 PDT 2023 Built Host : iox-ucs-030 Workspace : /auto/srcarchive13/prod/7.x.x.x/xrv9k/workspace Version : 7.x.x.x Location : /opt/cisco/XR/packages/ cisco IOS XRv x86_64 (Intel(R) Xeon(R) CPU E5-2697 v4 @ 2.30GHz with 16384 MB of memory) Processor Board ID XXXXXXXXXXX Copyright (c) 2023 by Cisco Systems, Inc. ROM: GRUB, Version XRv-GRUB-2013 xrv9k uptime is 10 minutes System image file is "bootflash:disk0/xrvr-os-mbi-7.x.x.x/mbixrvr-rp.vm" Package active on node RP/0/RP0/CPU0: xrv9k-full-x-7.x.x.x This shows the software version, build information, hardware model, memory size, uptime, and active packages of the router.
For example, you can use the following command to check the interfaces of the router:
RP/0/RP0/CPU0:xrv9k#show interfaces GigabitEthernet0/0/0/0 is up, line protocol is up Interface state transitions: 1 Hardware is GigabitEthernet, address is 5254.00c8.9a00 (bia 5254.00c8.9a00) Internet address is 192.168.1.1/24 MTU 1514 bytes, BW 1000000 Kbit (Max: 1000000 Kbit) reliability 255/255, txload 0/255, rxload 0/255 Encapsulation ARPA, Full-duplex, 1000Mb/s, unknown, link type is force-up output flow control is off, input flow control is off Carrier delay (up) is 10 msec loopback not set, Last link flapped never ARP type ARPA, ARP timeout 04:00:00 Last input never, output never Last clearing of "show interface" counters never Input queue size: curr/max packets/threshold/drops = 0/375/187/0 Total input drops: 0 Received broadcast packets: 0 (multicast packets: 0) Received unicast packets: 0 (unicast bytes: 0) Sent unicast packets: 2 (unicast bytes: 120) Sent broadcast packets: 2 (multicast packets: 2) Total output drops: 0 Output queue size: curr/max packets/threshold/drops = 0/1000/500/0 Queueing strategy: fifo Output queue size (in bytes): curr/max/threshold/drops = 0/512000/256000/0 Total output drops (in bytes): 0 This shows the interface name, status, IP address, MTU, bandwidth, encapsulation, duplex, speed, link type, carrier delay, loopback, ARP type and timeout, last input and output time, last clearing of counters time, input and output queue size and drops, queueing strategy, and received and sent packets and bytes of the interface.
For example, you can use the following command to check the routing table of the router:
RP/0/RP0/CPU0:xrv9k#show ip route Codes: C - connected, S - static, R - RIP, B - BGP, (>) - Diversion path D - EIGRP, EX - EIGRP external, O - OSPF IntraArea (IA - InterArea) N1 - OSPF NSSA external type-1 N2 - OSPF NSSA external type-2 E1 - OSPF external type-1 E2 - OSPF external type-2 i - ISIS L1 ia - ISIS interarea L2 - ISIS L2 * - candidate default U - per-user static route o - ODR P - periodic downloaded static route Gateway of last resort is not set C 192.168.1.0/24 is directly connected via GigabitEthernet0/0/0/0 This shows the codes for different types of routes, the gateway of last resort if set, and the routes in the routing table with their prefixes, masks, next hops and outgoing interfaces.
In this article, we have shown you how to download and install Cisco IOS XRv 9000 Router in QEMU using the qcow2 disk image format. We have also shown you how to configure some basic settings on the router and use some common commands to check its information. By using Cisco IOS XRv 9000 Router in QEMU, you can benefit from the features and capabilities of Cisco IOS XR software in a virtual environment that is easy to deploy and manage.
Here are some tips or best practices for using Cisco IOS XRv 9000 Router in QEMU:
Here are some frequently asked questions and answers about Cisco IOS XRv 9000 Router in QEMU:
You can use the following command to take a snapshot of the virtual machine:
virsh snapshot-create-as xrv9k snapshot-name This will create a snapshot of the virtual machine with the name you specify. You can use the following command to list the snapshots of the virtual machine:
virsh snapshot-list xrv9k You can use the following command to restore a snapshot of the virtual machine:
virsh snapshot-revert xrv9k snapshot-name This will revert the virtual machine to the state of the snapshot with the name you specify. You can use the following command to delete a snapshot of the virtual machine:
virsh snapshot-delete xrv9k snapshot-name You can use the following command to resize the disk image of the virtual machine:
qemu-img resize virtioa.qcow2 +10G This will increase the size of the disk image by 10 GB. You can also use a negative value to decrease the size of the disk image. However, you need to make sure that you have enough free space on the disk image before resizing it.
Some common issues with the virtual machine are:
This could be due to insufficient memory, CPU, or disk space on the host machine. You can check the logs of QEMU and virsh for any errors or warnings. You can also try to reduce the memory, CPU, or disk allocation for the virtual machine and see if it works.
This could be due to high CPU or disk utilization on the host machine or the virtual machine. You can use tools such as top, vmstat, iostat, etc. to monitor the performance and resource utilization of both machines. You can also try to optimize the configuration and settings of both machines and see if it improves.
This could be due to incorrect network configuration or firewall rules on either side. You can use tools such as ping, traceroute, telnet, ssh, etc. to test the connectivity and troubleshoot any network issues. You can also check the status and configuration of the network interfaces and routing tables on both machines and see if they are correct.
You can find more information and resources about Cisco IOS XRv 9000 Router in QEMU from these sources: