Linux centos6.x IP settings (network card settings)

Source: Internet
Author: User

Modify IP permanent effect as follows
Vi/etc/sysconfig/network-scripts/ifcfg-eth0 (eth0, first Nic, if the second block is eth1)
Modify the IP as follows:

device=eth0 #如果是第二块刚为eth1BOOTPROTO=static #网卡获得ip地址的方式, static and DHCP two ways ipaddr=192.168. 1.122 #改成要设置的IPNETMASK=255.255. 255.0 #子网掩码GATEWAY=192.168. 1.1 #网关地址HWADDR=:xx: +:8c:ad #网卡物理地址ONBOOT= Yes #系统启动时是否设置此网络接口, when set to Yes, activates the device when the system starts. The default setting is Yes

Then the restart takes effect:

Service Network restart


The IP address is in effect and does not change after rebooting the system

If you are restoring the original IP after temporarily modifying the IP restart system, use the following command
Ifconfig network card device IP address netmask subnet mask

ifconfig 192.168. 1.122 255.255. 255.0

Problems you may encounter:

1.service Network Restart Error
Eth0: Error: Activation Connection failed: Device not managed by NetworkManager

Workaround:

1 . Service Network Restart #查看报错信息 2. ifconfig eth0  #查看eth0配置是否正常 3. Service NetworkManager Stop #停掉NetworkManager服务 4 the. Service Network restart Restart the networking validation is normal #重启网络验证是否正常

2.service Network Restart Error
eth0:determining If IP address 192.168.1.122 is already on use for device eth0 ...

This prompt appears because:Linux network adapter configuration ARP check caused, turn this off

Workaround:

#在网卡配置文件里面添加 vi /etc/sysconfig/network-scripts/ifcfg-eth0arpcheck=no# When set, save the changes. Restart the network Card Services service network restart

Linux centos6.x IP settings (network card settings)

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.