宿主机(centos7)虚拟化软件 KVM 安装方法

一:安装KVM(Install KVM)

首先,进入宿主机,输入以下命令安装KVM。

yum install –y qemu-kvm libvirt virt-install bridge-utils virt-manager

确保模块已安装 (make sure modules are loaded)

lsmod | grep kvm

systemctl enable libvirtd
systemctl start libvirtd

二:配置桥接网卡

增加桥接网卡“br0” (add bridge “br0”)

nmcli c add type bridge autoconnect yes con-name br0 ifname br0

设置“br0”的 IP 地址(set IP for br0)

nmcli c modify br0 ipv4.addresses 10.10.8.6/23 ipv4.method manual

设置”br0”的gateway(set Gateway for br0)

nmcli c modify br0 ipv4.gateway 10.10.8.7

设置“br0”的 DNS(set DNS for “br0”)

nmcli c modify br0 ipv4.dns 10.10.8.37

删除原有网卡“enp7s0”(根据实际网卡名称更改, remove the current setting)

nmcli c delete enp7s0

将网卡“enp7s0”绑定至“br0”(add an interface again as a member of br0)

nmcli c add type bridge-slave autoconnect yes con-name enp7s0 ifname enp7s0 master br0

重启网络设置

systemctl restart NetworkManager

涉及的网卡具体参数

more /etc/sysconfig/network-scripts/ifcfg-br0

ip addr show

reboot

ip addr show

你可能感兴趣的:(linux)