Modify network configuration parameters in CentOS

Source: Internet
Author: User
Modify the network configuration parameters in CentOS. 1. modify the hostname configuration file:/etc/sysconfig/networkHOSTNAMEtank # Modify the host name NETWORKINGyeswww.2cto. com2, modify ip/netmask/gateway Configuration File:/etc/sysco... modify network configuration parameters in CentOS 1. modify the hostname configuration file: /etc/sysconfig/network HOSTNAME = tank # Modify the host name NETWORKING = yes www.2cto.com 2. modify the ip/netmask/gateway configuration file: /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE = eth0 # describe the DEVICE alias for the NIC, for example, in the ifcfg-eth0 file it is eth0 BOOTPROTO = static # set the way the Nic gets the IP address, the possible options are static, dhcp, or bootp, which correspond to the IP addresses specified by the static state and obtained through the dhcp protocol, IP address BROADCAST = 192.168.0.255 # corresponding subnet BROADCAST address HWADDR = 00: 07: E9: 05: E8: b4 # The physical IP address of the corresponding Nic, IPADDR = 12.168.1.2 # if the IP address obtained by The NIC is set to static, this field specifies the IP address of the NETWORK adapter IPV6INIT = no IPV6_AUTOCONF = no NETMASK = 255.255.255.0 # NETWORK mask of the NETWORK adapter NETWORK = 192.168.1.0 # NETWORK address of the NETWORK adapter ONBOOT = yes # When the system starts whether to set this network interface, when set to yes, the system activates the device www.2cto.com at startup 3. modifies the dns configuration file:/etc/resolv. conf nameserver 8.8.8.8 # google domain name server nameserver 8.8.4.4 # google domain name server restart network configuration: # service network restart or #/etc/init. d/network restart modify IP address effective immediately: # ifconfig eth0 192.168.0.2 netmask 255.255.255.0 start effective: modify/etc/sysconfig/network-scripts/ifcfg-eth0 modify Gateway Default Gateway effective immediately: # route add default gw 192.168.0.1 dev eth0 start effective: modify/etc/sysconfig/network modify DNS modify/etc/resolv. after the conf file is modified, it takes effect immediately. the host name modification also takes effect immediately after it is started. after it is restarted, it becomes invalid: # hostname centos1 start (restart the computer) takes effect: modify/etc/sysconfig/network

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.