Linux network configuration and cloning

 

 

 

After the installation is complete Linux system can look ip: ifconfig command.

 

Newly installed Linux systems only an IP loopback address 127.0.0.1, no specific ip address value

As the windows have

IP address, subnet mask, default gateway, dns. These can be automatically acquired, under Linux we have to configure these address values

Configure the IP address

Enter the directory: cd / etc / sysconfig / network-scripts /

We show you what directory: ls below these documents

Locate the first file ifcfg-eth0 file default card

Use Linux editor vi ifcfg-eth0

DEVICE = eth0 refers to the equipment we use

It means a physical HWADDR's MAC address

UUID is an identifier can be removed

Are onboot boot, change yes

bootproto into static

Modification can click a, began to modify the contents section

See your Virtual Network Editor, look at how much your own network

 

Not the same for everyone, find no conflict of values ​​3-254 LAN. 0,1,2 and 255 are occupied, all these values ​​do not configure

Delete the UUID and MAC address

ONBOOT=yes

BOOTPROTO=static

IPADDR=192.168.9.22

NETMASK=255.255.255.0

GATEWAY=192.168.9.2

DNS1 = 114114114114

dns2 can not configure

chestnut:

Press Esc. : Wq Save the file to

After saving, enter the directory /etc/udev/rules.d/

Command: cd /etc/udev/rules.d/

ls view the file, there are four files

Where the 70-persistent-net.rules this document is to MAC binding file, just delete the MAC address, so I have to delete this file out

Delete files: rm -fr /etc/udev/rules.d/70-persistent-net.rules

Restart the virtual machine: init 6 or shutdown: poweroff

After the restart continue to log in to view the ip

One more ip address, you can ping the external network test, network configuration is complete so that amount.

Supplementary Snapshot

Operation here can take a snapshot.

Take a snapshot point

给快照取一个名字,这里我起名字叫basic。当我们重新恢复时候还可以用此快照

快照也可以做为一个镜像,之后再安装的时候可以直接使用镜像

栗子:

打开刚才拍摄快照,点击克隆

下一步

我这里就选择了连接克隆,这个占用磁盘比较少而已。

 

 

更改虚拟机名字,就可以完成创建虚拟机。比安装快捷很多。

进入克隆的Linux中更改ip地址,和刚才是一样套路

 

 更改完,删除70-persistent-net.rules文件:init 6重启即可

完毕。

 

Guess you like

Origin www.cnblogs.com/zhtiy/p/11059038.html