Linux configuration experience: (2) static IP Address Settings

Source: Internet
Author: User

Setting IP addresses in Linux is simple. Generally, you can use the ip command tool or directly modify the configuration file.

This section describes how to configure a configuration file.

 

Redhat series (CentOS & Redhat ):

You must modify three files and then restart the network.

The first file: IP configuration file.

Path:/etc/sysconfig/network-scripts/

Usually for ifcfg-eth0. I am here for ifcfg-seth0

Configuration content:

DEVICE = seth0

BOOTPROTO = static

ONBOOT = yes

IPADDR = 10.2.0.191

NETMASK = 255.255.255.0

GATEWAY = 10.2.0.1

 

The second file:

DNS configuration file, DNS name server, mainly used to convert www.cnblogs.com into DNS

Configuration content:

Nameserver: 10.2.0.1

 

Third file:

Configure Network Management

Configuration content

GATEWAY: 10.2.0.1

 

 

Debain series (Debian & UBUNTU ):

The first file configuration file/etc/Network/interfaces.

Iface seth0 inet static
Address 10.2.0.191 netmask 255.255.255.0

Gateway 172.18.1.1

 

For more information, see:

Http://hi.baidu.com/5%B4%F3%B7%F2/blog/item/9cd146587eec5b2d2934f0a1.html

Http://www.iceteks.com/forums/archive/t/3298/

Http://virus.blog.51cto.com/51437/22220/

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.