Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Sample code for kvm bridge mode

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail the sample code about the kvm bridging mode. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

1. Host-add br0 Bridge

Host information: IP is: 192.168.2.13 network card is: ens33 operation: (1). Add a br0 bridge vi / etc/sysconfig/network-scripts/ifcfg-br0 DEVICE=br0 TYPE=Bridge BOOTRPOTO=static IPADDR=192.168.2.13 NETMASK=255.255.255.0 GATEWAY=192.168.2.1 DNS1=192.168.2.1 ONBOOT=yes to restart the network service: service network restart View Bridge: btctl show (2). Change ens33 to bridge to: vim / etc/sysconfig/network-scripts/ifcfg-ens33 on br0 add: BRIDGE=br0 modify: BOOTPROTO=dhcp to BOOTPROTO=none (3). Association: bridging, network card mode 1: brctl addif br0 ens33 unbinding: brctl delif br0 ens33 mode 2: service network restart (4). Create a hard disk: qemu-img create-f raw / opt/CentOS-7.4-0-x86_64.raw 10G (5). Upload centos image file: / usr/local/src/CentOS-7.4.1708-x86_64-DVD.iso (6). Create a virtual machine: virt-install-- name node1-- virt-type kvm-- ram 1024-- cdrom=/usr/local/src/CentOS-7.4.1708-x86_64-DVD.iso-- disk=/opt/CentOS-7.4-0-x86_64.raw-- network bridge=br0-- graphics vnc,listen=0.0.0.0-- noautoconsole use the vnc link to install centos for [client]

two。 Client-operation

(1)。 Manually configure the bridging br0:

This is the end of this article on "sample code for kvm bridging mode". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report