How to set IP addresses in Debian Linux

Source: Internet
Author: User
1. set the IP address debian :~ # Vi/etc/network/interfaces // obtain dynamic DHCP # start the system to activate the device. # Loop address. autoloifaceloinetloopback # start the system to activate the device. # set eth0 to DHCP. autoeth0ifaceeth0inetdhcp -----------

1. ip address settings

Debian :~ # Vi/etc/network/interfaces

// Obtain dynamic DHCP

# Start the system to activate the device.

# Loop address.

Auto lo

Iface lo inet loopback

# Start the system to activate the device.

# Set eth0 to DHCP.

Auto eth0

Iface eth0 inet dhcp

------------------------------------

// Obtain the Static data

# Start the system to activate the device.

# Loop address.

Auto lo

Iface lo inet loopback

# Start the system to activate the device.

# Set eth0 to Static.

Auto eth0

Iface eth0 inet static

# Specify IP address. subnet mask. Broadcast. Gateway.

Address 192.168.1.10

Netmask 255.255.255.0

Gateway 192.168.1.1

2. DNS address settings

Debian :~ # Vi/etc/resolv. conf

// It must be set. otherwise, no URL can be accessed.

Nameserver x. x

Nameserver x. x

3. restart the network after the configuration is complete.

Debian :~ #/Etc/init. d/networking restart

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.