forked from docs/doc-exports
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com> Co-authored-by: wanghuijuan738 <wanghuijuan738@huawei.com> Co-committed-by: wanghuijuan738 <wanghuijuan738@huawei.com>
151 lines
29 KiB
HTML
151 lines
29 KiB
HTML
<a name="EN-US_TOPIC_0093492520"></a><a name="EN-US_TOPIC_0093492520"></a>
|
|
|
|
<h1 class="topictitle1">Managing Virtual IP Addresses</h1>
|
|
<div id="body1516164960187"><div class="section" id="EN-US_TOPIC_0093492520__section1659712372321"><h4 class="sectiontitle">Background</h4><div class="p" id="EN-US_TOPIC_0093492520__p17410204183216">Generally, cloud servers use private IP addresses for internal communications. Virtual IP addresses provide similar access and support communications within a VPC at Layer 2 and Layer 3, between VPCs with VPC peering connections, between cloud and on-premises networks with VPN or Direct Connect, and Internet access with EIPs. <a href="#EN-US_TOPIC_0093492520__en-us_topic_0118498951_fig945012352420">Figure 1</a> describes how private IP addresses, the virtual IP address, and EIPs work together.<ul id="EN-US_TOPIC_0093492520__en-us_topic_0118498951_ul1333974312480"><li id="EN-US_TOPIC_0093492520__en-us_topic_0118498951_li18339104354818">Private IP addresses are used for internal network communication.</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118498951_li158687016498">The virtual IP address works with Keepalived to build an HA cluster. ECSs in this cluster can be accessed through one virtual IP address.</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118498951_li14695924134912">EIPs are used for Internet communication.</li></ul>
|
|
<div class="fignone" id="EN-US_TOPIC_0093492520__en-us_topic_0118498951_fig945012352420"><a name="EN-US_TOPIC_0093492520__en-us_topic_0118498951_fig945012352420"></a><a name="en-us_topic_0118498951_fig945012352420"></a><span class="figcap"><b>Figure 1 </b>Different types of IP addresses used by ECSs</span><br><span><img class="imgResize" id="EN-US_TOPIC_0093492520__en-us_topic_0118498951_image383414544377" src="en-us_image_0000001952856164.png" title="Click to enlarge"></span></div>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0093492520__p5484815416">For details about virtual IP addresses, see "Virtual IP Address Overview" in the <em id="EN-US_TOPIC_0093492520__i13166114182514">Virtual Private Cloud User Guide</em>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0093492520__section158621444144511"><h4 class="sectiontitle">Constraints</h4><p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p176738491037">It is recommended that a maximum of eight virtual IP addresses be bound to an ECS. If an ECS has multiple virtual IP addresses, each virtual IP address is used by a specific service. If there are too many services, the ECS may become overloaded and compromise user experience.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0093492520__section134093255615"><h4 class="sectiontitle">Configuring a Virtual IP Address for an ECS</h4><p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p5806130191614">After you bind one or more virtual IP addresses to an ECS on the console, you must log in to the ECS to manually configure these virtual IP addresses.</p>
|
|
<div class="p" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p9758192131619">The following OSs are used as examples here. For other OSs, see the help documentation on their official websites.<ul id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_ul151051944111613"><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li13105644131617">Linux: CentOS 8.2 64bit and Ubuntu 22.04 server 64bit</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li15251304178">Windows: Windows Server</li></ul>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0093492520__section163078152328"><h4 class="sectiontitle">CentOS</h4><div class="p" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p13342151612916">The following uses CentOS 8.2 64bit as an example.<ol id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_ol202835571499"><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li528316578916"><a name="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li528316578916"></a><a name="en-us_topic_0118499077_li528316578916"></a>Obtain and take a note of the network interface that the virtual IP address is to be bound and the connection of the network interface:<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p1328312577914"><a name="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li528316578916"></a><a name="en-us_topic_0118499077_li528316578916"></a><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b26981410131211">nmcli connection</strong></p>
|
|
<div class="p" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p186211116101">Information similar to the following is displayed:<pre class="screen" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_screen104274141068">[root@ecs-centos ~]# nmcli connection
|
|
NAME UUID TYPE DEVICE
|
|
System eth0 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 ethernet eth0
|
|
System eth1 9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04 ethernet --
|
|
System eth2 3a73717e-65ab-93e8-b518-24f5af32dc0d ethernet --
|
|
System eth3 c5ca8081-6db2-4602-4b46-d771f4330a6d ethernet --
|
|
System eth4 84d43311-57c8-8986-f205-9c78cd6ef5d2 ethernet -- </pre>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p11414166161216">The command output in this example is described as follows:</p>
|
|
<ul id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_ul19933103816107"><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li6933113811010"><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b95791048193414">eth0</strong> in the <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b1988155093415">DEVICE</strong> column indicates the network interface that the virtual IP address is to be bound.</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li1641540181013"><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b2064068478">System eth0</strong> in the <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b1366091019351">NAME</strong> column indicates the connection of the network interface.</li></ul>
|
|
</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li20283257695"><a name="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li20283257695"></a><a name="en-us_topic_0118499077_li20283257695"></a>Add the virtual IP address for the connection:<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p14283165714920"><a name="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li20283257695"></a><a name="en-us_topic_0118499077_li20283257695"></a><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b62831014273">nmcli connection modify "</strong><em id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_i15281910162716">connection-name-of-the-network-interface</em><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b428181018273">" </strong><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b172831052719">+</strong><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b12821012711">ipv4.addresses</strong> <em id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_i192911013272">virtual-IP-address</em></p>
|
|
<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p95398375268">Configure the parameters as follows:</p>
|
|
<ul id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_ul9905446192614"><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li19051046102614"><em id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_i158193582320">connection-name-of-the-network-interface</em>: The connection name of the network interface obtained in <a href="#EN-US_TOPIC_0093492520__en-us_topic_0118499077_li528316578916">1</a>. In this example, the connection name is <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b6676418477">System eth0</strong>.</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li127558733710"><em id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_i167961342182012">virtual-IP-address</em>: The virtual IP address to be added. If you add multiple virtual IP addresses at a time, separate every two with a comma (,).</li></ul>
|
|
<div class="p" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p15911658142818">Example commands:<ul id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_ul10541171174810"><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li254171114819">Adding a single virtual IP address: <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b823370581">nmcli connection modify "System eth0" +ipv4.addresses 192.168.0.22</strong></li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li19647011194810">Adding multiple virtual IP addresses: <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b41495597514">nmcli connection modify "System eth0" +ipv4.addresses 192.168.0.22,192.168.0.23</strong></li></ul>
|
|
</div>
|
|
</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li11209933188"><a name="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li11209933188"></a><a name="en-us_topic_0118499077_li11209933188"></a>Make the configuration in <a href="#EN-US_TOPIC_0093492520__en-us_topic_0118499077_li20283257695">2</a> take effect:<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p6120163991310"><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b15418376265">nmcli connection up "</strong><em id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_i654143762610">connection-name-of-the-network-interface</em><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b125483722611">"</strong></p>
|
|
<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p1621444015291">In this example, run the following command:</p>
|
|
<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p15451174642918"><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b351616121185">nmcli connection up "System eth0"</strong></p>
|
|
<div class="p" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p154011647201319">Information similar to the following is displayed:<pre class="screen" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_screen1824582111813">[root@ecs-centos ~]# nmcli connection up "System eth0"
|
|
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2)</pre>
|
|
</div>
|
|
</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li280716781816">Check whether the virtual IP address has been bound:<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p0825015198"><a name="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li280716781816"></a><a name="en-us_topic_0118499077_li280716781816"></a><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b1090697121910">ip a</strong></p>
|
|
<div class="p" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p9424181261911">Information similar to the following is displayed. In the command output, virtual IP address 192.168.0.22 is bound to network interface eth0.<pre class="screen" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_screen132593566813">[root@ecs-centos ~]# ip a
|
|
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
|
|
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
|
|
inet 127.0.0.1/8 scope host lo
|
|
valid_lft forever preferred_lft forever
|
|
inet6 ::1/128 scope host
|
|
valid_lft forever preferred_lft forever
|
|
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
|
|
link/ether fa:16:3e:54:ac:fa brd ff:ff:ff:ff:ff:ff
|
|
inet 192.168.0.22/32 scope global noprefixroute eth0
|
|
valid_lft forever preferred_lft forever
|
|
inet 192.168.0.78/24 brd 192.168.0.255 scope global dynamic noprefixroute eth0
|
|
valid_lft 315359994sec preferred_lft 315359994sec
|
|
inet6 fe80::f816:3eff:fe54:acfa/64 scope link
|
|
valid_lft forever preferred_lft forever</pre>
|
|
</div>
|
|
<div class="note" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_note11390193015256"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p10410113131619">After the preceding configurations are complete, the configurations will not be lost after the ECS is restarted.</p>
|
|
<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p17390123002519">To delete an added virtual IP address, perform the following steps:</p>
|
|
<ol type="a" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_ol372684019277"><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li872616404276">Delete the virtual IP address from the connection of the network interface:<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p1488835618251"><a name="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li872616404276"></a><a name="en-us_topic_0118499077_li872616404276"></a><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b16591121664813">nmcli connection modify "</strong><em id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_i2059241624814">connection-name-of-the-network-interface</em><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b1059215161483">" </strong><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b1559251620488">-</strong><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b1592716114818">ipv4.addresses</strong> <em id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_i3592131634812">virtual-IP-address</em></p>
|
|
<div class="p" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p122193197260">To delete multiple virtual IP addresses at a time, separate every two with a comma (,). Example commands are as follows:<ul id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_ul101936525268"><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li71932052142611">Deleting a single virtual IP address: <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b178161595915">nmcli connection modify "System eth0" -ipv4.addresses 192.168.0.22</strong></li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li7193175252612">Deleting multiple virtual IP addresses: <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b81930525262">nmcli connection modify "System eth0" -ipv4.addresses 192.168.0.22,192.168.0.23</strong></li></ul>
|
|
</div>
|
|
</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li97151565287">Make the deletion take effect by referring to <a href="#EN-US_TOPIC_0093492520__en-us_topic_0118499077_li11209933188">3</a>.</li></ol>
|
|
</div></div>
|
|
</li></ol>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0093492520__section94511244164413"><h4 class="sectiontitle">Ubuntu</h4><div class="p" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p1510316597331">The following uses Ubuntu 22.04 server 64bit as an example. If the ECS runs <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b1266511723620">Ubuntu 22</strong> or <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b7365164991019">Ubuntu 20</strong>, perform the following operations:<ol id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_ol0718162344210"><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li1271842364218">Obtain and take a note of the network interface that the virtual IP address is to be bound:<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p371812233425"><a name="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li1271842364218"></a><a name="en-us_topic_0118499077_li1271842364218"></a><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b14517204104620">ifconfig</strong></p>
|
|
<div class="p" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p371822354215">Information similar to the following is displayed. In this example, the network interface with the virtual IP address bound is <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b79153223414">eth0</strong>.<pre class="screen" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_screen823116148462">root@ecs-X-Ubuntu:~# ifconfig
|
|
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
|
|
inet 172.16.0.210 netmask 255.255.255.0 broadcast 172.16.0.255
|
|
inet6 fe80::f816:3eff:fe01:f1c3 prefixlen 64 scopeid 0x20<link>
|
|
ether fa:16:3e:01:f1:c3 txqueuelen 1000 (Ethernet)
|
|
RX packets 43915 bytes 63606486 (63.6 MB)
|
|
RX errors 0 dropped 0 overruns 0 frame 0
|
|
TX packets 3364 bytes 455617 (455.6 KB)
|
|
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
|
...</pre>
|
|
</div>
|
|
</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li18652136114719">Switch to the <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b1455316281445">/etc/netplan</strong> directory:<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p8441374811"><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b23721214194813">cd /etc/netplan</strong></p>
|
|
</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li1244016171484"><a name="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li1244016171484"></a><a name="en-us_topic_0118499077_li1244016171484"></a>Add a virtual IP address to the network interface.<ol type="a" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_ol12419472489"><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li14622845174812">Open the configuration file <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b54451921182315">01-netcfg.yaml</strong>:<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p584431794911"><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b11520228124912">vim 01-netcfg.yaml</strong></p>
|
|
</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li257193319497">Press <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b15931155214235">i</strong> to enter the editing mode.</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li146092512497">In the network interface configuration area, add a virtual IP address.<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p5242192605012"><a name="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li146092512497"></a><a name="en-us_topic_0118499077_li146092512497"></a>In this example, add a virtual IP address for <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b5900163012532">eth0</strong>:</p>
|
|
<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p1928116285513"><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b5834240155119">addresses:</strong></p>
|
|
<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p836823585120"><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b18835340135118">- 172.16.0.26/32</strong></p>
|
|
<div class="p" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p698013895110">The file content is as follows:<pre class="screen" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_screen106764217504">network:
|
|
version: 2
|
|
renderer: NetworkManager
|
|
ethernets:
|
|
eth0:
|
|
dhcp4: true
|
|
addresses:
|
|
- 172.16.0.26/32
|
|
eth1:
|
|
dhcp4: true
|
|
eth2:
|
|
dhcp4: true
|
|
eth3:
|
|
dhcp4: true
|
|
eth4:
|
|
dhcp4: true</pre>
|
|
</div>
|
|
</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li2038381814527">Press <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b8488171618545">Esc</strong>, enter <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b648931616548">:wq!</strong>, save the configuration, and exit.</li></ol>
|
|
</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li1071922334218"><a name="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li1071922334218"></a><a name="en-us_topic_0118499077_li1071922334218"></a>Make the configuration in <a href="#EN-US_TOPIC_0093492520__en-us_topic_0118499077_li1244016171484">3</a> take effect:<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p1571918232425"><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b681791165319">netplan apply</strong></p>
|
|
</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li11719202354219">Check whether the virtual IP address has been bound:<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p27191223104220"><a name="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li11719202354219"></a><a name="en-us_topic_0118499077_li11719202354219"></a><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b9719823104211">ip a</strong></p>
|
|
<div class="p" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p07191023184218">Information similar to the following is displayed. In the command output, virtual IP address 172.16.0.26 is bound to network interface eth0.<pre class="screen" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_screen56621942175314">root@ecs-X-Ubuntu:/etc/netplan# ip a
|
|
...
|
|
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
|
|
link/ether fa:16:3e:01:f1:c3 brd ff:ff:ff:ff:ff:ff
|
|
altname enp0s3
|
|
altname ens3
|
|
<strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b76057475420">inet 172.16.0.26/32 scope global noprefixroute eth0</strong>
|
|
valid_lft forever preferred_lft forever
|
|
inet 172.16.0.210/24 brd 172.16.0.255 scope global dynamic noprefixroute eth0
|
|
valid_lft 107999971sec preferred_lft 107999971sec
|
|
inet6 fe80::f816:3eff:fe01:f1c3/64 scope link
|
|
valid_lft forever preferred_lft forever</pre>
|
|
</div>
|
|
<div class="note" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_note1146715177556"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p84201525181620">After the preceding configurations are complete, the configurations will not be lost after the ECS is restarted.</p>
|
|
<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p1846710173555">To delete an added virtual IP address, perform the following steps:</p>
|
|
<ol type="a" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_ol24671517125512"><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li12467171712551">Open the configuration file <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b8784173314568">01-netcfg.yaml</strong> and delete the virtual IP address of the corresponding network interface by referring to <a href="#EN-US_TOPIC_0093492520__en-us_topic_0118499077_li1244016171484">3</a>.</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li34671717205516">Make the deletion take effect by referring to <a href="#EN-US_TOPIC_0093492520__en-us_topic_0118499077_li1071922334218">4</a>.</li></ol>
|
|
</div></div>
|
|
</li></ol>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0093492520__section1719312132464"><h4 class="sectiontitle">Windows Server</h4><p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p1810617331863">The following operations use Windows Server as an example.</p>
|
|
<ol id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_ol52861227646"><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li12285102720415">In <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b12768637114813">Control Panel</strong>, click <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b1358164294810">Network and Sharing Center</strong>, and click the corresponding local connection.</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li11159627142715">On the displayed page, click <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b1086617306519">Properties</strong>.</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li62856271241">On the <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b84235270616019">Network</strong> tab page, select <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b84235270616329">Internet Protocol Version 4 (TCP/IPv4)</strong>.</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li728511274412">Click <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b842352706112032">Properties</strong>.</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li20286127643">Select <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b145301522163917">Use the following IP address</strong> and set <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b253610221395">IP address</strong> to the private IP address of the ECS, for example, 10.0.0.101.<div class="fignone" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_fig18443195118132"><span class="figcap"><b>Figure 2 </b>Configuring a private IP address</span><br><span><img id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_image205091623559" src="en-us_image_0000001179761510.png"></span></div>
|
|
</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li728610271748">Click <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b18855127202518">Advanced</strong>.</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li1628692711410">On the <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b842352706185533">IP Settings</strong> tab, click <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b842352706185558">Add</strong> in the <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b84235270618564">IP addresses</strong> area.<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p1528620270419">Add the virtual IP address, for example, 10.0.0.154.</p>
|
|
<div class="fignone" id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_fig9510105717158"><span class="figcap"><b>Figure 3 </b>Configuring a virtual IP address</span><br><span><img id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_image10265690716" src="en-us_image_0000001225081545.png"></span></div>
|
|
</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li1754811918105">Click <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b842352706155930">OK</strong>.</li><li id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_li9285127445">In the <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b117114145467">Start</strong> menu, open the Windows command line window and run the following command to check whether the virtual IP address has been configured:<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p7284127744"><strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b42841427145">ipconfig /all</strong></p>
|
|
<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p528511274412">In the command output, <strong id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_b4679104134818">IPv4 Address</strong> is the virtual IP address 10.0.0.154, indicating that the virtual IP address of the ECS's network interface has been correctly configured.</p>
|
|
<p id="EN-US_TOPIC_0093492520__en-us_topic_0118499077_p456813144411"></p>
|
|
</li></ol>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0093492520__section040919146466"><h4 class="sectiontitle">Scenarios</h4><p id="EN-US_TOPIC_0093492520__p13453552673">A virtual IP address provides the second IP address for one or more <span id="EN-US_TOPIC_0093492520__text573185512214">ECS</span> NICs, improving high availability between the <span id="EN-US_TOPIC_0093492520__text189506409188">ECS</span>s.</p>
|
|
<p id="EN-US_TOPIC_0093492520__p5454145216718">One NIC can be bound with up to 10 virtual IP addresses, and one virtual IP address can be bound to up to 10 NICs. Multiple <span id="EN-US_TOPIC_0093492520__text20123154771817">ECS</span>s deployed to work in active/standby mode can be bound with the same virtual IP address for disaster recovery.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0093492520__section194113342460"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0093492520__ol745410521478"><li id="EN-US_TOPIC_0093492520__li1151341720102">Log in to the management console.</li><li id="EN-US_TOPIC_0093492520__li1041312241312">Click <span><img id="EN-US_TOPIC_0093492520__en-us_topic_0000001825604541_image9499446838" src="en-us_image_0000002188678994.png"></span> in the upper left corner and select a region and project.</li><li id="EN-US_TOPIC_0093492520__li841462415312">Under <strong id="EN-US_TOPIC_0093492520__b82911306171"><span id="EN-US_TOPIC_0093492520__text229173091710">Computing</span></strong>, click <strong id="EN-US_TOPIC_0093492520__b193093041716">Elastic Cloud Server</strong>.</li><li id="EN-US_TOPIC_0093492520__li174550521710">On the <strong id="EN-US_TOPIC_0093492520__b13711135712182">Elastic Cloud Server</strong> page, click the name of the target <span id="EN-US_TOPIC_0093492520__text1711145712185">ECS</span>.<p id="EN-US_TOPIC_0093492520__p945519526717">The <span id="EN-US_TOPIC_0093492520__text16115153221015">ECS</span> details page is displayed.</p>
|
|
</li><li id="EN-US_TOPIC_0093492520__li10456652775">Click the <strong id="EN-US_TOPIC_0093492520__b3543121217263">Network Interfaces</strong> tab. Then, click <strong id="EN-US_TOPIC_0093492520__b1054321218261">Manage Virtual IP Address</strong>.<p id="EN-US_TOPIC_0093492520__p1945655213716">The <strong id="EN-US_TOPIC_0093492520__b84235270620317">Virtual Private Cloud</strong> page is displayed.</p>
|
|
</li><li id="EN-US_TOPIC_0093492520__li164562525719">On the <strong id="EN-US_TOPIC_0093492520__en-us_topic_0013859511_b84235270620338">IP Addresses</strong> tab, select a desired one or click <strong id="EN-US_TOPIC_0093492520__en-us_topic_0013859511_b84235270620420">Assign Virtual IP Address</strong> for a new one.</li><li id="EN-US_TOPIC_0093492520__li15456195216716">Click <strong id="EN-US_TOPIC_0093492520__b842352706202231">Bind to Server</strong> in the <strong id="EN-US_TOPIC_0093492520__b842352706202236">Operation</strong> column and select the target <span id="EN-US_TOPIC_0093492520__text1115255916227">ECS</span> name and the NIC to bind the virtual IP address to the <span id="EN-US_TOPIC_0093492520__text15988211256">ECS</span> NIC.<p id="EN-US_TOPIC_0093492520__p24560522078">For more information about virtual IP addresses, see <em id="EN-US_TOPIC_0093492520__i84235269714525">Virtual Private Cloud User Guide</em>.</p>
|
|
</li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0092497777.html">Elastic Network Interfaces</a></div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script language="JavaScript">
|
|
<!--
|
|
image_size('.imgResize');
|
|
var msg_imageMax = "view original image";
|
|
var msg_imageClose = "close";
|
|
//--></script> |