VMware virtual CentOS 6.5 to configure a static IP address and Xshell remote control configuration in NAT mode

 

  Since research needs, it installed CentOS6.5 in VMware virtual machines under Win10, but not in the network configuration CentOS has encountered some problems. As we all know by Xshell tool to remotely manage virtual systems are fairly quick and easy on the host, but in the virtual NAT network mode system of the host but I always ping through virtual machine, toss a long time to get it. In this configuration the correct method of stepped pit after recording it, hoping to help to some students. This article is divided into two: 
CentOS6.5 configure a static IP address under 1. VMware in NAT network mode 
configuration Xshell tool 2. Windows host to a virtual remote control system

Second, configure a static IP address under VMware CentOS6.5 in NAT network mode

  1. Configuring NAT network mode in VMware 
    1.1 NAT mode in the virtual machine settings in the Network Adapter 
    Write pictures described here 
    1.2 in VMware toolbar click the "Edit" - "Virtual Network Editor" in the pop-up window, select "Change Settings" 
    Write pictures described here 
    1.3 pop window, select VMnet8, VMnet information and options for NAT mode, click the "NAT settings" 
    Write pictures described here 
    1.4 pop-up window, remember "gateway IP", then configure the IP address will be used. Select "Add" in "port forwarding" of 
    Write pictures described here 
    1.5 as follows in a pop-up window, which can set their own host port, recommended set value range is between 10,000 and 65,535; top three virtual IP address and the the top three in the same step gateway address, and indicates that the network segment, the last one can set the IP address of the virtual machine; the virtual machine port is set to 22, the default interface for the SSH protocol; "description" option can be set. After selecting the setting "OK", select "Apply" in the previous window and determine, so far VMware NAT network configuration in the end. 
    Write pictures described here
  2. 在CentOS中配置静态IP地址 
    2.1 打开CentOS,输入 
    ifconfig 
    查看网卡信息,注意信息中的网卡名: 
    Write pictures described here 
    上图中“eth0”即为网卡名,表示第一块网卡 
    2.2 静态IP地址配置主要用到以下三个文件: 
    /etc/sysconfig/network-scripts/ifcfg-eth0 
    /etc/sysconfig/network 
    /etc/resolv.conf 
    注意:第一个文件名中的“ifcfg-eth0”可能有所不同,实际使用时根据上一步中查看的网卡名进行设置 
    2.3 首先编辑/etc/sysconfig/network,配置如下: 
    Write pictures described here 
    其中GATEWAY即为之前查看到的网关地址 
    2.4 其次编辑/etc/sysconfig/network-scripts/ifcfg-eth0,若找不到该文件,则说明网卡eth0尚未启动,则可以创建该文件并配置如下: 
    Write pictures described here 
    其中IP地址为之前在NAT设置中配置的IP地址,NETMASK为子网掩码,GATEWAY即默认网关地址 
    注意:DNS1和DNS2必须填写,若不填写则无法进行域名解析,其中DNS1与GATEWAY地址相同,而DNS2则可选择常用的DNS服务器地址,这里使用的8.8.8.8是谷歌的DNS服务器 
    2.5 上一步配置完成后,系统会在/etc/resolv.conf文件中自动写入DNS服务器地址,如图: 
    Write pictures described here 
    2.6 配置完成后输入命令service network restart重启网络服务,至此静态IP配置完成,虚拟CentOS的IP地址为192.168.81.23
  3. 打开ssh服务 
    3.1 在配置Xshell前,要在系统中打开ssh服务,输入如下命令 
    打开ssh服务:service sshd start 
    设置开机运行ssh:chkconfig sshd on

三、配置Xshell工具

  1. Open Xshell tool, select "File" - "New" in the pop-up window, select "Connect", as follows: 
    Write pictures described here 
    . A protocol selection the SSH 
    . B Having the port number 2,210,023 port mapping host for the virtual machine, and therefore the host is set to 127.0.0.1, port number is set to "host port number" set in step 1.5, i.e., 10023
  2. Enter your login with a username and password in the "User Authentication" in: 
    Write pictures described here
  3. Successfully configured, click on the link to access the virtual system

Guess you like

Origin blog.csdn.net/zhaofuqiangmycomm/article/details/78531419