CentOS Set Static IP

Source: Internet
Author: User

1. Edit the NIC file

vi /etc/sysconfig/network-scripts/ifcfg-eth0  # eth0 for network card number

To set the IPV4 information for the NIC Eth0, it is important to note that the ipaddr set up needs to be in the same network segment as the other machines in the LAN. The following settings are required:

device=Eth0bootprot=staticipaddr=192.168. 1.27 GATEWAY=192.168. 1.1 NETMASK=255.255. 255.0 onboot=yes

Example description of NIC file contents:

Device=eth0//indicate the device nameBootprot=static//Startup Type Dhcp|staticbroadcast=192.168.1.203     //Broadcast AddressHwaddr=xx: .: 5b:fe:df:7c//Hardware MAC AddressIpaddr=192.168.0.2          //IP Addressnetmask=255.255.255.0       //Subnet Masknetwork=192.168.0.0         //Network Addressgateway=192.168.0.1         //Gateway addressOnboot=yes//whether to launch the appType=ethernet//Network Type

2. Restart the network card

Service Network restart

When you restart the network card, the shell may have information about reconfiguring the IP that appears in the shell.

3. Test whether the configuration is successful by pinging the IP of other hosts in the LAN

Ping 192.168. 1.10

Note: If you are configuring in VirtualBox, you need to change the connection mode in the Network tab to bridging.

CentOS Set Static IP

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.