Common centos network configurations

Source: Internet
Author: User

Define IP Address:
1. Root # Vim/etc/sysconfig/network-scripts/ifcfg-eth0 # edit the NIC configuration file
Device = eth0 # Nic device name
Onboot = yes # Does the NIC need to be automatically started?
Ipaddr = 192.168.1.1 # IP Address
Netmask = 255.255.255.0 # mask
Gateway = 192.168.1.254 # Gateway
Dns1 = 202.96.134.133 # primary DNS
Dns2 = 8.8.8.8 # secondary DNS
2. Root # service network restart # restart the NIC
Define secondary IP Address:
1.1.root # Vim/etc/sysconfig/network-scripts/ifcfg-eth0: 0 # edit the secondary configuration file for the NIC
2. device = eth0: 0 # Name of the secondary ENI Device
3. onboot = yes # Does the NIC need to be automatically started?
4. ipaddr = 192.168.2.1 # IP Address
Netmask = 255.255.255.0 # mask
If many secondary IP addresses are required, you can add eth0: 1; eth2... when editing the NIC.



This article is from the "centos" blog, please be sure to keep this http://longcentod.blog.51cto.com/9060910/1436620 source

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.