Ubuntu Server Configuration network and view IP address

Source: Internet
Author: User
Tags nameserver

Article Source Address: http://my.oschina.net/junn/blog/142983

The network parameters of Ubuntu server are saved in the file/etc/network/interfaces, and the default setting uses DHCP, as follows:
# The Primary network interface
Auto Eth0
Iface eth0 inet DHCP
Here's how to set up a static IP:
1) Edit Vi/etc/network/interfaces
1.1) block the DHCP line
# The Primary network interface
Auto Eth0
#iface eth0 inet DHCP
1.2) Add parameters related to static IP
# The Primary network interface
Iface eth0 inet Static
Address 192.168.0.10
Netmask 255.255.255.0
Gateway 192.168.0.1
2) Edit vi/etc/resolv.conf, set DNS
NameServer 202.96.134.133
NameServer 202.106.0.20
3) Execute the following two commands to enable the new settings
$sudo Ifdown eth0
$sudo ifup eth0
Restart the Network Service

sudo/etc/init.d/networking restart

Ubuntu Server Configuration network and view IP address

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.