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

After VMWARE replicates the virtual machine, you need to reconfigure the network card (CENTOS 6)

2025-02-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

After copying a virtual machine using VMWARE, you will encounter the situation that the network card is not available. At this time, you need to manually reconfigure the network card.

The following is the configuration of the network card for REDHAT 6 (CENTOS 6) version. For 7 version, please see another blog.

Procedure:

1. View the MAC address of the current virtual machine

Ip addr

[root@node1 rules.d] # ip addr

1: lo: mtu 16436 qdisc noqueue state UNKNOWN

Link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

Inet 127.0.0.1/8 scope host lo

Inet6:: 1/128 scope host

Valid_lft forever preferred_lft forever

2: eth2: mtu 1500 qdisc pfifo_fast state UP qlen 1000

Link/ether 00:0c:29:5c:a5:f5 brd ff:ff:ff:ff:ff:ff

Inet 192.168.159.160/24 brd 192.168.159.255 scope global eth2

Inet6 fe80::20c:29ff:fe5c:a5f5/64 scope link

Valid_lft forever preferred_lft forever

2. Modify / etc/udev/rules.d/70-persistent-net.rules

Vi / etc/udev/rules.d/70-persistent-net.rules

# This file was automatically generated by the / lib/udev/write_net_rules

# program, run by the persistent-net-generator.rules rules file.

#

# You can modify it, as long as you keep each rule on a single

# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100f (e1000)

# SUBSYSTEM== "net", ACTION== "add", DRIVERS== "? *", ATTR {address} = = "00:0c:29:09:90:84", ATTR {type} = = "1", KERNEL== "eth*", NAME= "eth0"

# PCI device 0x8086:0x100f (e1000)

SUBSYSTEM== "net", ACTION== "add", DRIVERS== "? *", ATTR {address} = = "00:0c:29:5c:a5:f5", ATTR {type} = = "1", KERNEL== "eth*", NAME= "eth2"

Comment out the red part

3. Rename the Nic configuration file

Cd / etc/sysconfig/network-scripts/

Mv ifcfg-eth0 ifcfg-eth2

Here, change the eth* to the same as in the 70-persistent-net.rules file, and pay attention to the contents of the ip addr.

4. Edit the network card configuration file

Vi ifcfg-eth2

DEVICE= "eth2"

BOOTPROTO= "static"

HWADDR= "00:0C:29:5C:A5:F5"

IPV6INIT= "yes"

NM_CONTROLLED= "yes"

ONBOOT= "yes"

TYPE= "Ethernet"

UUID= "e618ec6a-8bb0-4202-8fe6-54febd0f8c76"

IPADDR=192.168.159.160

NETMASK=255.255.255.0

GATEWAY=192.168.159.1

Modify the red part.

In the first line, modify eth* to be the same as in the 70-persistent-net.rules file. Pay attention to the contents in ip addr.

The second line is changed to static IP

The third line is modified to be the same as the MAC address found by ip addr

The last three lines are IP address, subnet mask and gateway, all of which should be configured. If there is a DNS, you can also set it.

DNS1=192.168.159.3

DNS2=192.168.159.4

5. Restart the network card

Service network restart

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: 225

*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

Servers

Wechat

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

12
Report