What is centos virbr0
centos virbr0 is a Bridge created by KVM by default. Its function is to provide the virtual machine network card connected to it with the function of NAT access to the external network; virbr0 is assigned an IP "192.168.122.1" by default and provides access to the external network for other virtual machines. The network card provides DHCP service.
The operating environment of this article: CentOS 7 system, DELL G3 computer
What is centos virbr0?
Understanding virbr0
virbr0 is a Bridge created by KVM by default, and its function is to connect to it The virtual machine network card provides the function of NAT access to the external network.
virbr0 is assigned an IP 192.168.122.1 by default and provides DHCP services for other virtual network cards connected to it.
Below we demonstrate how to use virbr0.
Open the configuration interface of VM1 in virt-manager, select "default" for the network card Source device,
Hang the network card of VM1 on virbr0 .
Start VM1 and run brctl show to see that vnet0 has been hung on virbr0.
# brctl show bridge name bridge id STP enabled interfaces br0 8000.000c298decbe no eth0 virbr0 8000.fe540075dd1a yes vnet0
Use the virsh command to confirm that vnet is the virtual network card of VM1.
# virsh domiflist VM1 Interface Type Source Model MAC -------------------------------------------------- ----- vnet0 network default rtl8139 52:54:00:75:dd:1a
virbr0 uses dnsmasq to provide DHCP service, and you can view the process information on the host machine
ps -elf|grep dnsmasq
5 S libvirt 2422 1 0 80 0 - 7054 poll_s 11:26 ?
00:00:00 /usr/ sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf
in /var/lib/libvirt/ There is a default.leases file in the dnsmasq/ directory. After VM1 successfully obtains the DHCP IP,
you can view the corresponding information in the file
# cat /var/lib/libvirt/dnsmasq/default.leases 1441525677 52:54:00:75:dd:1a 192.168.122.6 ubuntu *
The above shows that 192.168.122.6 has been assigned to the MAC address52:54:00:75:dd:1a, this is the MAC of vnet0.
You can then use this IP to access VM1.
# ssh 192.168.122.6 root@192.168.122.6's password: Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.16.0-30-generic x86_64) Last login: Sun Sep 6 01:30:23 2015 root@VM1:~# ifconfig eth0 Link encap:Ethernet HWaddr 52:54:00:75:dd:1a inet addr:192.168.122.6 Bcast:192.168.122.255 Mask:255.255.255.0 inet6 addr: fe80::5054:ff:fe75:dd1a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:61 errors:0 dropped:0 overruns:0 frame:0 TX packets:66 errors:0 dropped:0 overruns:0 carrier:0 Collisions:0 txqueuelen:1000 RX bytes:7453 (7.4 KB) TX bytes:8649 (8.6 KB)
Ping the external network.
root@VM1:~# ping www.baidu.com PING www.a.shifen.com (180.97.33.107) 56(84) bytes of data. 64 bytes from 180.97.33.107: icmp_seq=1 ttl=52 time=36.9 ms 64 bytes from 180.97.33.107: icmp_seq=2 ttl=52 time=119 ms 64 bytes from 180.97.33.107: icmp_seq=3 ttl=52 time=88.5 ms 64 bytes from 180.97.33.107: icmp_seq=4 ttl=52 time=38.0 ms 64 bytes from 180.97.33.107: icmp_seq=5 ttl=52 time=122 ms
No problem, you can access the external network, indicating that NAT works.
It should be noted that the virtual machine VM1 using NAT can access the external network, but the external network cannot directly access VM1. Because the source address of the network packet sent by VM1 is not 192.168.122.6, but replaced by the IP address of the host by NAT.
This is different from using br0. In the case of br0, VM1 communicates directly with the external network through its own IP without going through NAT address translation.
Recommended: "centos usage tutorial"
The above is the detailed content of What is centos virbr0. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Zookeeper performance tuning on CentOS can start from multiple aspects, including hardware configuration, operating system optimization, configuration parameter adjustment, monitoring and maintenance, etc. Here are some specific tuning methods: SSD is recommended for hardware configuration: Since Zookeeper's data is written to disk, it is highly recommended to use SSD to improve I/O performance. Enough memory: Allocate enough memory resources to Zookeeper to avoid frequent disk read and write. Multi-core CPU: Use multi-core CPU to ensure that Zookeeper can process it in parallel.

Backup and Recovery Policy of GitLab under CentOS System In order to ensure data security and recoverability, GitLab on CentOS provides a variety of backup methods. This article will introduce several common backup methods, configuration parameters and recovery processes in detail to help you establish a complete GitLab backup and recovery strategy. 1. Manual backup Use the gitlab-rakegitlab:backup:create command to execute manual backup. This command backs up key information such as GitLab repository, database, users, user groups, keys, and permissions. The default backup file is stored in the /var/opt/gitlab/backups directory. You can modify /etc/gitlab

On CentOS systems, you can limit the execution time of Lua scripts by modifying Redis configuration files or using Redis commands to prevent malicious scripts from consuming too much resources. Method 1: Modify the Redis configuration file and locate the Redis configuration file: The Redis configuration file is usually located in /etc/redis/redis.conf. Edit configuration file: Open the configuration file using a text editor (such as vi or nano): sudovi/etc/redis/redis.conf Set the Lua script execution time limit: Add or modify the following lines in the configuration file to set the maximum execution time of the Lua script (unit: milliseconds)

Improve HDFS performance on CentOS: A comprehensive optimization guide to optimize HDFS (Hadoop distributed file system) on CentOS requires comprehensive consideration of hardware, system configuration and network settings. This article provides a series of optimization strategies to help you improve HDFS performance. 1. Hardware upgrade and selection resource expansion: Increase the CPU, memory and storage capacity of the server as much as possible. High-performance hardware: adopts high-performance network cards and switches to improve network throughput. 2. System configuration fine-tuning kernel parameter adjustment: Modify /etc/sysctl.conf file to optimize kernel parameters such as TCP connection number, file handle number and memory management. For example, adjust TCP connection status and buffer size

Using Docker to containerize, deploy and manage applications on CentOS can be achieved through the following steps: 1. Install Docker, use the yum command to install and start the Docker service. 2. Manage Docker images and containers, obtain images through DockerHub and customize images using Dockerfile. 3. Use DockerCompose to manage multi-container applications and define services through YAML files. 4. Deploy the application, use the dockerpull and dockerrun commands to pull and run the container from DockerHub. 5. Carry out advanced management and deploy complex applications using Docker networks and volumes. Through these steps, you can make full use of D

The CentOS shutdown command is shutdown, and the syntax is shutdown [Options] Time [Information]. Options include: -h Stop the system immediately; -P Turn off the power after shutdown; -r restart; -t Waiting time. Times can be specified as immediate (now), minutes ( minutes), or a specific time (hh:mm). Added information can be displayed in system messages.

The steps for backup and recovery in CentOS include: 1. Use the tar command to perform basic backup and recovery, such as tar-czvf/backup/home_backup.tar.gz/home backup/home directory; 2. Use rsync for incremental backup and recovery, such as rsync-avz/home//backup/home_backup/ for the first backup. These methods ensure data integrity and availability and are suitable for the needs of different scenarios.

Common problems and solutions for Hadoop Distributed File System (HDFS) configuration under CentOS When building a HadoopHDFS cluster on CentOS, some common misconfigurations may lead to performance degradation, data loss and even the cluster cannot start. This article summarizes these common problems and their solutions to help you avoid these pitfalls and ensure the stability and efficient operation of your HDFS cluster. Rack-aware configuration error: Problem: Rack-aware information is not configured correctly, resulting in uneven distribution of data block replicas and increasing network load. Solution: Double check the rack-aware configuration in the hdfs-site.xml file and use hdfsdfsadmin-printTopo
