LINUX Nic handwritten configuration file

Source: Internet
Author: User
LINUX Nic handwritten configuration file-Linux Enterprise Application-Linux server application information. The following is a detailed description. /Etc/sysconfig/network-scripts/ifcfg-interface-name

The 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 the 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 (non-root users can control this device) or no

"BOOTPROTO = proto, where, proto takes one of the following values: none, no protocol used for guidance; static allocation address; bootp, use BOOTP protocol, or dhcp, use 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

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 interface eth0: [OK]

Disable the loop interface: [OK]

Set network parameters: [OK]

Pop-up loop interface: [OK]

Pop-up page 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: 255.255.255.0
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.