When Linux is installed on VMware, the default set of dynamic IP, each start of the IP is different, remote connection is very laborious.
So, you need to set a static IP, at least I am more convenient to connect from the remote tool. In addition, in order to install some software, also need to access the Internet.
> Release Notes
cat /etc/6.5 (Final) Kernel \ r on an \m
> VMware Settings
Network configuration for virtual machines: Right-click > Settings > Network adapter > Bridging mode (B): Direct connection to physical network
> Set static address, gateway address
Because the network is shared with a PC (not a virtual machine), query the network-related information that the PC is connected to, such as the default gateway
c:\users\administrator>ipconfigwindows IP configurationethernet Adapter Local Area Connection: Connection- Specific DNS Suffix .: 192.168. 1.3 255.255. 255.0 192.168. 1.1
PC with 192.168.1.3, then the virtual machine with 192.168.1.9 bar, the default gateway is 192.168.1.1.
Based on the above information, start modifying the Linux 3 configuration and recommend a pre-change backup. The modified file is probably as follows (hidden hwaddr, UUID)
cat /etc/sysconfig/networknetworking=yeshostname=Localhost.localdomaingateway =192.168. 1.1
[Email protected] ~]$Cat/etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE="eth0"# Bootproto="DHCP"Bootprote="Static"ipaddr=192.168.1.9NETMASK=255.255.255.0HWADDR="YOUR MAC ADDRESS"Ipv6init="No"nm_controlled="Yes"Onboot="Yes"TYPE="Ethernet"UUID="YOUR UUID"DNS1=192.168.1.1
cat /etc/ in/etc/sysconfig/network-scripts like so:## DNS1=xxx.xxx.xxx.xxx# DNS2=xxx.xxx.xxx.xxx# DOMAIN=192.168. 1.1
Finally, restart the network
Service Network restart
> Testing
Visit under Baidu to see
[Email protected] ~]$ Curl www.baidu.com
If it goes well, the static IP configuration and the Internet are completed.
"Linux" CentOS set static IP (non-dynamic acquisition IP)