How to Set and activate an IP address

Source: Internet
Author: User


How to Set and activate an IP address in Linux? We can use the command to set the IP address, but the premise of this method is
The condition is that the user requires the root permission. In linux/etc/sysconfig/network-script/ifcfg-eth0
The file contains information about Nic IP Address Configuration. The specific format is: [root @ localhostnetwork-scripts] # catifcfg-eth0 DEVICE = eth0 www.2cto.com BOOTPROTO = none ONBOOT = yes TYPE = Ethernet NETMASK = 255.255.255.0 IPADDR = IP address USERCTL = no PEERDNS = yes GATEWAY = GATEWAY address (Router IP address) the following is an example of how to set IP addresses in Linux. # Ifconfigeth0192.168.0.1 or modify the ifcfg-eth0 under/etc/sysconfig/network-scripts/# vi/etc/syssconfig/network-scripts/ifcfg-eth0 DEVICE = eth0 BOOTPROTO = static HWADDR =; here is the physical address of your network card. You do not need to enter the network card that is usually detected.
ONBOOT = yes IPADDR = 192.168.0.1 NETMASK = 255.255.255.0 NETWORK = 192.168.1.0 BROADCAST = 192.168.1.255 GATEWAY =; enter your GATEWAY here, save the IP address of the router and exit www.2cto.com #/sbin/servicenetworkrestart. If the Enable Nic is OK, the IP address is successfully set. In addition, we can use ifconfigeth0 to display the current IP address to confirm whether it is set correctly.
Run the following command:/etc/init. d/networkreload or servicenetwork [command] to re-import the file to start the 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.