Detailed explanation of the steps for configuring the Centos7 bridge network under VMware

Detailed explanation of the steps for configuring the Centos7 bridge network under VMware

The complete steps of Centos7 bridge network configuration under VMware virtual machine are for your reference. The specific contents are as follows

1. Open the virtual machine's settings page and set the virtual machine's bridge mode as shown in the figure: Select bridge mode (copying the physical network connection is optional)

2. Configure VMware virtual machine network in bridge mode

1. View the host network information:

ipconfig /all

Ethernet Adapter Local Area Connection:

 Connect to a specific DNS suffix. . . . . . :           
 Description . . . . . . . . . . . . . : Realtek PCIe GBE Family Controller 
 Physical address . . . . . . . . . . . . : 44-37-E6-D2-D6-A5     
 DHCP Enabled. . . . . . . . . . : YesAutoconfiguration Enabled. . . . . . . . . : YesIPv4 Address. . . . . . . . . . . : 192.168.0.107 (preferred)     
 Subnet mask . . . . . . . . . . . : 255.255.255.0      
 Time when the lease was obtained . . . . . . . . : March 18, 2019 9:16:04      
 Lease expiration date: 2019-03-20 5:38:07      
 Default gateway . . . . . . . . . . . . : 192.168.0.1       
 DHCP server . . . . . . . . . . : 192.168.0.1       
 DNS server . . . . . . . . . . : 192.168.0.1       
          192.168.0.1      
 NetBIOS over TCPIP . . . . . . : Enabled

2. Configure CentOS7 and fill in the corresponding information in the host into the corresponding positions below, static IP, subnet mask, default gateway, DNS

vi /etc/sysconfig/network-scripts/ifcfg-eno16777736

Note: The ifcfg-eno16777736 file may be different for each person

TYPE=Ethernet
BOOTPROTO=static #Change to static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777736
UUID=bf5337ab-c044-4af7-9143-12da0d493b89
DEVICE=eno16777736
ONBOOT=yes #Change to yes
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPADDR=192.168.0.200 # Customize the IP address of the virtual machine (the host is 192.168.0.107), which must be in the same network segment as the host NETMASK=255.255.255.0 # Set the subnet mask, the same as the host GETWAY=192.168.0.1 # Default gateway, the same as the host DNS1=192.168.0.1 # DNS, the same as the host
IP address: Set the IP address in the same network segment as the host machine
NETMASK: Subnet mask is the same as the host machine GATEWAY: Default gateway is the same as the host machine DNS1: Same as the host machine

3. Add gateway address

vi /etc/sysconfig/network

The content is as follows:

NETWORKING=yes
HOSTNAME=xxxx #The name is arbitrary GATEWAY=192.168.1.1 #The default gateway is the same as the host

4. Add DNS

vi /etc/resolv.conf

The content is as follows:

# Generated by NetworkManager
nameserver 192.168.0.1 #DNS, same as host

5. Restart the network

service network restart

3. Testing

1. Intranet access to its own static IP

[root@localhost Desktop]# ping 192.168.0.200
PING 192.168.0.200 (192.168.0.200) 56(84) bytes of data.
64 bytes from 192.168.0.200: icmp_seq=1 ttl=64 time=0.036 ms
64 bytes from 192.168.0.200: icmp_seq=2 ttl=64 time=0.043 ms
64 bytes from 192.168.0.200: icmp_seq=3 ttl=64 time=0.047 ms
64 bytes from 192.168.0.200: icmp_seq=4 ttl=64 time=0.046 ms
^C
--- 192.168.0.200 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2999ms
rtt min/avg/max/mdev = 0.036/0.043/0.047/0.004 ms

2. Access the public network

[root@localhost Desktop]# ping www.baidu.com
PING www.a.shifen.com (180.97.33.108) 56(84) bytes of data.
64 bytes from 180.97.33.108: icmp_seq=1 ttl=57 time=2.52 ms
64 bytes from 180.97.33.108: icmp_seq=2 ttl=57 time=2.04 ms
64 bytes from 180.97.33.108: icmp_seq=3 ttl=57 time=3.20 ms
64 bytes from 180.97.33.108: icmp_seq=4 ttl=57 time=2.20 ms
64 bytes from 180.97.33.108: icmp_seq=5 ttl=57 time=3.56 ms
64 bytes from 180.97.33.108: icmp_seq=6 ttl=57 time=2.08 ms
64 bytes from 180.97.33.108: icmp_seq=7 ttl=57 time=2.11 ms
64 bytes from 180.97.33.108: icmp_seq=8 ttl=57 time=2.37 ms
64 bytes from 180.97.33.108: icmp_seq=9 ttl=57 time=2.58 ms
64 bytes from 180.97.33.108: icmp_seq=10 ttl=57 time=3.61 ms
64 bytes from 180.97.33.108: icmp_seq=11 ttl=57 time=3.74 ms
64 bytes from 180.97.33.108: icmp_seq=12 ttl=57 time=2.81 ms
^C
--- www.a.shifen.com ping statistics ---
12 packets transmitted, 12 received, 0% packet loss, time 11021ms
rtt min/avg/max/mdev = 2.047/2.738/3.744/0.609 ms

3. Host machine accesses virtual machine

C:\Users\Administrator\Desktop
λ ping 192.168.0.200

Pinging 192.168.0.200 with 32 bytes of data:
Reply from 192.168.0.200: Bytes=32 Time<1ms TTL=64
Reply from 192.168.0.200: Bytes=32 Time<1ms TTL=64
Reply from 192.168.0.200: Bytes=32 Time<1ms TTL=64
Reply from 192.168.0.200: Bytes=32 Time<1ms TTL=64

Ping statistics for 192.168.0.200:
 Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Estimated round trip time in milliseconds:
 Shortest = 0ms, Longest = 0ms, Average = 0ms

4. Virtual machine accesses host machine

[root@localhost Desktop]# ping 192.168.0.107
PING 192.168.0.107 (192.168.0.107) 56(84) bytes of data.
64 bytes from 192.168.0.107: icmp_seq=1 ttl=128 time=0.487 ms
64 bytes from 192.168.0.107: icmp_seq=2 ttl=128 time=0.408 ms
64 bytes from 192.168.0.107: icmp_seq=3 ttl=128 time=0.394 ms
64 bytes from 192.168.0.107: icmp_seq=4 ttl=128 time=0.362 ms
64 bytes from 192.168.0.107: icmp_seq=5 ttl=128 time=0.401 ms
64 bytes from 192.168.0.107: icmp_seq=6 ttl=128 time=0.398 ms
64 bytes from 192.168.0.107: icmp_seq=7 ttl=128 time=0.434 ms
^C
--- 192.168.0.107 ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6005ms
rtt min/avg/max/mdev = 0.362/0.412/0.487/0.036 ms

If you still cannot ping the Internet, you may need to select the following network card:

VMware Menu Bar -> Edit -> Virtual Network Editor

Make a switch and save it.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • VMware's detailed tutorial on how to create a Linux virtual machine and set up a virtual machine network
  • CentOS7 network configuration under VMware virtual machine (host wireless Internet access)
  • VMWare virtual machine 15.X LAN network configuration tutorial diagram
  • Solution to Ubuntu 18.04 not being able to connect to the network in VMware virtual machine
  • How to set up VMWare Fusion network on MAC
  • Detailed introduction to CentOS 7 network settings in vmware
  • The difference between VMware's three network connection methods
  • Analysis of the implementation process of three modes of VMWare network adapter

<<:  JS asynchronous code unit testing magic Promise

>>:  Detailed explanation of Vue development website SEO optimization method

Recommend

CSS positioning layout (position, positioning layout skills)

1. What is positioning? The position attribute in...

How to redirect PC address to mobile address in Vue

Requirements: The PC side and the mobile side are...

GDB debugging MySQL actual combat source code compilation and installation

Download source code git clone https://github.com...

Nginx try_files directive usage examples

Nginx's configuration syntax is flexible and ...

How to install a virtual machine with Windows services on Mac

1. Download the virtual machine Official download...

Let's talk about the v-on parameter problem in Vue

Use of v-on:clock in Vue I'm currently learni...

How to install golang under linux

Go is an open source programming language that ma...

Linux uses shell scripts to regularly delete historical log files

1. Tools directory file structure [root@www tools...

Steps to repair grub.cfg file corruption in Linux system

Table of contents 1. Introduction to grub.cfg fil...

Implementing a simple Christmas game with JavaScript

Table of contents Preface Achieve results Code CS...