日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux跨ip拷贝,Linux的虚拟机拷贝到另外的操作系统时,NAT方式的静态IP无效,一直是获取的DHCP动态地址...

發布時間:2025/3/15 linux 15 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux跨ip拷贝,Linux的虚拟机拷贝到另外的操作系统时,NAT方式的静态IP无效,一直是获取的DHCP动态地址... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、問題:

1、Linux虛擬機在A機的虛擬機中是NAT方式DHCP動態獲取IP,設置了靜態地址,IP地址不會發生變化,但是拷貝到B機上的虛擬機后,一直獲取的時動態IP地址,無法得到靜態IP。

2、執行/etc/init.d/network restart報錯:

[root@master init.d]#./network restart

正在關閉接口 ens33:錯誤:[/etc/sysconfig/network-scripts/ifdown-eth]設備具有 MAC 地址00:00:00:00:00:00

00:0C:29:94:8E:A2,而不是配置的地址00:0C:29:8B:9A:F2。忽略。

[失敗]

正在關閉環回接口:Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'

Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'

Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'

Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'

[確定]

正在打開環回接口:Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'

Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'

Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'

Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'

[確定]

正在打開接口 ens33:錯誤:沒有找到可用于連接'ens33'的設備。

[失敗]

3、執行 systemctl restart network報錯:

Jobfor network.service failed.See"systemctl status network.service" and "journalctl -xe"for details.

4、執行journalctl -xe報錯:

5月2600:29:28 master /etc/sysconfig/network-scripts/ifdown-eth[1350]:設備具有 MAC 地址00:00:00:00:00:00

00:0C:29:94:8E:A2,而不是配置的地址00:0C:29:8B:9A:F2。忽略。

5月2600:29:28 master NetworkManager[709]: parsing /etc/sysconfig/network-scripts/ifcfg-lo ...

5月2600:29:28 master NetworkManager[709]: parsing /etc/sysconfig/network-scripts/ifcfg-lo ...

5月2600:29:28 master NetworkManager[709]: parsing /etc/sysconfig/network-scripts/ifcfg-lo ...

5月2600:29:28 master NetworkManager[709]:(lo): link disconnected

5月2600:29:28 master NetworkManager[709]: parsing /etc/sysconfig/network-scripts/ifcfg-lo ...

5月2600:29:28 master NetworkManager[709]: parsing /etc/sysconfig/network-scripts/ifcfg-lo ...

5月2600:29:28 master NetworkManager[709]: parsing /etc/sysconfig/network-scripts/ifcfg-lo ...

5月2600:29:28 master NetworkManager[709]:(lo): link connected

5月2600:29:29 master NetworkManager[709]: parsing /etc/sysconfig/network-scripts/ifcfg-lo ...

5月2600:29:29 master NetworkManager[709]: parsing /etc/sysconfig/network-scripts/ifcfg-lo ...

5月2600:30:39 master systemd[1]:Configuration file /usr/lib/systemd/system/tog-pegasus.service is marked world-inaccessible.This has no effect as configuration data is acce

5月2600:30:40 master systemd[1]:Configuration file /usr/lib/systemd/system/tog-pegasus.service is marked world-inaccessible.This has no effect as configuration data is acce

5月2600:30:40 master systemd[1]:Configuration file /usr/lib/systemd/system/tog-pegasus.service is marked world-inaccessible.This has no effect as configuration data is acce

5月2600:30:41 master systemd[1]:Configuration file /usr/lib/systemd/system/tog-pegasus.service is marked world-inaccessible.This has no effect as configuration data is acce

5月2600:30:41 master systemd[1]:Configuration file /usr/lib/systemd/system/tog-pegasus.service is marked world-inaccessible.This has no effect as configuration data is acce

5月2600:30:41 master systemd[1]:Configuration file /usr/lib/systemd/system/tog-pegasus.service is marked world-inaccessible.This has no effect as configuration data is acce

5月2600:30:41 master systemd[1]:Configuration file /usr/lib/systemd/system/tog-pegasus.service is marked world-inaccessible.This has no effect as configuration data is acce

5月2600:30:41 master systemd[1]:Configuration file /usr/lib/systemd/system/tog-pegasus.service is marked world-inaccessible.This has no effect as configuration data is acce

5月2600:30:41 master systemd[1]:Configuration file /usr/lib/systemd/system/tog-pegasus.service is marked world-inaccessible.This has no effect as configuration data is acce

5月2600:30:42 master systemd[1]:Configuration file /usr/lib/systemd/system/tog-pegasus.service is marked world-inaccessible.This has no effect as configuration data is acce

5月2600:30:42 master systemd[1]:Configuration file /usr/lib/systemd/system/tog-pegasus.service is marked world-inaccessible.This has no effect as configuration data is acce

5月2600:30:42 master systemd[1]:Configuration file /usr/lib/systemd/system/tog-pegasus.service is marked world-inaccessible.This has no effect as configuration data is acce

5月2600:30:53 master NetworkManager[709]: parsing /etc/sysconfig/network-scripts/ifcfg-lo ...

5月2600:30:53 master network[1685]:正在打開環回接口:Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'

5月2600:30:53 master NetworkManager[709]: parsing /etc/sysconfig/network-scripts/ifcfg-lo ...

5月2600:30:53 master network[1685]:Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'

5月2600:30:53 master NetworkManager[709]: parsing /etc/sysconfig/network-scripts/ifcfg-lo ...

5月2600:30:53 master network[1685]:Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'

5月2600:30:53 master NetworkManager[709]: parsing /etc/sysconfig/network-scripts/ifcfg-lo ...

5月2600:30:53 master network[1685]:Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'

5月2600:30:54 master network[1685]:[確定]

5月2600:30:54 master network[1685]:正在打開接口 ens33:錯誤:沒有找到可用于連接'ens33'的設備。

5月2600:30:54 master network[1685]:[失敗]

5月2600:30:54 master network[1685]: RTNETLINK answers:File exists

5月2600:30:54 master network[1685]: RTNETLINK answers:File exists

5月2600:30:54 master network[1685]: RTNETLINK answers:File exists

5月2600:30:54 master network[1685]: RTNETLINK answers:File exists

5月2600:30:54 master network[1685]: RTNETLINK answers:File exists

5月2600:30:54 master network[1685]: RTNETLINK answers:File exists

5月2600:30:54 master network[1685]: RTNETLINK answers:File exists

5月2600:30:54 master network[1685]: RTNETLINK answers:File exists

5月2600:30:54 master network[1685]: RTNETLINK answers:File exists

5月2600:30:54 master systemd[1]: network.service: control process exited, code=exited status=1

5月2600:30:54 master systemd[1]:Failed to start LSB:Bring up/down networking.

--Subject:Unit network.service has failed

--Defined-By: systemd

--Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

--

--Unit network.service has failed.

--

--The result is failed.

5月2600:30:54 master systemd[1]:Unit network.service entered failed state.

5月2600:30:54 master systemd[1]: network.service failed.

二、解決:

Linux虛擬機從A拷貝到B后,MAC地址發生改變,但是配置文件中并沒有同步修改,導致此問題。

1、首先執行ifconfig查看新的MAC地址:

ens33: flags=4163 mtu 1500

inet 192.168.130.109 netmask 255.255.255.0 broadcast 192.168.130.255

inet6 fe80::20c:29ff:fe94:8ea2 prefixlen 64 scopeid 0x20

ether 00:0c:29:94:8e:a2 txqueuelen 1000(Ethernet)

RX packets 550 bytes 48524(47.3KiB)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 604 bytes 94343(92.1KiB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73 mtu 65536

inet 127.0.0.1 netmask 255.0.0.0

inet6 ::1 prefixlen 128 scopeid 0x10

loop txqueuelen 0(LocalLoopback)

RX packets 8 bytes 800(800.0 B)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 8 bytes 800(800.0 B)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

可以看出ens33網卡對應的MAC地址為:00:0c:29:94:8e:a2,即ether對應的地址。

2、修改ens33網卡對應的MAC地址

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

TYPE="Ethernet"

DEFROUTE="yes"

IPV4_FAILURE_FATAL="no"

NAME="ens33"

UUID="707084bc-d3aa-483f-878b-c93e6abf4a07"

ONBOOT="yes"

HWADDR="00:0C:29:8B:9A:F2"

BOOTPROTO="static"

NM_CONTROLLED="yes"

IPADDR="192.168.130.101"

NETMASK="255.255.255.0"

GATEWAY="192.168.130.2"

將HWADDR改為00:0c:29:94:8e:a2即可。

總結

以上是生活随笔為你收集整理的linux跨ip拷贝,Linux的虚拟机拷贝到另外的操作系统时,NAT方式的静态IP无效,一直是获取的DHCP动态地址...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。