Linux bridge-utils Tunctl Use

Source: Internet
Author: User

Network BRCTL is used under Linux to manage the Ethernet bridge, in the kernel to establish, maintain, check the bridge configuration of the command stp-spanning tree Protocol (Spanning Tree Protocol) logically disconnect the loop, prevent two-layer network broadcast storm generated in the DHCP mode enabled ' Eth0 ' In a computer network, Tun and tap are virtual network devices in the operating system kernel. Different from the common hardware network card implementation of the device, these virtual network devices are all software implementation, and running on the operating system of the software to provide the hardware and network equipment exactly the same function. Tap equates to an Ethernet device that operates on a second layer of packets such as an Ethernet data frame. The Tun simulates a network-layer device, operating a third-tier packet such as an IP data packet. #1. To create a KVM bridging network mode, to install Bridge-utils Tunctlyum installed bridge-utils tunctl add a br0 Bridge (bridge type) brctl ADDBR br0ifconfig br0 up# Stepping the network disconnects the------------------------bind br0 with eth0 brctl addif br0 eth0 set BR0 to enable STP protocol Brctl STP BR0 On Eth0 IP is set to 0ifconfig eth0 0 use DHCP to assign Ipdhclient br0-------------------------to the br0 #最佳方式 (note modify to own IP) brctl addif br0 Eth0 && brctl stp br0 on && ifconfig eth0 0.0.0.0 && ifconfig br0 192.168.52.201 netmask 255.255.2 55.0 && route Add default GW 192.168.52.1# Create TAP type virtual network card device Tunctl-b-T vnet0ifconfig vnet0 upbrctl addif br0 VNET0BRC TL show# Create a virtual machine and associate a network card/usr/libexec/qemu-kvm-m 4096-smp 1-boot order=cd-hda/cloud/centos.img-net nic-net tap,ifname=vnet 0,script=no,downscript=no# Create a virtual machine and associate the network card and add MAC address/usr/libexec/qemu-kvm-m 2048-smp 1-boot order=cd-hda/cloud/centos.img-net nic,macaddr=52:54:00:12:34:57-net Tap , ifname=vnet0,script=no,downscript=no# sets the disk to semi-virtualized virtio<disk type= "file" device= "Disk" ><driver name= "Qemu "Type=" Qcow2 "/><source file="/cloud/centos.img "/> <target dev= ' vda ' bus= ' virtio '/></disk> Libvirtlibvirt is a free, open-source C Library of mainstream virtualization tools for Linux, designed to provide a convenient and reliable programming interface for various virtualization tools, including Xen, to support and C,c++,ruby,python, Java, and many other mainstream development language bindings. The default virtualization management Tools Virt-manager (graphical) on the current mainstream Linux platform, Virt-install (command line mode) are based on libvirt development. The Libvirt library is a Linux API that implements the Linux virtualization feature that supports a variety of hypervisors, including Xen and KVM, as well as QEMU and some virtual products for other operating systems # installation Libvirtyum install libvirt# boot li Bvirtservice LIBVIRTD start# One more Virbr0 bridge, which is a NAT type Virsh (very good virtualization command-line management tool, two modes: Swap mode and non-switching mode) define virtual machine Virsh Define/cloud /centos-base.xmlvirsh managing virtual Machines virsh# List--all # Show all virtual Machines--all Show all start virtual machines #virsh start CentOS shut down virtual machine #virsh shutdown CentOS mandatory off Machine #virsh destroy CentOS removal virtual machine #virsh undefine centos display VNC port #virsh vncdisplay centos Dynamic Query KVM Usage Resources #top-d 1 | GRep KVM Query KVM Process Ps-aux | grep KVM Boot autostart virtual machine #virsh autostart CentOS export virtual machine CentOS hardware configuration information for/cloud/centos.bak.xml#virsh dumpxml CentOS >/cloud/ Centos.bak.xml editing a virtual machine configuration #virsh Edit CentOS

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Linux bridge-utils Tunctl Use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.