In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article shows you how to configure static IP for instance. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
It is very common to configure static IP for servers in traditional operation and maintenance. However, in an OpenStack environment, you can only specify that the network,IP is automatically allocated by Neutron from the subnet IP pool.
Some students will think of a way: can we change the IP manually after instance gets up?
It's a pity, no!
The IP and Mac addresses of the instance network card are recorded in the port, and the iptable of the computing node will generate the corresponding rule according to the port information. Only the IP and Mac that match the port can allow communication in the Neutron network.
Is there any way to configure static IP for instance?
Yes!
The method is:
First create a port and set the IP address.
Transfer the port attach to instance.
Manually configure static IP in instance.
Prior to the Newton version, you could only use the command line to do the above. But horizon has supported it since Newton. Let's first look at how the command line is implemented.
Command line operation
Instance "C1" currently does not have any network cards.
Step 1: use the neutron port-create command to create port and set up IP.
The most important thing is the parameter fixed-ip, which specifies the subnet to which IP and IP belong.
You can also specify an Mac address (optional), which is useful in some scenarios. Previously, there was a project customer whose commercial software was bound to a specific Mac address, so the instance Nic must be assigned a Mac.
The Network parameter specifies the network to which port belongs.
The following command creates a vlan111 with a port,IP of 17.17.111.33.
Neutron port-create-- fixed-ip subnet_id=e0e251a0-0e38-4b70-9904-6b791fcf8d33 lap address 17.17.111.33 vlan111
Step 2: execute the nova interface-attach command to port attach to instance.
The operating system has been able to recognize the network card eth0, but the IP still needs to be set manually.
Step 3: configure static IP in instance.
Edit / etc/network/interfaces.
Restart eth0.
IP takes effect.
And can Ping to other IP of the same network segment.
If the IP we configure here is not 17.17.111.33 defined in port, can we still Ping? This question is left to everyone to verify for themselves.
Horizon operation
Horizon supports setting the IP address when creating a port in the Newton version, which means that step 1 can be done directly in Web GUI.
Menu "Admin-> System-> Networks".
Click the web "vlan111", and then click the "Ports" tab.
Click the Create Port button.
Set IP 17.17.111.55, and then click the "Create Port" button.
The port was created successfully, and there is currently no attach to instance, so the status is "Down".
Horizon currently does not support direct port attach to instance, which has to be done through the command line, as shown in the previous example. I hope this feature will be added to the new version of horizon.
The above is how to configure static IP for instance. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, 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.
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.