Ubuntu Set Fixed IP

Source: Internet
Author: User
Tags nameserver

Set 192.168.1.244 to fixed IP

1. Locate the file and make the following changes:

Vim/etc/network/interfaces

The result of the modification is the following section:

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see Interfaces (5).

# The Loopback network interface

Auto Lo

Iface Lo inet Loopback

# The Primary network interface

Auto P2P1

Iface p2p1 inet Static

Address 192.168.1.244

Gateway 192.168.1.1

Netmask 255.255.255.0

Note: P2P1 for 192.168.1.244 network card name, different server network card name is different, please modify it yourself

2. Modify DNS resolution

DNS server addresses are automatically assigned because they were previously resolved by DHCP

And once the static IP is set, there is no automatic access to the DNS server.

To set a

Vim/etc/resolv.conf

NameServer 202.96.128.86

NameServer 192.168.1.1

NameServer 220.170.64.68

3. Change the above, if the restart, it will still become the original appearance, so let it change permanently, therefore, the execution:

Vim/etc/resolvconf/resolv.conf.d/base

NameServer 192.168.1.1

NameServer 220.170.64.68

3. Restart the network card:

/etc/init.d/networking restart


Ubuntu Set Fixed IP

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.