How to Configure Static and Dynamic Network Settings on CentOS 6.7 in vSphere
This guide walks you through setting up both static and dynamic network configurations on a CentOS 6.7 virtual machine running in vSphere, covering file edits, firewall handling, service restarts, and verification steps with screenshots.
Earlier we shared how to install CentOS 6.7 on a VM via vSphere Client. The VM is now ready; this article explains how to configure its network.
Static Network Configuration
1. Power on the VM and log in with your credentials.
2. Edit the file /etc/sysconfig/network-scripts/ifcfg-eth0 using vi or vim. The file initially contains only device information.
3. Change ONBOOT to yes and BOOTPROTO to static, then add the desired IP address, gateway, netmask, DNS1 and DNS2.
4. Save the file by pressing Esc and typing :wq!.
5. Verify the changes with cat /etc/sysconfig/network-scripts/ifcfg-eth0.
6. Disable the firewall: service ip6tables stop.
7. Restart the network service: service network restart. A green “ok” indicates success; a red “Failed” suggests configuration errors such as an unavailable IP or missing ONBOOT/BOOTPROTO settings.
8. Check the assigned IP with ifconfig and test connectivity by pinging www.baidu.com. Use Ctrl+C to stop the ping.
Dynamic Network Configuration
1. Open /etc/sysconfig/network-scripts/ifcfg-eth0 in an editor.
2. Set ONBOOT = yes and leave other parameters at their defaults; the system will obtain IP, gateway, etc., via DHCP.
3. Restart the network service: service network restart.
4. Verify the IP address with ifconfig.
Note: DHCP assigns a dynamic IP, which is inconvenient for building a Hadoop cluster, so static IP configuration is preferred.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Python Crawling & Data Mining
Life's short, I code in Python. This channel shares Python web crawling, data mining, analysis, processing, visualization, automated testing, DevOps, big data, AI, cloud computing, machine learning tools, resources, news, technical articles, tutorial videos and learning materials. Join us!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
