Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use bridge mode and static ip on public network in VMware under CentOS

2025-04-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how VMware uses bridge mode and static ip on external network under CentOS". In daily operation, I believe many people have doubts about how VMware uses bridge mode and static ip on external network under CentOS. I have consulted all kinds of information and sorted out simple and easy operation methods. I hope to help you answer the doubts about "how VMware uses bridge mode and static ip on external network under CentOS"! Next, please follow the small series to learn together!

1. vmware settings for bridge mode:

vmware->【edit】->【virtual network edit】

2. Virtual machine settings in bridge mode:

Third, the bridge mode settings static ip address

Virtual machines configured in bridged network connection mode are regarded as part of the Ethernet where the host is located. The relationship between virtual systems and host machines is like two computers connected to the same hub. They can access all shared resources and network connections in the Ethernet like hosts, and can directly share the Internet access lines of the host network to access the Internet. Host and virtual machines, as well as between virtual machines can visit each other. The corresponding virtual machine is regarded as an independent physical machine on the Ethernet where the host is located. Each virtual machine is connected to the host Ethernet through the default vmnet0 network card, and the virtual network between virtual machines is vmnet0. Your virtual machine acts like a separate physical machine on a local area network. The operating system in the virtual machine can ping other hosts, and vice versa. For them to communicate with each other, you need to configure the ip address and subnet mask for the virtual system, otherwise communication will not be possible.

So before configuring, I have to look at the IP address of the physical host: (I use wireless Internet card WiFi for the physical host here)

1. ipconfig Check IP address of physical host (IP address of network card used on external network)

2. Set the ip address of the linux virtual machine according to the ip address of the physical host:

vim /etc/sysconfig/network-scripts/ifcfg-eth0

device=eth0 #Virtual machine NIC name.

type=ethernet

onboot=yes #Boot enables network configuration.

nm_controlled=yes

bootproto=static #static, static ip, not dhcp, gets ip address automatically.

ipaddr=192.168.31.77 #Set the static IP address I want to use. It must be on the same network segment as the physical host, but it cannot be the same.

netmask=255.255.255.0 #subnet mask, just like the physical host.

getway=192.168.31.1 #Same as physical host

dns1=8.8.8.8 #dns, just write Google's address.

hwaddr=00:0c:29:22:05:4c

ipv6init=no

userctl=no

I use xshell to connect linux, so it looks clearer:

Restart network services:

[root@xiaolyu77 ~]# service network restart

3. Add the gateway address to the network configuration file/etc/sysconfig/network.

The copy code is as follows:

[root@xiaolyu77 ~]# vim /etc/sysconfig/networking =yeshostname=xiaolyu77gateway=192.168.31.1 #gateway address, same as gateway address of physical host

4. Testing:

1) Virtual machine ping physical host:

[root@xiaolyu77 ~]# ping 192.168.31.160

2)Physical host ping virtual machine

c:\users\administrator>ping 192.168.31.77

3)Virtual Machine Test Extranet:

[root@xiaolyu77 ~]# ping www.baidu.com

At this point, the study of "how to use bridge mode and static ip on external network under CentOS" is over, hoping to solve everyone's doubts. Theory and practice can better match to help you learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report