search

What is centos virbr0

Jan 27, 2022 pm 03:23 PM

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.

What is centos virbr0

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!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
CentOS Automation with Ansible: Infrastructure as CodeCentOS Automation with Ansible: Infrastructure as CodeApr 10, 2025 am 09:40 AM

Use Ansible to implement automated management of CentOS. The specific steps include: 1) writing a playbook to define tasks, such as installing and configuring Apache; 2) executing the playbook through the SSH protocol to ensure consistency of system configuration; 3) using conditional judgment and loop functions to handle complex scenarios; 4) optimizing performance and following best practices, such as using asynchronous tasks and optimizing inventory files.

CentOS Interview Questions: Ace Your Linux System Administrator InterviewCentOS Interview Questions: Ace Your Linux System Administrator InterviewApr 09, 2025 am 12:17 AM

Frequently asked questions and answers to CentOS interview include: 1. Use the yum or dnf command to install software packages, such as sudoyumininstallnginx. 2. Manage users and groups through useradd and groupadd commands, such as sudouseradd-m-s/bin/bashnewuser. 3. Use firewalld to configure the firewall, such as sudofirewall-cmd--permanent-add-service=http. 4. Set automatic updates to use yum-cron, such as sudoyumininstallyum-cron and configure apply_updates=yes.

CentOS Troubleshooting: Diagnosing and Resolving Common IssuesCentOS Troubleshooting: Diagnosing and Resolving Common IssuesApr 08, 2025 am 12:09 AM

How to diagnose and solve common problems in CentOS system? First, check the startup log to solve the failure of system startup; second, check the network configuration file to solve the network problem; finally, use the Yum command to solve the package management problem. Through these steps, you can effectively diagnose and resolve common problems in CentOS systems.

CentOS Security Hardening: Protecting Your Server from IntrudersCentOS Security Hardening: Protecting Your Server from IntrudersApr 07, 2025 am 12:05 AM

CentOS server security reinforcement can be achieved through the following steps: 1. Keep the system software updated and use the "sudoyumupdate-y" command; 2. Disable unnecessary services, such as "sudosystemctldisablecups&&sudosystemctlstopcups"; 3. Configure SELinux as mandatory mode, use the "sudosetenforce1&&sudosed-i's/SELINUX=permissive/SELINUX=enforcing/g'/etc/selinux/config" command; 4. Regularly

Advanced CentOS System Administration: Mastering the Command LineAdvanced CentOS System Administration: Mastering the Command LineApr 06, 2025 am 12:10 AM

Advanced command line management skills of CentOS include: 1. Use systemctl to manage system services, 2. Use top to monitor system resources, 3. Use yum to manage software packages, 4. Use find and xargs to batch process files, 5. Use rsync to optimize file copying. These techniques can improve productivity, solve common problems, and optimize system performance.

CentOS Server Management: User Accounts, Permissions, and ServicesCentOS Server Management: User Accounts, Permissions, and ServicesApr 05, 2025 am 12:01 AM

In CentOS, how to manage user accounts, permissions and services? 1. Use the useradd command to create a user, 2. Use the usermod and groupmod commands to manage user permissions, 3. Use the systemd to manage services, such as the systemctlstart/stop/status command. Through these steps, CentOS servers can be managed efficiently to ensure their safe and efficient operation.

CentOS Backup and Recovery: Ensuring Data Integrity and AvailabilityCentOS Backup and Recovery: Ensuring Data Integrity and AvailabilityApr 04, 2025 am 12:02 AM

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.

CentOS Containerization with Docker: Deploying and Managing ApplicationsCentOS Containerization with Docker: Deploying and Managing ApplicationsApr 03, 2025 am 12:08 AM

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

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment