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

How to set static IP under Ubuntu Linux system

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

Share

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

This article introduces the knowledge of "how to set up static IP under Ubuntu Linux system". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The network parameters of Ubuntu are saved in the file / etc/network/interfaces. The default setting is dhcp, which is as follows:

# The primary network interface

Auto eth0

Iface eth0 inet dhcp

The method to set static ip is as follows:

(1) Edit / etc/network/interfaces

1.1) masking 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 / etc/resolv.conf and 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

This is the end of the content of "how to set up static IP under Ubuntu Linux system". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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