How to configure static IP addresses in Debian Linux

Source: Internet
Author: User
Today, I found that a disk on the server is full, so I went online to find a solution. I moved some space on other disks. as a result, a partition was accidentally deleted during fdisk, leading to data loss, fortunately, there is nothing important... So I had to re-install the system. I was still trying to recover it. I found that it was not only necessary to add a few points, so I had to first put the new

Today, I found that a disk on the server is full, so I went online to find a solution. I moved some space on other disks. as a result, a partition was accidentally deleted during fdisk, leading to data loss, fortunately, there is nothing important... So I had to re-install the system. I was still trying to recover it. I found that it was not just a bit of something to add, so I had to first install the new system, I will have the opportunity to study it again later ~

By default, debian uses the dhpc service. if it is used as a server, you must manually configure a static IP address.

Static IP settings:

Bjcl :~ # Vi/etc/network/interfaces
# This file describes the network interfaces available on yoursystem
# And how to activate them. For more information, seeinterfaces (5 ).

# The loopback network interface
# Auto lo
# Iface lo inet loopback

# The primary network interface
Auto eth0
# Allow-hotplug eth0
Iface eth0 inet static
Address 192.168.1.10
Netmask 255.255.255.0
Gateway 192.168.1.1
Bjcl :~ #/Etc/init. d/networking restart
Reconfiguring network interfaces... done.

DNS server settings:

Bjcl :~ # Vi/etc/resolv. conf
Nameserver 192.168.1.10
Nameserver 202.106.46.151

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.