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

AI Hentai Generator
Generate AI Hentai for free.

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

This article explains how to restart a CentOS server using the command-line reboot command. It emphasizes the importance of saving data and gracefully shutting down applications before using sudo reboot to avoid data loss. Potential risks, includin

This guide details methods for restarting network services in CentOS 8. It compares using systemctl (recommended for reliability) with ifdown/ifup (faster, less robust). Troubleshooting steps for network outages are also provided, covering connecti

The article explains how to configure log rotation in CentOS using logrotate, detailing installation, configuration, and benefits like disk space management and security.

This article explains CentOS server reboot commands. It focuses on reboot for immediate restarts and shutdown -r for scheduled reboots, highlighting the differences and best practices for each. The main issue is providing clear instructions and con

This article discusses the discontinuation of CentOS and its replacement by CentOS Stream. It details how to find information, downloads, and verify the integrity of CentOS Stream ISOs, now primarily hosted on the Red Hat website. Community support

Article discusses installation, configuration, and troubleshooting of MySQL/MariaDB on CentOS, including system requirements and security measures.(159 characters)

The article discusses using Logical Volume Management (LVM) in CentOS for efficient storage management, detailing steps for setup, extension, and backup/restore processes, and highlighting LVM's advantages over traditional partitioning.

This guide details safe shutdown and reboot methods for CentOS 7 servers. It emphasizes using the shutdown command for its flexibility and ability to schedule restarts, contrasting it with the less-flexible reboot and halt commands. Safe practices
