Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

A case of ubuntu14.04 setting up static IP

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail the case of setting static IP in ubuntu14.04. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

This article describes in detail how to use ubuntu14.04 to set static IP, you can quickly set static ip, do not need to modify some SSH links every time. So I will record the method of setting static IP under the ubuntu14.04 system.

Step one:

Configure a static IP address:

Open the / etc/network/interfaces file with the following contents

Auto loiface lo inet loopbackauto eth0iface eth0 inet dhcp

The above indicates that DHCP is used by default to assign IP. If you want to specify static IP, you need to modify it as follows

Auto loiface lo inet loopbackauto eth0iface eth0 inet static * is defined as the static IPaddress 192.168.2.29 * the IP address netmask 255.255.255.0 * subnet mask gateway 192.168.2.1 * gateway (routing address)

Then save this file

Step 2:

Set up the DNS server manually

Open the file / etc/resolv.conf, and the settings are as follows

Nameserver 192.168.2.1 * Gateway (ibid.) nameserver 202.106.0.20 * DNS server address (I found it with reference to other computers linking to this network)

Step 3:

Note: after restarting Ubuntu, I found that I could not surf the Internet, and the problem occurred in / etc/resolv.conf. After restarting, the dns configured by this file is automatically changed to the default value. So you need to permanently modify the DNS. The method is

Open the file / etc/resolvconf/resolv.conf.d/base and write the following:

Nameserver 192.168.2.1nameserver 202.106.0.20

Step 4:

Restart the networking service to make it effective, the command is:

This is the end of etc/init.d/networking restart's article on "the case of ubuntu14.04 setting static IP". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report