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

What is the Ubuntu Server18.04 static IP configuration like

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

Share

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

In this issue, the editor will bring you about the static IP configuration of Ubuntu Server18.04. The article is rich in content and analyzed and described from a professional point of view. I hope you can get something after reading this article.

How to configure static IP in Ubuntu Server 18.04.

In Ubuntu18.04, the traditional configuration / etc/network/interfaces is useless, and the new network configuration file is at: / etc/netplan/50-cloud-init.yaml

When editing files with vim, note that there is a space after the colon format:

Network: ethernets: ens33: dhcp4: false addresses: [192.168.37.188/24] gateway4: 192.168.37.2 nameservers: addresses: [114.114.114.114,8.8.8.8] version: 2

Ens33: the name of your current network card

The dhcp switch of the dhcp4:ipv4 API. False is disabled and true is enabled.

Addresses: static IP address / mask

Gateway4:ipv4 Gateway

Nameservers:DNS server comma division

After editing and finally saving the configuration file, execute the command to restart the network service to take effect:

Sudo netplan apply

If the ping public network domain name is reported as unresolvable by Temporary failure in name resolution, ping will not work after testing, but there is no problem with the setting of DNS or something.

Solution: edit the / etc/resolv.conf file and add a dns parsing reboot restart.

This is how the Ubuntu Server18.04 static IP configuration shared by the editor is like. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

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