Optimize VCS network management by changing the virtual network interface.

Classification: BLOG, Compute
Label: IP, Network, VCS

By reconfiguring private IP addresses, you can clearly distinguish the roles of your VCS cluster (such as apps and databases), improving management efficiency.

Even if your VCS cluster has already been deployed, you can follow these steps to change the private IP while retaining the external connection function of the original static IP, optimizing the network structure and making management more intuitive and clear.

Detailed Steps

 

Step 1. Create and add a separate virtual network interface.

 

  • For instructions on how to create and add network interfaces and assign private IP addresses, please refer to:https://docs.twcc.ai/docs/concepts-tutorials/twcc/vcs/tutorials/add-vni-to-instance

  • Taking this VCS as an example, there are currently two virtual network interfaces. Currently, the dependent interface created with the VCS is being used. The goal is to switch to using public and private IPs from independent interfaces.

    1. Interdependent Interface (Private IP: 192.168.211.61)
    2. Independent interface (private IP: 192.168.211.95)

image

Step 2. Create an image file to save the original settings.

 

To avoid VCS connection failures due to incorrect settings adjustments during subsequent OS setup, it is recommended that you first create a VCS image file to save the original settings. This will allow you to restore the VCS if an error occurs.

Create a VCS image file:https://docs.twcc.ai/docs/user-guides/twcc/vcs/instances/create-images

Step 3. Adjust the interface order or disable the original interface within the OS.

 

Connect to VCS to adjust the interface order or disable the original interface:

Linux (using Ubuntu as an example)

 

  1. use ip a Confirm the codenames (ensx) for the two virtual network interfaces.
  • ens3: 192.168.211.61 (dependent interface) 100
  • ens6: 192.168.211.95 (Standard Interface) 106

image

The smaller the metric value of an interface, the higher it is used in the sorting. Therefore, after confirming the metric value, the next step is to adjust the sorting of individual interfaces to be moved forward.

   2. Adjust network interface metric values

sudo vim /etc/netplan/01-netcfg.yaml
  • Lower the metric for the independent interface (from 106 to 99), then press [button/button]. wq! Save and leave

image

   3. sudo netplan try

To confirm successful configuration, your connection using the public IP address of the dependent interface will be interrupted.

image

   4. Connect to the VCS using the external IP address of the independent interface. A successful connection indicates that the network card has been successfully replaced with an independent network card.

Linux (using Rocky Linux as an example)

 

  1. use ip a Obtain and copy the independent interface (ens4) with the following information:
    • MAC address:fa:16:xx:xx:xx:a0

image

  1. Create an independent interface (ens4) profile and adjust its contents.
  • cd /etc/sysconfig/network-scripts/
  • sudo cp ifcfg-ens3 ifcfg-ens4
  • sudo vi ifcfg-ens4
  • Adjust the following content:
    • DEVICE=ens3 Change to ens4
    • HWADDR= will be the original ens3 of fa:16:xx:xx:xx:6c MAC address changed to ens4 of fa:16:xx:xx:xx:a0

image

  1. Adjust the contents of the dependent interface (ens3) configuration file.
  • sudo vi ifcfg-ens3
  • BOOTPROTO=dhcp Change to static

image

  1. sudo reboot Perform a reboot to complete the settings.

  2. After booting up, connect to the VCS using the external IP address of the independent interface. If the connection is successful, it indicates that the network card has been successfully replaced with an independent one, and the original interface with the external IP address can no longer connect to the VCS.

Windows (using Windows Server as an example)

 

Windows network adapters all have a default metric of 15, so they can be used simultaneously.

image

If you wish to disable the original interface, please refer to the following procedure:

  • Open CMD and type: ipconfig Confirm the mapping between the interface name within the OS and the private IP address.

image

image

  • enter netsh interface set interface "name of the interface to be disabled"" It can be stopped immediately.

image

  • enter netsh interface show interface The interface status has been disabled.

image

Or use the Windows GUI:

  • Search for and enter "View Network Connections" to view the two connected virtual network interfaces.

image

  • Right-click on the interface > select "Status" > select "Details" to confirm the network card's private IP address, which can be compared with the interface on the platform.

image

image

  • To disable an interface, simply right-click it.

image

  • Disable Complete

image

Step 4. Change to a static IP address and confirm the connection.

 

If you wish to continue using the original public IP (static IP), you can remove the IPs from both interfaces and then configure the original IP to connect to the VCS using the original IP.

image

If your original IP was a floating IP, it will be recycled back to the resource pool after removal, and there is no guarantee that you can get the same IP back.

Step 5. Decouple the original virtual network interface.

 

Whether a virtual network interface can be separated from an individual depends on the nature of the interface:

  • If the original interface is a dependent interface:

The interface's lifecycle changes along with the virtual entity, therefore the interface cannot be separated from the entity (buttons are grayed out). The interface will only disappear when the entity is deleted.

image

  • If the original interface is an independent interface:

After confirming the static IP change is complete, you can detach the network interface from its original state and use it on other resources.

image

EDM Subscription

EDM Subscription

On-Demand AI Cloud Consulting

Sales Contact
Sales Contact Form