Configuring a virtual machine system LInux network environment to networked systems detailed steps

There are many ways to configure the network environment, I am here to talk about a common use profile settings

First, you have to first of all your installed Linux system, run the virtual machine, enter the terminal

Second, Amway about Linux common commands

1, open the file, save (using the following vi command mode) closes the file

vi filename // Open the file filename
: w // save the file
: w vpser.net // save to vpser.net file
: q // exit the editor, if the file has been modified, please use the following command
:! q // exit the editor device without saving
: wq // exit the editor and save the file

2, insert text or lines (vi after using the command mode, execute the following command to enter the insert mode, press the ESC key to exit insert mode)

a // add text to the right of the current cursor position
i // add text to the left of the cursor position
A // add text to the end of the current line
I // add the text (non-blank lines at the beginning of the current row first)
O // new row above the current row
o // create a new row below the current row
R // replacing (overwriting) the current text cursor position and the plurality of rear
J // merge the cursor line and the next line behavior ( still in command mode)

Second, configure the network environment for nat mode

In the configuration settings of virtual machines in

Here Insert Picture Description

Third, open the Virtual Network Editor, view their Linux network segment which segment it

1, a virtual machine edit ➡ ➡ Virtual Network Editor

Here Insert Picture Description

2, select the virtual machine, enter the NAT settings, remember your subnet IP, subnet mask, gateway IP, use the back

Here Insert Picture Description

Fourth, configure ifcig-eth0

1, into the terminal, vi / etc / sysconfig / network-scripts / ifcfg-eth0 edit ifcig-eth0

Here Insert Picture Description

vi is a file for editing, here at the White Amway Linux common commands

一、打开文件、保存、关闭文件(vi命令模式下使用)

vi filename //打开filename文件
:w //保存文件
:w vpser.net //保存至vpser.net文件
:q //退出编辑器,如果文件已修改请使用下面的命令
:q! //退出编辑器,且不保存
:wq //退出编辑器,且保存文件

二、插入文本或行(vi命令模式下使用,执行下面命令后将进入插入模式,按ESC键可退出插入模式)

a //在当前光标位置的右边添加文本
i //在当前光标位置的左边添加文本
A //在当前行的末尾位置添加文本
I //在当前行的开始处添加文本(非空字符的行首)
O //在当前行的上面新建一行
o //在当前行的下面新建一行
R //替换(覆盖)当前光标位置及后面的若干文本
J //合并光标所在行及下一行为一行(依然在命令模式)

2、i 进入编辑状态,

Here Insert Picture Description

3、修改配置信息、注意区分大小写

Here Insert Picture Description

BOOTPROTO=“static” dhcp改为static
ONBOOT=“yes” 开机启用本配置
IPADDR=192.168.110.110 静态IP(这里的前三部分要和虚拟网络配置查看的子网IP一只,最后一部分只要不是1不和主机一样就可以,我这里随便取了110)
GATEWAY=192.168.110.2 默认网关(和你之前查看的虚拟网络配置里的一样)
NETMASK=255.255.255.0 子网掩码(和你之前查看的虚拟网络配置里的一样)
DNS1 = 8.8.8.8 DNS configuration (DNS domain name resolver is recommended to use Tencent DNS119.29.29.29,8.8.8.8 is Google, there is a local DNS server, query methods win + R cmd into the command prompt box, enter ipconfig / all to see your local DNS server, but if you replace the network, then that this DNS server can not be used)

Here Insert Picture Description

After modification

Here Insert Picture Description

4, ESC to exit edit mode, enter: wq to save and exit, enter the command service network restart /etc/init.d/network restart or reboot Network Configuration

Here Insert Picture Description

Five, the ping about www.baidu.com

Here Insert Picture Description

Can ping the network environment and configuration is completed, terminates command ctrl + C and then the OK
Next, how to configure the network environment of the clones

Guess you like

Origin blog.csdn.net/xiao_xiao_b/article/details/90745735