HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises)
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises)
to the public
Revision Record
Course Code Product Product Version Course Issue
1
Huawei Cloud Certification Training
HCIA-Cloud Computing
2
Copyright © Huawei Technologies Co., Ltd. 2022. All rights reserved.
No part of this document may be reproduced or transmitted in any form or by any
means without prior written consent of Huawei Technologies Co., Ltd.
and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of
their respective holders.
Notice
The purchased products, services and features are stipulated by the contract made
between Huawei and the customer. All or part of the products, services and features
described in this document may not be within the purchase scope or the usage scope.
Unless otherwise specified in the contract, all statements, information, and
recommendations in this document are provided "AS IS" without warranties,
guarantees or representations of any kind, either express or implied.
The information in this document is subject to change without notice. Every effort has
been made in the preparation of this document to ensure accuracy of the contents, but
all statements, information, and recommendations in this document do not constitute
a warranty of any kind, express or implied.
Overview
This course is specific to HCIA-Cloud Computing certification. It is intended for those who
are preparing for HCIA-Cloud Computing certification or want to understand basic
configurations of storage, networks, Linux, and KVM virtualization.
Account List
Product documentation: FusionCompute OceanStor eStor Installation Guide.
FusionCompute_OceanStor_
Storage configuration
eStor_V1R1C00T32_single_c One for each group
exercise
ontroller.zip
Storage configuration
FusionCompute 8.1.1 Shared by all groups
exercise
Network configuration
eNSP V100R003C00SPC100 One for each person
exercise
Linux/KVM virtualization
VirtualBox 6.1.34 One for each person
exercise
Contents
1 Storage Exercise
1.1 Overview
1.1.1 About This Exercise
This exercise describes how to create and map Huawei SAN storage resources to help
trainees deepen their understanding of Huawei SAN storage concepts and service
processes.
1.1.2 Objectives
Understand the concepts of disk domains and storage pools of Huawei storage
devices.
Be familiar with the concepts and configurations of Huawei storage devices, such as
hosts, host groups, LUNs, LUN groups, and mapping views.
Understand the process and method of configuring Huawei SAN storage services.
NE Interface IP Address
1.1.4 Guideline
1. Deploy and initialize OceanStor eStor.
2. Deploy service hosts.
3. Configure hosts and host groups.
4. Configure LUNs and LUN groups.
5. Create a mapping view and log in to the host to verify mounting.
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 8
Step 2 Set the VM name, select the estor template created by the trainer, and click Next.
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 9
#For details about the user name and password, see the Account List.
Step 2 Configure the IP address and iSCSI information of the service host.
Log in to the VM using VNC and configure the IP address of the service host based
on the IP address plan.
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 16
Figure 1-22 Modifying the iSCSI initiator and restarting the service
# Run the following commands to connect to the storage device:
Step 2 In the service list, select Host Groups, click Hosts on the right, and choose Create.
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 18
Step 5 In the Execution Result dialog box that is displayed, click Close.
Figure 1-27
Step 6 In the service list, select Host Groups, click Host Groups on the right, and choose
Create.
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 20
Figure 1-32 Creating a LUN and a LUN group and mapping the LUN to a
host group
1.3 Quiz
After a host uses an iSCSI initiator to connect to a storage device, if the iSCSI initiator
name changes, will the initiator name be updated on the storage device? If the host
initiator name will not be updated, what should I do?
Answer:
The initiator name will not be updated on the storage device. You need to remove the
iSCSI connection from the host, restart the iSCSI service, and reconnect the host to the
storage device.
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 24
2.1.1.2 Objectives
Understand the basic operations on the eNSP simulator.
Understand the basic operation views of Huawei switches.
2.1.1.3 Guideline
1. Start a switch on eNSP.
2. Enter the user view.
3. Enter the system view.
4. Enter the interface view.
5. Exit the interface view and system view.
Step 2 Right-click the switch, choose Start, and wait for 2 to 5 minutes.
<Huawei>system-view
[Huawei]sysname SW1
[SW1-GigabitEthernet0/0/1]quit
[SW1]
Step 2 Run the following command to exit the SW1 system view and return to the user
view:
[SW1]quit
<SW1>
2.2.1.2 Objectives
Understand how to change the system name of a Huawei switch.
Understand how to use the ? key on Huawei switches.
Understand how to use the display command on Huawei switches.
Understand how to use the undo command on Huawei switches.
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 28
2.2.1.3 Guideline
1. Change the system name.
2. Use the ? key.
3. Run the display command.
4. Run the undo command.
<Huawei>system-view
Step 2 Change the system name to SW1 and then change it back to Huawei.
[Huawei]sysname SW1
[SW1]sysname Huawei
[Huawei]
[Huawei]interface ?
Step 2 Check the available parameters of the port command in the interface view.
<Huawei>display version
[Huawei]display ip routing-table
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 30
[Huawei]display current-configuration
[Huawei-GigabitEthernet0/0/1]display this
[Huawei-GigabitEthernet0/0/1]display this
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 32
2.3.1.2 Objectives
Understand the implementation of VLAN.
Understand the link types of VLAN.
Understand how to configure different types of VLAN interfaces.
Understand how to assign VLANs based on interfaces.
Understand the functions of different interface types.
through. Configure the type of interfaces connecting the access switches to the PCs
to access and change the PVIDs of the access interfaces to the VLAN IDs to be
assigned to the PCs.
After the configuration, users in the same VLAN can communicate only with each
other, while users in different VLANs are isolated at Layer 2.
PVID: 1
GE0/0/1 Trunk
Allowed VLANs: VLAN 10 and VLAN 20
SW1
(LSW1) GE0/0/2 Access PVID: 10
PVID: 1
GE0/0/1 Trunk
Allowed VLANs: VLAN 10 and VLAN 20
SW2
(LSW2) GE0/0/2 Access PVID: 10
2.3.1.5 Guideline
1. Set up a topology.
2. Configure IP addresses for the hosts.
3. Create VLANs on the switches.
4. Configure access and trunk interfaces on the switches.
5. Verify the configuration.
Step 2 Double-click PC3 and PC4, set the IP addresses of PC3 and PC4 respectively
according to the following figure, and click Apply.
Double-click LSW1 to enter the CLI. Run the following commands to enter the system
view and change the system name:
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SW1
[Huawei]vlan batch 10 20
# Run the dis this command on the two interfaces and verify the configurations.
Step 4 Configure GE0/0/1 as a trunk interface and configure it to allow packets from VLAN
10 and VLAN 20 to pass through.
Step 1 Double-click PC1 and click the CLI tab to enter the CLI. Ping the IP address of PC2
in the same VLAN.
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 38
Step 2 Double-click PC3 and click the CLI tab to enter the CLI. Ping the IP address of PC4
in the same VLAN.
Step 3 Change the default VLAN of the interface connecting LSW2 to PC2 to VLAN 20.
Step 4 Double-click PC1 and click the CLI tab to enter the CLI. Ping the IP address of PC2
again.
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 39
2.4.1.2 Objectives
Understand basic operations on Huawei Layer 3 switches.
Understand basic information in routing tables of Huawei Layer 3 switches.
Understand how to configure VLANIF interfaces on Huawei Layer 3 switches.
Understand how to configure static routes on Huawei Layer 3 switches.
Configure static routes on SW1 and SW2 so that users in different departments can
communicate with each other.
Interface
Device Interface VLAN VLANIF Interface
Type
2.4.1.5 Guideline
1. Set up a topology.
2. Configure IP addresses for the hosts.
3. Configure interfaces on the switches and configure IP addresses for the interfaces.
4. Configure static routes on the switches.
5. Verify the configuration on the hosts.
[Huawei]sysname SW1
[SW1]
[SW1]vlan batch 10 20 40
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 42
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]display ip routing-table
[Huawei]sysname SW2
[SW2]
Create VLANs.
[SW2]vlan batch 30 40
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW2]display ip routing-table
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 45
2.5 Quiz
After you run the display ip interface brief on an existing VLANIF interface on a switch,
the command output shows that the physical status and protocol status of the VLANIF
interface are both Down. Why does this occur?
Reference answer:
No physical interface assigned to the VLAN corresponding to the VLANIF interface is in
Up state.
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 47
3 Linux Exercise
3.1 Overview
3.1.1 About This Exercise
This section introduces the bash commands, file management commands, and network
configuration commands on the openEuler OS.
3.1.2 Objectives
Master bash commands.
Master file management commands.
Master the basic operations on the text editor.
Master the basic operations of openEuler system and network configurations.
3.2 Preparations
3.2.1 Creating a VM
Step 1 Open VirtualBox 6.1.34 and click New to create a VM.
Step 8 On the System > Motherboard tab page, change the boot order to boot from the
hard disk first.
Options:
-L print the value of $PWD if it names the current working
directory
-P print the physical directory, without any symbolic links
Exit Status:
Returns 0 unless an invalid option is given or the current directory
cannot be read.
[root@localhost ~]# help -d pwd
pwd - Print the name of the current working directory.
[root@localhost ~]# help -s pwd
pwd: pwd [-LP]
When entering a command, you can press Tab to automatically complete the command
or file path. For example, after you enter wh and press Tab, the following information is
displayed:
[root@localhost ~]# wh
whatis whereis which while whiptail who whoami
Step 4 Run the wget command to download a file from a specified URL.
Note that the host on which you run the wget command must be able to access the
Internet.
[root@localhost ~]# ls
anaconda-ks.cfg
[root@localhost ~]# ls .
anaconda-ks.cfg
# The command output indicates that the anaconda-ks.cfg file exists in the current directory.
[root@localhost ~]# ls ..
afs boot etc lib lost+found mnt proc run srv tmp var
bin dev home lib64 media opt root sbin sys usr
[root@localhost ~]# ls -a
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 59
View detailed information about non-hidden files and directories in the current
directory.
[root@localhost ~]#ls -l
total 4
-rw-------. 1 root root 1139 Jul 8 11:07 anaconda-ks.cfg
View detailed information about all files and directories in the current directory.
[root@localhost ~]# cd /
[root@localhost /]#
# Note that ~ changes to /.
[root@localhost sysconfig]# cd ..
[root@localhost etc]#
[root@localhost sysconfig]#cd
[root@localhost ~]#
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 60
[root@localhost sysconfig]# cd -
/etc
[root@localhost etc]#
[root@localhost test1]# cd
[root@localhost ~]# ls
anaconda-ks.cfg test1 test2 test3
[root@localhost ~]# rmdir /root/test1 # Deletes an empty directory.
[root@localhost ~]# ls
anaconda-ks.cfg test2 test3
[root@localhost ~]# mkdir /root/test1
[root@localhost ~]# touch /root/test1/huawei3.txt
[root@localhost ~]# rm -r /root/test1 # -r recursively deletes the directory and all files in the
directory.
Move the huawei.txt.bak file from the /root/test2 directory to the /root directory and
rename the file as huawei.txt.
[root@localhost test3]# cd
[root@localhost ~]# cp /etc/passwd ~
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 62
Step 2 Run the cat command to view the content of a small text file.
Step 3 Run the head commands to view the first several lines of a file.
View the first 10 lines of the file by default.
[root@localhost ~]# head passwd # If no option is added to the head command, the
first 10 lines of the file are displayed by default.
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
Step 4 Run the tail commands to view the last several lines of a file.
View the last 10 lines of the file by default.
[root@localhost etc]# tail passwd # Similar to head, if no option is added to the head command,
the last 10 lines of the file are displayed by default.
tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
chrony:x:995:992::/var/lib/chrony:/sbin/nologin
systemd-network:x:990:990:systemd Network Management:/:/usr/sbin/nologin
systemd-resolve:x:989:989:systemd Resolver:/:/usr/sbin/nologin
systemd-timesync:x:988:988:systemd Time Synchronization:/:/usr/sbin/nologin
gluster:x:987:987:GlusterFS daemons:/run/gluster:/sbin/nologin
radvd:x:75:75:radvd user:/:/sbin/nologin
qemu:x:107:107:qemu user:/:/sbin/nologin
dnsmasq:x:985:985:Dnsmasq DHCP and DNS server:/var/lib/dnsmasq:/usr/sbin/nologin h
Step 5 Run the less command to view (and search) the file content of a large file.
View the file. Press the up and down arrow keys to navigate the lines; press the space bar
to scroll one page forward; enter a slash (/) and a keyword to search for the keyword;
and press q to exit.
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
…
Step 6 Run the more command to view (and search) the file content of a large file.
View the file. Press the space bar to scroll one page forward or exit when you reach the
end of the file; enter a slash (/) and a keyword to search for the keyword; and press q to
exit.
Search for files that belong to user root in the /root directory.
This command can only be used to find binary files, source code files, and man pages.
View the location of the bash command.
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 65
Step 3 Run the following vim command to open the vimtutor file.
[root@openEuler ~]# vim vimtutor # Open the vimtutor file with vim. The tutorial home page is
displayed.
===============================================================================
= Welcome to the VIM Tutor - Version 1.7 =
===============================================================================
Vim is a very powerful editor that has many commands, too many to
explain in a tutor such as this. This tutor is designed to describe
enough of the commands that you will be able to easily use Vim as
an all-purpose editor.
The approximate time required to complete the tutor is 25-30 minutes,
depending upon how much time is spent with experimentation.
ATTENTION:
The commands in the lessons will modify the text. Make a copy of this
file to practise on (if you started "vimtutor" this is already a copy).
Step 4 Press j a few times to move the cursor down until you can see the full content of
section 1.1. Press k, j, h, and l keys to move the cursor up, down, left, and right,
respectively.
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 66
Step 6 Enter gg to move the cursor to the first line of the document; enter G to move the
cursor to the last line of the document.
Step 7 Enter ngg to move the cursor to line n of the document, for example, 10gg.
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 67
Step 3 Move the cursor to 5, and then enter P to paste the copied content above the
current line.
3.6.1.4 Undoing
Step 1 Enter u twice to undo the paste operations.
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 69
Step 2 Move the cursor down until you can see the full content of section 1.3.
Step 2 Move the cursor to text in the first line starting with --->, and then press i to enter
the insert mode.
Step 4 Move the cursor and enter other missing characters to make the first line the same
as the second. Press Esc to exit the insert mode and return to the normal mode.
:q!
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 73
Step 3 Enter :wq and press Enter to save and exit the tutorial.
:wq
:%s/Lesson/Class/g
[root@localhost ~]# hostname huawei # Change the host name temporarily. The change becomes
invalid after a restart.
[root@localhost ~]# hostname
huawei
[root@localhost ~]# bash # Start a new session.
Welcome to 5.10.0-60.18.0.50.oe2203.x86_64
System information as of time: system_time
System load: 0.16
Processes: 129
Memory used: 3.7%
Swap used: 0%
Usage On: 23%
IP address: 10.0.2.15
Users online: 3
[root@huawei ~]# # In the command prompt, the host name is changed to
huawei.
[root@huawei ~]# exit
exit
[root@localhost ~]#
Method 1:
[root@localhost ~]# hostnamectl set-hostname openEuler # This method requires a re-login
instead of a restart.
Method 2:
[root@localhost ~]# vim /etc/hostname
#Change the host name in the file, save the change, and exit. The host name is changed after the
system is restarted.
[root@localhost ~]# reboot
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen
1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default
qlen 1000
link/ether 08:00:27:a5:05:8a brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic noprefixroute enp0s3
valid_lft 83814sec preferred_lft 83814sec
inet6 fe80::e2e1:a18b:f73a:d89e/64 scope link noprefixroute
valid_lft forever preferred_lft forever
[root@openEuler ~]# ip addr add 192.168.110.100/24 dev enp0s3
[root@openEuler ~]# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen
1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default
qlen 1000
link/ether 08:00:27:a5:05:8a brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic noprefixroute enp0s3
valid_lft 83599sec preferred_lft 83599sec
inet 192.168.110.100/24 scope global enp0s3
valid_lft forever preferred_lft forever
inet6 fe80::e2e1:a18b:f73a:d89e/64 scope link noprefixroute
Step 2 Run the ip command to delete the temporary IP address of the network adapter.
# Set a static route to network range 192.168.2.0/24, with the next hop being the
gateway.
Step 4 Use the nmcli command to create a network connection and apply it to an
interface of the host:
View the current NetworkManager status.
[root@openEuler ~]# nmcli con add type ethernet con-name net-static ifname enp0s3 ip4
192.168.110.10/24 gw4 192.168.110.254
# conn indicates that the operation is performed on a connection.
# add adds (a connection).
# type indicates the type of the connection.
# con-name indicates the connection name.
# ifname indicates the name of the network adapter.
[root@openEuler ~]# nmcli connection show
Step 6 Change the host IP address using the configuration file of the ifcfg-enp0s3 network
adapter.
When configuring the network, change dhcp to static or none and add the following
information:
IPADDR=192.168.110.11
NETMASK=255.255.255.0
GATEWAY=192.168.110.254
[root@openEuler ~]# vim /etc/hosts # The hosts file records the mapping between host names
and IP addresses for quick domain name resolution. Add the following information to the end of the
file:
192.168.110.11 server # After adding this line, save the file and exit.
[root@openEuler ~]# ping server -c 3
PING server (192.168.110.11) 56(84) bytes of data.
64 bytes from server (192.168.110.11): icmp_seq=1 ttl=40 time=53.3 ms
64 bytes from server (192.168.110.11): icmp_seq=2 ttl=40 time=51.3 ms
Step 2 View the status of a service, for example, the firewall service.
[root@localhost ~]# id
uid=0(root) gid=0(root) groups=0(root)
Step 2 Log in to the system as user root, create users tom, bob, and jack, and set the UID
of jack to 1024.
[root@localhost ~]# userdel -r bob # Use the -r parameter to delete the user's
home directory.
[root@openEuler ~]# tail -3 /etc/passwd
tom:x:1000:1000::/home/tony/:/bin/bash
jack:x:1024:1024::/home/jack:/bin/bash
bob1:x:1025:1025::/home/myd:/bin/bash
Note: The command output shows the last three lines of the user configuration file. You
can see that user bob does not exist.
The bob directory does not exist in the /home directory.
3.8 Quiz
On Linux, how do we view the updated contents of a log file in real time?
Answer:
Run the tail -f /var/log/XX/file.log command to view the updated data of the log file.
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 82
4.1 Overview
4.1.1 About This Exercise
In this lab, bridged networks and NAT networks are configured to enable the
communication between VMs and external networks. This lab introduces two network
modes (NAT and bridge) in KVM virtualization to help trainees understand the basic
principles of communication between VMs and external networks. A computer with at
least 4 cores and 8 GB memory is recommended.
4.1.2 Objectives
Understand the basic principles of KVM virtualization.
Grasp the creation and process of KVM.
Grasp the features and configuration method of bridged networks and NAT
networks.
Connection
Device Port IP Address
Method
NIC 1
NAT 10.0.2.0/24 (service)
(enp0s3)
Host VM
NIC 2
Bridge 192.168.3.0/24 (management)
(enp0s8)
Network
Device IP Address Physical Interface
Bridge
2. Log in to VM 01, view the new IP address allocated by test, and verify its
connectivity with external networks.
Create a VM using bridges
1. Create virbr2, bind the planned physical service port enp0s3, and assign the IP
address of the original physical port to virbr2.
2. Specify virbr2 to create VM 02 and install the operating system on VM 02. Log
in to VM 02, view its IP address, test the connectivity between VM 02 and the
host VM or external networks, and verify the bridged network.
4.2.2 Procedure
4.2.2.1 Creating a Host VM
Step 1 Run Oracle VM VirtualBox Manager and click New to create a VM.
Step 4 Select Create a virtual hard disk now and click Create.
Figure 4-8 Selecting the location and size of the virtual hard disk
Step 7 On the main page of the software, click the created VM (openEuler) and Settings.
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 88
Step 8 On the openEuler – Settings page, choose System, click Motherboard, and adjust
the boot order to boot from the hard disk first.
Step 12 Enter the root password, confirm it, and click Done. Click Done.
Docs: man:firewalld(1)
[root@localhost ~]# cat /etc/selinux/config
[root@localhost ~]# yum -y install libvirt qemu virt-install wget net-tools bridge-utils
[root@localhost ~]# systemctl start libvirtd
[root@localhost ~]# systemctl enable libvirtd
[root@localhost opt]# virt-install --name vm01 --virt-type kvm --video vga --memory 1024 --vcpu 1 -
-disk size=8 --cdrom /opt/openEuler-22.03-LTS-x86_64-dvd.iso --network network=default --graphics
vnc,listen=0.0.0.0,port=5900,password=123456 --noautoconsole
Parameters
2. Run a VNC login tool, enter the management IP address (192.168.3.117), and the
port number (5900), and click OK.
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 101
1. Log in to VM 01 using VNC, view the current IP address, and test the connectivity
with external networks.
Alternatively, run the following commands to view the IP address of VM 01 on the host
VM and log in to VM 01 using SSH.
2. After logging in to the VM using VNC, run the ip addr command to view the current
IP address.
Note: The default network is in NAT mode, the specified bridge is virbr0, and the IP
address obtained by the VM is the one configured in the address pool for default.
3. Test the connectivity with external networks.
After change
<network>
<name>test</name> #The name has been changed to test.
<uuid>504fd670-7a5e-75e9-805e-2a78959734ef</uuid> #The UUID has been changed.
<forward mode='nat'/>
<bridge name='virbr1' stp='on' delay='0'/> #The designated bridge has been changed to
virbr1.
<mac address='52:54:00:1b:53:3b'/>
The <ip address='192.168.100.1' netmask='255.255.255.0'> #IP address has been changed.
<dhcp>
<range start='192.168.100.2' end='192.168.100.254'/> #The address pool has been modified.
</dhcp>
</ip>
</network>
HCIA-Cloud Computing V5.0 Lab Guide (Basic Exercises) Page 103
After change, the test.xml file is generated in /etc/libvirt/qemu/networks/. You can run
the following command to define and start test.
Reboot VM 01.
On the VM 01, run the ip addr command to view the current IP address.
Check whether the IP address is the IP address range of test.
1. Create virbr2, assign the IP address of the original physical interface to it, and bind it
to the physical service interface.
[root@localhost ~]# virt-install --name vm02 --virt-type kvm --video vga --memory 1024 --vcpu 1 --
disk size=10 --cdrom /opt/openEuler-22.03-LTS-x86_64-dvd.iso --network bridge=virbr2 --graphics
vnc,listen=0.0.0.0,port=5901,password=123456 --noautoconsole
[root@localhost ~]# virsh vncdisplay vm02
1
3. Log in to the VM using VNC referring to step 1 in Section 4.2.2.4, change the port
number to 5901, and install the OS.
4.3 Quiz
In KVM virtualization, what are the differences between NAT networks and bridged
networks in assigning IP addresses to VMs?
Answer:
NAT networks use the address pool configured on the corresponding network to assign IP
addresses to VMs. Bridged networks use the address segment of the physical interface or
bridge interface to allocate addresses to VMs.