ubuntu14.04 static IP address and dynamic IP address configuration

Source: Internet
Author: User

Sometimes we want the IP address of the Ubuntu14.04 to be static IP address, so that the IP address in Ubuntu is not changed, this will be convenient in the embedded device and host Ubuntu to use the network port for debugging.

Static IP address configuration method: In the/etc/network/interfaces file, modify the contents of the

# interfaces (5) file used by Ifup (8) and Ifdown (8)

Auto Lo

Iface Lo inet Loopback


Auto Eth0

Iface eth0 inet Static

#iface eth0 inet DHCP

Address 192.168.1.189

Netmask 255.255.255.0

Gateway 192.168.1.0


Where auto eth0 means that the Eth0 network port is used

Iface eth0 inet Static indicates that the IP address of the eth0 is a static IP address, so that the IP address will not change after each boot. IP Address We can manually configure one.


Dynamic IP address configuration method: In the/etc/network/interfaces file, modify the contents of the

# interfaces (5) file used by Ifup (8) and Ifdown (8)

Auto Lo

Iface Lo inet Loopback


Auto Eth0

#iface eth0 inet Static

Iface eth0 inet DHCP

Address 192.168.1.189

Netmask 255.255.255.0

Gateway 192.168.1.0


Where auto eth0 means that the Eth0 network port is used

Iface eth0 inet DHCP indicates that the IP address of the eth0 is dynamically assigned by the DHCP server, and one of the conditions in which Ubuntu is generally connected is to configure how the item is dynamically assigned IP addresses by the DHCP server. After the connection is successful, DHCP assigns an IP address to Ubuntu that can be connected to the Internet. The following IP address can be arbitrarily set, because it is dynamic allocation, then the following address is not the main.


This article is from the "Whylinux" blog, make sure to keep this source http://whylinux.blog.51cto.com/10900429/1900593

ubuntu14.04 static IP address and dynamic IP address configuration

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.