In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to configure fixed IP in Ubuntu 18.04? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
1. Configure the network using ifupdown
If you want to configure the network in the previous way, you need to reinstall ifupdown:
Sudo apt install ifupdown
Modify the configuration file / etc/network/interfaces:
Sudo vim / etc/network/interfaces
The configuration file is modified as follows:
Iface ens160 inet static
Address 210.72.92.25
Gateway 210.72.92.254
Netmask 255.255.255.0
Dns-nameservers 8.8.8.8
Restart the network service to make the configuration effective
Sudo services network restrart
two。 Configure the network using netplan
Ubuntu 18.04 uses netplan to configure the network, and its configuration file is in yaml format. After installing Ubuntu 18.04, the default configuration file name in the / etc/netplan/ directory is 50-cloud-init.yaml, which we modify through VIM:
Sudo vim / etc/netplan/50-cloud-init.yaml
The configuration file is modified as follows:
Network:
Ethernets:
Ens160:
Addresses:
-210.72.92.28 bind 24 # IP and mask
Gateway4: 210.72.92.254 # Gateway
Nameservers:
Addresses:
-8.8.8.8 # DNS
Version: 2
Whether it is ifupdown or netplan, the configuration idea is the same. Enter IP, mask, gateway, DNS and other information in the configuration file according to the rules. Note that yaml is hierarchical and needs to be indented, with colons (:) for dictionaries and hyphens (-) for lists.
Restart the network service to make the configuration effective:
This is the answer to sudo netplan apply's question about how to configure a fixed IP in Ubuntu 18.04. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.