CentOS specified IP in virtual machine

Source: Internet
Author: User

1. Modify the VM Internet mode to host only
2. Start the virtual machine
3.rm-rf/etc/udev/rules.d/70-persistent-net.rules
4. Modify the network configuration of the virtual machine:
(1) Vi/etc/sysconfig/network-scripts/ifcfg-eth0
(2) Modify the device value to eth0
(3) Delete hwaddr line
(4) Comment out Bootproto=dhcp
(5) Added: ipaddr=192.168.0.10x
netmask=255.255.255.0
gateway=192.168.0.1

7.vi/etc/resolv.conf, will nameserver 192.168.0.1

10. Turn off the firewall:
Service Iptables Stop
Permanently closed: Chkconfig iptables off
Check if shutdown: Service iptables status
11. Turn off SELinux
Vi/etc/selinux/config
Comment out selinux=enforcing
selinux=targeted
Increase selinux=disabled


5. In the native network configuration, the VMware networks Adapter Vmnet1,ip is changed to 192.168.0.1, Subnet mask 255.255.255.0
6. Share the native Internet network adapter to the VMware network Adapter VMnet1
8. Restart the virtual machine
9.ping native, network, native ping virtual machine


Copy to Google TranslateTranslation Results

CentOS specified IP in virtual machine

Related Article

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.