Home > System Tutorial > LINUX > body text

Network card allocation problem under vmware

WBOY
Release: 2024-08-19 04:40:02
Original
932 people have browsed it
Configure network card and randomly assign IP address

I installed the basic server version and used NAT mode

Network card allocation problem under vmware

Then, make sure these two are started in the service

Network card allocation problem under vmware

When centos was first installed, there was no eth0 network card.

Network card allocation problem under vmware

cd /etc/sysconfig/network-scripts
Copy after login

Then ls, you can see that ifcfg-eth0 exists, but it is not activated

Network card allocation problem under vmware

vi ifcfg-eth0
Copy after login

You can see it as follows

Network card allocation problem under vmware

Press the "insert" key to enter editing mode. Set ONBOOT=yes, then press the "esc" key, ":" key, "w" key, "q" key, ifcfg-eth0 is modified

service network restart
Copy after login

Network card allocation problem under vmware

Then ifconfig, you can see that eth0 has been randomly assigned an IP address

Network card allocation problem under vmware

Ping baidu.com, you can see that you can connect to the Internet (ctrl+c to exit ping)

Network card allocation problem under vmware

At this time, remote tools such as putty and winscp can be connected

Fixed IP address

Virtual machine-->Edit-->Virtual network editor-->vmnet8-->nat settings

Network card allocation problem under vmware

In this page, you can see that the gateway IP is "192.168.255.2" (each machine is different)

Close the gateway viewing page and click the "DHCP Settings" button at the bottom of the page

You can view network information, including:

开始IP地址为“192.168.255.128”

结束IP地址为“192.168.255.254”

子网掩码为“255.255.255.0”
Copy after login

Network card allocation problem under vmware

Check the status of "VMware Network Adapter VMnet8" in Network and Sharing Center

Network card allocation problem under vmware

192.168.255.1 是虚拟路由器为Windows分配的地址

192.168.255.2 是虚拟路由器的网关地址
Copy after login

Then, in centos, enter the command "vi /etc/sysconfig/network-script/ifcfg-eth0" to modify the eth0 information, and press the "insert" key to modify it

Modify information:

ONBOOT=yes

BOOTPROTO=static
Copy after login

Add information:

IPADDR=192.168.255.100(根据网关自行调整)

NETMASK=255.255.255.0

GATEWAY=192.168.255.2
Copy after login

Network card allocation problem under vmware
After modification, press the "esc key", ":" key, "w" key, and "q" key

service network restart
Copy after login

Network card allocation problem under vmware

If *** is already in use for device eth0 error occurs, add ARPCHECK=no to the ifcfg-eth0 file just now
Network card allocation problem under vmware

View the newly configured IP
Network card allocation problem under vmware

Can the speed test be connected to the Internet?
Network card allocation problem under vmware

Done

The above is the detailed content of Network card allocation problem under vmware. For more information, please follow other related articles on the PHP Chinese website!

source:linuxprobe.com
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!