Nic configuration file (1)/etc/sysconfig/network-scripts/ifcfg-interface-name the configuration file ifcfg-interface-name contains most of the details required to initialize the interface. The interface-name varies according to the type and order of the network card. generally, its name is et...
Nic configuration file
(1) The/etc/sysconfig/network-scripts/ifcfg-interface-name configuration file ifcfg-interface-name contains most of the details required for the initialization interface. The interface-name varies according to the type and order of the network card. generally, its names are eth0, eth1, and ppp0. eth indicates the Ethernet (eth0) network card, 0 indicates the first Nic, 1 indicates the second Nic, and ppp0 indicates the first point-to-poirt protocol network interface. The items defined in the ifcfg file depend on the interface type. The following values are more common: "DEVICE = name, where name is the name of a physical DEVICE. IPADDR = addr, where addr is an IP address. NETMASK = mask, where mask is the network mask value. "NETWORK = addr, where addr is the NETWORK address. "BROADCAST = addr, where addr is the BROADCAST address. "GATEWAY = addr, where addr is the GATEWAY address. "ONBOOT = answer, where answer is yes (the device is activated during boot) or no (the device is not activated during boot)" USERCTL = answer, where, answer is yes (a non-root user can control the device) or no, BOOTPROTO = proto, where, proto takes one of the following values: none, no protocol used for guidance; static allocation address; bootp, using the BOOTP protocol, or dhcp, using the DHCP protocol.
(2) according to the meaning of the above parameters, the setting file for the linpcl.lintec.edu.cn machine is as follows: [root @ linpcl root] # cat/etc/sysconfig/networking/devices/ifcfg-rth0 DEVICE = eth0 www.2cto.com ONBOOT = yes BOOTPROTO = static IPADDR = 192.168.0.2 NETMASK = 255.255.255.0 GATEWAY = 192.168.0.1
(3) save the file after the parameter configuration is complete, and restart the network device using the/etc/init. d/network restart command. the latest value will take effect. [Root @ linpcl root] #/etc/rc. d/init. d/network restart: closing the interface eth0: [OK] closing the loopback interface: [OK] setting network parameters: [OK] the loopback interface is displayed: [OK] the pop-up interface eth0: [OK]
(4) run the ifconfig command to view the network device status. [Root @ linpcl root] # ifconfig eth0 Link encap: Ethernet HWassr 52: 54: AB: 28: EE: 37 linet addr: 192.168.0.2 bcast: 192.168.0.255 Mask: limit 255.0 (some parameter files are automatically displayed, which is omitted here )... Disable Nic: if ifconfig eth0 down is permanently disabled, you need to modify the configuration file.
Author wallimn
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