How to configure an IP address for the "Condensed Essence" Linux system

Source: Internet
Author: User
Tags save file

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

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.