Setting a static IP under virtual machine CENTOS7 and supporting Xshell remote login setting method

Source: Internet
Author: User

1. Set the virtual machine to use bridge mode

2. Open the configuration file with Vi/etc/sysconfig/network-scripts/ifcfg-enp0s3 (where Enp0s3 is the name of your Linux network adapter, use IP addr in the shell) command to view its own name and change it to its own, immediately after the number of the argument is, not lo that)


Modify the following parameters
Change bootproute= "DHCP" to bootproute= "static"
Change onboot= "No" to onboot= "yes"

Then add the following parameters (location optional)

Ipaddr= "192.168.0.150" (note: Because the use of "bridge mode", so the IP address here must be and host in a network segment, set up to look at the host IP)
netmask= "255.255.255.0"
Nm_controlled= "No"

3. Turn off the firewall and enable the firewall to turn on port 22
sudo firewall-cmd--zone=public--add-port=22/tcp--permanent

4. Turn the firewall back on
sudo systemctl restart Firewalld.service

5. Restart the Network Service
sudo systemctl restart Network.service

6. Rebooting the system
Right-click Centos7, restart

7. Open the Xshell client
Input IP 192.168.0.150 connection, configuration complete

-------------------------------------------

Often make mistakes

1. Failed to restart Network service and virtual machine after modifying parameters
2. Firewall open 22 Port not set

Setting a static IP under virtual machine CENTOS7 and supporting Xshell remote login setting method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.