Environment: CentOS 6.5
Ifconfig–a Viewing network card information
Dhclient allow the host to obtain IP automatically (in DHCP mode)
View Network card profile Vi/etc/sysconfig/network-scripts/ifcfg-eth0 ( cannot remember TAB completion )
VI Command Open
Onboot=no network card does not randomly start, change to Yes.
what mode to get IP BOOTPROTO=DHCP
or static
Bootproto=static
ipaddr=172.30.16.100 IP Address
netmask=255.255.255.0 Subnet Mask
gateway=172.30.16.1 Gateway
dns1=172.30.16.1 is usually the gateway address
dns2=8.8.8.8 Google address
Press the i key to enter edit mode, press ESC to exit edit mode, enter :wq Save Exit
Press The ESC key jumps to command mode and then:
: w Save file But do not exit VI
: W file saves the modification to file and does not exit VI
: w! forced to save, do not launch VI
: Wq Save file and exit VI
: wq! force the file to be saved and exit VI
: Q Do not save file, exit VI
: q! do not save file, force exit VI
: e! Discard all changes and edit from the last time the file was saved
Restart Service Network Restart after you change
Ifdown eth0 stop Nic
Ifup eth0 Open Nic
can you access the extranet,ping www.baidu.com Ctrl + C to end the ping
How to configure an IP address for the "Condensed Essence" Linux system