Ubuntu Specifies static IP

Source: Internet
Author: User

By default, Ubuntu uses DHCP to obtain IP, but it is easier for users to configure the network, but it is not good for multi-user LANs, because DHCP occasionally replaces IP, which means that the user who wants to connect must change the IP configuration.

The method for specifying static IP is as follows:

1. Edit/etc/network/interfaces, as follows

auto eth0
iface eth0 inet static
address  192.168.1.100    #静态ip
gateway  192.168.1.1      #网关
netmask  255.255.255.0    #子网掩码

2. Edit/etc/resolv.conf, specify DNS

NameServer 192.168.1.1

3. Restart Network Services

/etc/init.d/networking restart

OK,IP already specified!

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.