Network configuration method, host server, device and storage medium
By obtaining virtual network configuration parameters, using Linux Bridge and Open vSwitch technology to automatically configure the virtual network plane, solving the problems of low configuration efficiency and high maintenance difficulty in the existing technology, realizing unified network plane configuration and reducing maintenance difficulty.
Patent Information
- Application Number
- CN202211156099.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-22
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2042-09-22
AI Technical Summary
In the prior art, the virtual network card configuration process is inefficient and the parameters are not persistent, and it is difficult to organically combine Open vSwitch and Linux Bridge technologies, resulting in high maintenance difficulties.
By obtaining the virtual network configuration parameters, using the Bond network port of Linux Bridge to create a virtual network subinterface based on the virtual network tag, and using Open vSwitch to generate a virtual network port, mount the port to the bridge according to the bridge service tag, and finally configure the bridge IP address to generate a virtual network plane.
It realizes the automatic configuration of the virtual network plane, unifies the configuration parameters of the network plane, and reduces the difficulty of system maintenance.
Smart Images

Figure CN115567383B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of virtual network technology, and in particular to a network configuration method, a host server, a device and a storage medium. Background Art
[0002] The cloud platform deployment process of a private cloud includes planning multiple network planes, such as the management network plane, business network plane, storage network plane, Web access network plane, etc. The network plane mainly relies on the host server to provide physical network devices or virtual network devices, and different network planes are isolated from each other. Due to the limitation of the physical network cards of the host server, most host servers cannot provide enough available physical network cards. Therefore, the cloud platform deployment cannot rely entirely on physical network cards, but also needs to rely on some virtual network cards to provide enough network devices.
[0003] The technologies for splitting a physical network card into multiple virtual network cards in the related art are mainly: Linux virtual bridge (Linux Bridge) and virtual switch (Open vSwitch, OVS). There are the following shortcomings in configuring virtual network cards based on these two technologies: 1) The virtual network card configuration process of the existing solution is mainly to manually execute command lines, which has low configuration efficiency and the configuration parameters cannot be persisted. After the host server is restarted, it needs to be reconfigured; 2) In the existing solution, the configuration of the business-related network plane of the private cloud is mainly implemented with the support of Open vSwitch technology, while the network configuration of the host server layer is mainly implemented with the support of Linux Bridge technology. The two technologies cannot be organically combined for unified configuration, resulting in high maintenance difficulty. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a network configuration method, a host server, a device and a storage medium, which can automatically configure a virtual network plane, and combine Open vSwitch technology and Linux Bridge technology to perform network configuration, obtain unified configuration parameters, and reduce the difficulty of maintenance.
[0005] To achieve the above object, a first aspect of an embodiment of the present application proposes a network configuration method, including:
[0006] Acquire virtual network configuration parameters, wherein the virtual network configuration parameters include a virtual network label and a bridge service label;
[0007] Using the Bond network port of Linux Bridge to create one or more virtual network sub-interfaces according to the virtual network label, the Bond network port is generated by at least one physical network device interface according to the first binding relationship;
[0008] Generate a virtual network port corresponding to each virtual network sub-interface using Open vSwitch;
[0009] Mounting each of the virtual network ports to a corresponding bridge according to the bridge service label;
[0010] The network plane IP address of each of the bridges is configured to generate a virtual network plane.
[0011] In some embodiments, the virtual network label includes: a virtual network interface ID and a virtual network interface working mode; the step of creating one or more virtual network sub-interfaces according to the virtual network label by using the Bond network port of the Linux Bridge includes:
[0012] Configuring at least one physical network device interface to obtain the first binding information;
[0013] Configure the virtual network interface working mode of the Bond network port according to the first binding information, the virtual network interface working mode is a switching mode of at least one of the physical network device interfaces, and the virtual network interface working mode includes one of the following: balanced polling strategy, primary backup strategy, balanced strategy, broadcast strategy, dynamic link aggregation, adapter transmission load balancing or adapter adaptive load balancing;
[0014] One or more virtual network sub-interfaces are created based on the virtual network interface ID using the Bond network port.
[0015] In some embodiments, the bridge service tag includes: a bridge service name and bridge network configuration information, the bridge network configuration information includes: a network address, a network mask or a gateway; and mounting each of the virtual network ports to a corresponding bridge according to the bridge service tag includes:
[0016] Configure the network of the bridge according to the bridge network configuration information;
[0017] Each of the virtual network ports is mounted to a corresponding bridge according to the bridge service name.
[0018] In some embodiments, before obtaining the virtual network configuration parameters, the method further includes:
[0019] Send available network card information according to network card query request;
[0020] The virtual network configuration parameter generated based on the available network card information is received.
[0021] In some embodiments, obtaining virtual network configuration parameters includes:
[0022] The virtual network configuration parameters sent by using the Sshpass tool are received.
[0023] In some embodiments, further comprising:
[0024] The configuration parameters in the configuration process are written into the network configuration file of the host server.
[0025] To achieve the above purpose, a second aspect of an embodiment of the present application proposes a network configuration method, which is applied to a network management server, comprising:
[0026] Send a network card query request to the host server;
[0027] Receiving available network card information sent by the host server in response to the network card query request;
[0028] Receive the virtual network configuration parameters corresponding to the available network card information;
[0029] The virtual network configuration parameters are sent to the host server using the Sshpass tool, so that the host server can generate a virtual network plane using the network configuration method as described in any one of the first aspects.
[0030] In some embodiments, the receiving the virtual network configuration parameter corresponding to the available network card information includes:
[0031] Receiving Web request information corresponding to the available network card information;
[0032] The virtual network configuration parameters are generated according to the Web request information, and the virtual network configuration parameters are script form data.
[0033] To achieve the above object, a third aspect of an embodiment of the present application provides a host server, including:
[0034] A configuration parameter acquisition unit, used to acquire virtual network configuration parameters, wherein the virtual network configuration parameters include a virtual network label and a bridge service label;
[0035] A virtual network sub-interface creation unit, configured to create one or more virtual network sub-interfaces according to the virtual network label by using the Bond network port of the Linux Bridge, wherein the Bond network port is generated by at least one master device network interface and at least one slave device network interface according to a first binding relationship;
[0036] A virtual network port generating unit, used to generate a virtual network port corresponding to each virtual network sub-interface by using Open vSwitch;
[0037] A bridge mounting unit, configured to mount each of the virtual network ports to a corresponding bridge according to the bridge service label;
[0038] The virtual network plane generating unit is used to configure the network plane IP address of each of the bridges to generate a virtual network plane.
[0039] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the network configuration method described in any one of the first aspect, or the network configuration method described in any one of the second aspect.
[0040] To achieve the above-mentioned purpose, the fifth aspect of an embodiment of the present application proposes a storage medium, which is a computer-readable storage medium, and the storage medium stores a computer program. When the computer program is executed by a processor, it implements the network configuration method described in any one of the first aspects, or the network configuration method described in any one of the second aspects.
[0041] The network configuration method, host server, device and storage medium proposed in the embodiment of the present application, the host server obtains virtual network configuration parameters, uses the Bond network port of Linux Bridge to create one or more virtual network sub-interfaces according to the virtual network label, and then uses Open vSwitch to generate virtual network ports corresponding to each virtual network sub-interface; then mounts each virtual network port to the corresponding bridge according to the bridge service label; finally, configures the network plane IP address of each bridge to generate a virtual network plane. In this embodiment, the virtual network configuration parameters are obtained to automatically configure the virtual network plane, and in the configuration process, because the Open vSwitch technology and the Linux Bridge technology are combined, the problem that the two technologies cannot be organically combined in the related technology is overcome, so that the configuration parameters of the network plane are unified, and the difficulty of system maintenance is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 The present invention is a flowchart of a network configuration method applied to a host server provided by an embodiment of the present invention.
[0043] Figure 2 It is a schematic diagram of the working principle of LinuxBridge applied to a network configuration method of a host server provided by another embodiment of the present invention.
[0044] Figure 3 yes Figure 1 Flowchart of step S120 in .
[0045] Figure 4 yes Figure 1 Flowchart of step S140 in .
[0046] Figure 5 It is a schematic diagram of the principle of a network configuration method applied to a host server provided by another embodiment of the present invention.
[0047] Figure 6 The present invention is a flowchart of a network configuration method applied to a network management server provided by an embodiment of the present invention.
[0048] Figure 7 yes Figure 6 Flowchart of step S630 in .
[0049] Figure 8 It is a schematic diagram of the principles of a network configuration method applied to a network management server provided by yet another embodiment of the present invention.
[0050] Fig. 9 It is a schematic diagram of a Web page of a network configuration method applied to a network management server provided by another embodiment of the present invention.
[0051] Fig.10 It is a structural block diagram of a network configuration device applied to a host server provided by an embodiment of the present invention.
[0052] Fig.11 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0054] It should be noted that although the functional modules are divided in the device schematic and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart.
[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.
[0056] The cloud platform deployment process of a private cloud includes planning multiple network planes, such as the management network plane, business network plane, storage network plane, Web access network plane, etc. The network plane mainly relies on the host server to provide physical network devices or virtual network devices, and different network planes are isolated from each other. Due to the limitation of the physical network cards of the host server, most host servers cannot provide enough available physical network cards. Therefore, the cloud platform deployment cannot rely entirely on physical network cards, but also needs to rely on some virtual network cards to provide enough network devices.
[0057] The applicant found that the technologies for splitting a physical network card into multiple virtual network cards in the related art are mainly: LinuxBridge and Open vSwitch. There are the following deficiencies in configuring virtual network cards based on these two technologies: 1) The virtual network card configuration process of the existing solution is mainly to manually execute command lines. This configuration efficiency is low, and the configuration parameters cannot be persisted. After the host server is restarted, it needs to be reconfigured; 2) In the existing solution, the configuration of the business-related network plane of the private cloud is mainly implemented with the support of Open vSwitch technology, while the network configuration of the host server layer is mainly implemented with the support of Linux Bridge technology. The two technologies cannot be organically combined and reversely configured in a unified manner, resulting in high maintenance difficulty; 3) If the network of the host server is fully supported by Open vSwitch technology, the network card of the host server cannot be split into multiple virtual network card sub-interfaces with vlan tags.
[0058] Based on this, an embodiment of the present invention provides a network configuration method, a host server, a device and a storage medium. In the network configuration method, the host server obtains virtual network configuration parameters, uses the Bond network port of Linux Bridge to create one or more virtual network sub-interfaces according to the virtual network label, and then uses Open vSwitch to generate virtual network ports corresponding to each virtual network sub-interface; then mounts each virtual network port to the corresponding bridge according to the bridge service label; finally, configures the network plane IP address of each bridge to generate a virtual network plane. By obtaining virtual network configuration parameters, the virtual network plane is automatically configured, and in the configuration process, because the Open vSwitch technology and the Linux Bridge technology are combined, the problem that the two technologies cannot be organically combined in the related technology is overcome, so that the configuration parameters of the network plane are unified, and the difficulty of system maintenance is reduced.
[0059] The embodiments of the present invention provide a network configuration method, a host server, a device and a storage medium, which are specifically described through the following embodiments. First, the network configuration method in the embodiments of the present invention is described.
[0060] To facilitate understanding of the embodiments of the present application, the concept of network configuration is first briefly introduced below with reference to examples of specific application scenarios.
[0061] If the cloud platform of a private cloud needs to plan multiple network planes, such as a management network plane, a business network plane, a storage network plane, a Web access network plane, etc., due to the limitation of the physical network card of the host server, most of the host servers cannot provide enough available physical network cards, so the cloud platform deployment cannot rely entirely on the physical network card, but also needs to rely on some virtual network cards to provide enough network devices. Therefore, it is necessary to split the physical network card into different numbers of virtual network cards on the host server according to the network configuration information, and each network card (virtual network card) corresponds to a network plane. The embodiment of the present application introduces automatic configuration in the host layer network configuration process of the existing private cloud, so that the user can automatically configure the virtual network card of the physical host of the cloud platform under the premise of known network configuration parameters, and provide physical network devices or virtual network devices for each network plane, so that different network planes are isolated from each other. This process of configuring the virtual network card using configuration parameters is the network configuration in the embodiment of the present application.
[0062] The following first describes a network configuration method in an embodiment of the present invention. The method is applied to a host server and can automatically configure the virtual network required by the cloud platform host server before deploying the OpenStack cloud platform, and achieve isolation between different virtual networks.
[0063] Figure 1 is an optional flowchart of the network configuration method provided by an embodiment of the present invention. Figure 1 The method in the embodiment may include but is not limited to steps S110 to S150. Figure 1 The order of step S110 to step S150 is not specifically limited, and the order of steps can be adjusted or some steps can be reduced or added according to actual needs.
[0064] Step S110: Acquire virtual network configuration parameters.
[0065] A virtual network card, also known as a virtual network adapter, is a network adapter in a network environment that is simulated by software, and is mainly used to establish a local area network between remote computers. In one embodiment, the virtual network configuration parameters include a virtual network tag and a bridge service tag, wherein the virtual network tag includes: a virtual network interface ID and a virtual network interface working mode, and the bridge service tag includes: a bridge service name and bridge network configuration information.
[0066] In one embodiment, a visual user operation platform can be built to obtain the user's requirements for network configuration in the user operation interface, and the visual operation platform converts the network configuration requirements input by the user into virtual network configuration parameters that can be recognized by the computer.
[0067] Step S120: using the bond network port of the Linux Bridge to create one or more virtual network sub-interfaces according to the virtual network label.
[0068] Linux Bridge is a virtual network device that works at Layer 2 and functions like a physical switch. It is a bridge. Bridge can bind other Linux network devices as slave devices and virtualize these devices into ports. When a slave device is bound to Bridge, it is equivalent to inserting a network cable with a terminal into the switch port in the real network.
[0069] Reference Figure 2 , which is a schematic diagram of the working principle of Linux Bridge in this embodiment.
[0070] Reference Figure 2 , the bond0 network port of the Bridge device is bound to three slave devices: the physical network device interface eth0, the virtual device tap0, and the virtual device tap1. For the upper layer of the network protocol stack, only the bond0 network port is concerned, and there is no need to pay attention to the details of the bridge. When these slave devices receive data packets, they will submit them to bond0 to determine the destination of the data packet, and bond0 will forward it according to the mapping relationship between the MAC address and the port. Since the Bridge works at the second layer, the slave devices eth0, tap0, and tap1 bound to bond0 do not need to set IP addresses. For the upper router, these three devices are all in the same subnet, so only the IP address of bond0 needs to be set, such as 10.0.1.0 / 24. At this time, eth0, tap0, and tap1 all enter and exit the 10.0.1.0 / 24 network segment through bond0. Since bond0 has a corresponding IP address, the bond0 network port can be added to the routing table and send data. The actual data sending process is completed by a slave device bound to it. If the actual network device eth0 itself has an IP, such as 192.168.4.5, after being bound to the bond0 network port, the IP will become invalid and the user program cannot send data to this IP address. Only data packets with the same destination address as the IP address of the bond0 network port will be received by LinuxBridge.
[0071] From the above, we can see that the Bond network port of Linux Bridge can virtually link multiple network cards into one network card. Therefore, through the Bond technology, multiple network cards appear to be a single Ethernet interface device with the same IP address.
[0072] Therefore, in one embodiment, at least one physical network device interface is logically associated with the first binding relationship using the Bond network port. For example, two physical network device interfaces can be bound to the Bond network port according to the first binding relationship, that is, two physical network devices form a Bond network port.
[0073] In one embodiment, referring to Figure 3 , is a specific implementation flow chart of step S120 shown in an embodiment. In this embodiment, step S120 of creating one or more virtual network sub-interfaces according to virtual network labels using the Bond network port of Linux Bridge includes:
[0074] Step S121: configure at least one physical network device interface to obtain first binding information.
[0075] In one embodiment, a physical network port is selected as a physical network device interface, for example, two physical network ports ens4f0 and ens4f1 are selected, and they are configured according to the network configuration requirements of Linux Bridge to obtain a first binding relationship.
[0076] In one embodiment, the physical network device interfaces are ens4f0 and ens4f1, which are configured respectively. The configuration files are ifcfg-ens4f0 and ifcfg-ens4f1. The corresponding configuration information is described as follows:
[0077]
[0078]
[0079] Taking the configuration information of ifcfg-ens4f0 as an example, the above configuration information is parsed:
[0080]
[0081] It can be seen from the above configuration information of ifcfg-ens4f0 that ens4f0 is bound to the bond0 network port, and it can be seen from the configuration information of ifcfg-ens4f1 that ens4f1 is also bound to the bond0 network port. This binding relationship is the first binding information in the embodiment of the present application.
[0082] Step S122: configure the virtual network interface working mode of the Bond network port according to the first binding information.
[0083] In one embodiment, when there is more than one physical network device interface in the Bond network port configured according to the first binding information, it is necessary to set the working modes of different physical network device interfaces, that is, the virtual network interface working mode is the switching mode of at least one physical network device interface.
[0084] In one embodiment, the virtual network interface working mode includes one of the following: balanced polling strategy, primary-backup strategy, balanced strategy, broadcast strategy, dynamic link aggregation, adapter transmission load balancing or adapter adaptive load balancing.
[0085] The following example illustrates the above seven working modes. In the example scenario, two physical network ports ens4f0 and ens4f1 form the bond0 network port.
[0086] 1) Balanced polling strategy
[0087] The order of transmitting data packets is sequential transmission, that is, the first packet goes through ens4f0, the next packet goes through ens4f1, and the next packet goes through ens4f0, and so on, until the last packet is transmitted. This mode can increase bandwidth, achieve link load balancing, and support fault tolerance. If a link fails, it will automatically switch to a normal link.
[0088] 2) Primary-backup strategy
[0089] Set one of the two physical network ports ens4f0 and ens4f1 as the primary device and the other as the backup device. All data packets are sent on the primary device. Only one device is active at the same time. If the primary device fails, the backup device switches from the backup to the primary device to send data packets. Although this mode has low resource utilization, it has fault tolerance and can improve the availability of network connections.
[0090] 3) Balanced strategy
[0091] Data packets are transmitted based on the specified transmission strategy. For example, in one embodiment, the default transmission strategy is: (source MAC address XOR destination MAC address)% slave device number. Other transmission strategies can be specified through the xmit_hash_policy option. This working mode can provide load balancing and fault tolerance, but it requires the switch to configure the port channel before the xmit_hash_policy command can be used.
[0092] 4) Broadcast strategy
[0093] All data packets are sent from any physical network port, and each physical network port transmits a data packet. Although this mode wastes resources, it can implement a redundancy mechanism and improve the reliability of network transmission.
[0094] 5) Dynamic Link Aggregation
[0095] By creating an aggregation group, the aggregation group contains different network devices, and the network devices in the aggregation group share the transmission rate and duplex setting parameters. This working mode is suitable for situations where there are multiple network devices.
[0096] 6) Adapter transmission load balancing
[0097] According to the load of each network device (such as calculating the transmission speed), the appropriate network device is selected to send the data packet. If the network device receiving the data fails, another network device takes over the MAC address of the failed network device. This working mode can improve the transmission efficiency.
[0098] 7) Adapter Adaptive Load Balancing
[0099] On the basis of the above adapter transmission load balancing, the receiving load of each network device is also calculated to evenly distribute the network devices. This working mode can improve the transmission efficiency.
[0100] In one embodiment, the bond0 network port is configured according to the first binding information. The specific configuration file is ifcfg-bond0, and the configuration information is:
[0101] TYPE = Ethernet (network type is Ethernet)
[0102] BOOTPROTO=none (boot protocol uses the IP address set by the user)
[0103] NAME=bond0 (the network port name is bond0)
[0104] DEVICE = bond0 (network port is bond0)
[0105] ONBOOT=yes (the system starts the network card switch and turns it on)
[0106] BOND_IFACES = "ens4f0 ens4f1" (the first binding relationship binds two physical network ports, ens4f0 and ens4f1)
[0107] BONDING_MASTER=yes (bond0 network port is open)
[0108] BONDING_OPTS="mode=3miimon=100lacp_rate=1xmit_hash_policy=1"
[0109] It can be seen from the above bond0 configuration information BONDING_OPTS that "mode=3" indicates that the working mode of the virtual network interface is: mode=3, that is, the above-mentioned balance strategy; "miimon=100" indicates that the link detection time interval is 100ms, that is, the link connection status is monitored every 100ms; "lacp_rate=1" indicates that the detection packet for detecting whether the host network card is alive is sent every 30 seconds (fast) or every second (slow); "xmit_hash_policy=1" indicates that the specific transmission strategy selects the first transmission strategy.
[0110] From the above, we can know that we can select the appropriate working mode according to the actual business needs, and then configure the working mode of the network device bound to the Bond network port. Configuring the Bond network port under Linux Bridge can increase the reliability of the host server and increase the available network bandwidth through the network card bonding technology, providing users with uninterrupted network services to meet business needs.
[0111] Step S123: Create one or more virtual network sub-interfaces based on the virtual network interface ID using the Bond network port.
[0112] In one embodiment, the virtual network interface ID is the vlan tag of the virtual network, for example: vlan201, vlan203, vlan204... etc., and then a corresponding number of virtual network sub-interfaces are created according to the vlan tag of the virtual network. That is, in this embodiment, the virtual network sub-interface is a plurality of virtual logical interfaces created by using protocols and technologies to create at least one physical network device interface (such as the above-mentioned ens4f0 and ens4f1) through a Bond network port. The virtual network sub-interface shares the traffic of the physical network port. Relative to the virtual network sub-interface, this physical network device interface can be considered as the main interface. Each virtual network sub-interface is no different from each physical network device interface in terms of function and role. In order to avoid the number of network planes being limited by the number of physical network device interfaces, the embodiment of the present application divides multiple virtual network sub-interfaces from the physical network device interface of the router to achieve routing and communication between multiple virtual network sub-interfaces.
[0113] In one embodiment, the vlan tags are: vlan201, vlan203 and vlan204, and the bond0 network port creates three virtual network sub-interfaces, namely: bond0.201, bond0.203 and bond0.204. The corresponding configuration files for setting the virtual network sub-interfaces are: ifcfg-bond0.201, ifcfg-bond0.203 and ifcfg-bond0.204, and the relevant configuration information is:
[0114]
[0115]
[0116] Take the configuration information of the configuration file ifcfg-bond0.201 of the virtual network sub-interface bond0.201 as an example to parse the above configuration information:
[0117] TYPE=vlan (type is virtual network);
[0118] PHYSDEV = bond0 (the associated physical network port is bond0);
[0119] BOOTPROTO=static (boot protocol is static)
[0120] NAME=bond0.201 (the name of the virtual network subinterface is bond0.201)
[0121] DEVICE = bond0.201 (the network device of the virtual network subinterface is bond0.201)
[0122] ONBOOT=yes (the system starts the network card switch and turns it on)
[0123] VLAN = yes (use DHCP or static IP to assign the correct IP address)
[0124] VLAN_ID = 201 (the virtual network interface ID is 201)
[0125] As can be seen from the above, the embodiment of the present application utilizes the Bond network port of Linux Bridge to create one or more virtual network sub-interfaces according to the virtual network label to prepare a network plane for subsequent support of business needs.
[0126] Step S130: Generate a virtual network port corresponding to each virtual network sub-interface using Open vSwitch.
[0127] Open vSwitch is an open source virtual switch, a type of bridge that functions as an Ethernet switch. It can forward data packets received from a port to another port or ports according to certain flow rules. A virtual network port is a unit of a virtual network subinterface used to send and receive data packets, similar to a port on a physical Ethernet switch. In OpenvSwitch, each virtual network port belongs to a specific bridge. Data packets received by a virtual network port will be processed by flow rules and sent to other ports, and data packets from other ports will also be sent out.
[0128] In one embodiment, the virtual network port corresponding to each virtual network sub-interface is configured according to the configuration requirements of the virtual network port in Open vSwitch.
[0129] In one embodiment, the bond0 network port creates three virtual network sub-interfaces, namely bond0.201, bond0.203 and bond0.204, and the configured virtual network ports are bond0_201_port, bond0_203_port and bond0_204_port, respectively. The configuration files for configuring the virtual network ports are ifcfg-bond0_201_port, ifcfg-bond0_203_port and ifcfg-bond0_204_port, respectively. The relevant configuration information is:
[0130]
[0131]
[0132] Take the configuration information of the configuration file ifcfg-bond0_201_port of the virtual network port bond0_201_port as an example to parse the above configuration information:
[0133] cat ifcfg-bond0_201_port
[0134] DEVICE = bond0.201 (the configured virtual network subinterface is bond0.201)
[0135] NOBOOT=yes (system boots up and the network card is turned off)
[0136] DEVICETYPE = ovs (the function of the virtual network port is a switch)
[0137] OVS_BRIDGE = br-mgmt (the bridge is the management bridge br-mgmt)
[0138] TYPE = OVSPort (the type of virtual network port is switch port)
[0139] From the above, it can be seen that the embodiment of the present application configures the virtual network port corresponding to each virtual network sub-interface according to the configuration requirements of the virtual network port in Open vSwitch, combines the Open vSwitch technology and the Linux Bridge technology, unifies the configuration parameters of the network plane, and reduces the difficulty of system maintenance.
[0140] Step S140: Mount each virtual network port to a corresponding bridge according to the bridge service label.
[0141] In one embodiment, the bridge service tag includes: a bridge service name and bridge network configuration information. The bridge service name is related to the bridge service, such as management bridge, Web access bridge, service bridge, etc. The bridge network configuration information includes: network address, network mask or gateway.
[0142] In one embodiment, referring to Figure 4 , is a specific implementation flow chart of step S140 shown in an embodiment. In this embodiment, step S140 of mounting each virtual network port to a corresponding bridge according to a bridge service label includes:
[0143] Step S141, configuring the bridge network according to the bridge network configuration information.
[0144] Step S142: mount each virtual network port to a corresponding bridge according to the bridge service name.
[0145] In one embodiment, the bond0 network port creates three virtual network sub-interfaces, namely bond0.201, bond0.203 and bond0.204, and the configured virtual network ports are bond0_201_port, bond0_203_port and bond0_204_port. The network bridges include a management bridge, a Web access bridge and a service bridge.
[0146] In one embodiment, the above-mentioned bridges are respectively represented as: management bridge (br-mgmt), Web access bridge (br-pub) and service bridge (br-service), and the network of the bridge is configured according to the bridge network configuration information. The configuration files corresponding to the three bridges are: ifcfg-br-mgmt, ifcfg-br-pub and ifcfg-br-service, and the configuration information is represented as:
[0147]
[0148]
[0149] Take the configuration information of the configuration file ifcfg-br-pub of the Web access bridge br-pub as an example to parse the above configuration information:
[0150]
[0151]
[0152] It is understandable that not every bridge needs to be configured with the IP addresses of DNS server 1 and DNS server 2, and the configuration parameters are selected according to actual business requirements.
[0153] From the above, it can be seen that: the embodiment of the present application configures the network parameters of the bridge mounted on each virtual network port according to the configuration requirements of the bridge in Open vSwitch, combines Open vSwitch technology and Linux Bridge technology, unifies the configuration parameters of the network plane, and reduces the difficulty of system maintenance.
[0154] Reference Figure 5 , is a schematic diagram of the principles of the network configuration method applied to the host server in an embodiment of the present application.
[0155] Reference Figure 5, the physical network device interfaces are ens4f0 and ens4f1, which are configured according to the network configuration requirements of Linux Bridge to obtain the first binding relationship. It can be seen from the configuration information of ifcfg-ens4f0 that ens4f0 is bound to the bond0 network port, and it can be seen from the configuration information of ifcfg-ens4f1 that ens4f1 is also bound to the bond0 network port. This binding relationship is the first binding information in the embodiment of the present application, that is, the physical network device interfaces ens4f0 and ens4f1 are associated with the Bond network port of Linux Bridge. Then, according to the actual business needs, a suitable working mode is selected to configure the working mode of the network device bound to the Bond network port. According to the network plane requirements required by the business, three virtual network sub-interfaces are created based on the virtual network interface ID using the Bond network port. Specifically, the vlan tags are: vlan201, vlan203 and vlan204. The bond0 network port creates three virtual network sub-interfaces, namely: bond0.201, bond0.203 and bond0.204. Then use OpenvSwitch to generate the virtual network port corresponding to each virtual network sub-interface. The three virtual network sub-interfaces are bond0.201, bond0.203 and bond0.204, and the configured virtual network ports are bond0_201_port, bond0_203_port and bond0_204_port. Finally, according to the bridge service label, each virtual network port is mounted to the corresponding bridge. The bridges are represented as management bridge (br-mgmt), Web access bridge (br-pub) and service bridge (br-service). Mount the virtual network port bond0_201_port to the management bridge (br-mgmt), mount the virtual network port bond0_203_port to the Web access bridge (br-pub), and mount the virtual network port bond0_204_port to the service bridge (br-service).
[0156] From the above, we can know that by combining Open vSwitch technology with Linux Bridge technology, according to the obtained virtual network label and bridge service label, use the Bond network port of Linux Bridge to create one or more virtual network sub-interfaces according to the virtual network label, and then use Open vSwitch to generate the virtual network port corresponding to each virtual network sub-interface; then mount each virtual network port to the corresponding bridge according to the bridge service label to obtain different network planes. The configuration parameters of the network plane are unified during the entire configuration process, which can reduce the difficulty of system maintenance.
[0157] Step S150: configure the network plane IP address of each bridge to generate a virtual network plane.
[0158] In one embodiment, after the obtained virtual network port and each corresponding bridge are mounted, in order to realize the functions of different network planes, it is necessary to configure the network plane IP address of each bridge, so that the data packet information of the service corresponding to the network plane can be received according to the IP address, thereby realizing the ability of a group of physical network cards to virtualize multiple physical network devices with VLAN tags.
[0159] It can be understood that, since each virtual network plane corresponds to a virtual network sub-interface, different virtual network planes are isolated from each other.
[0160] In one embodiment, the configuration parameters generated in the above configuration process, whether it is physical network device interface configuration information, bond0 network port configuration information, virtual network sub-interface configuration information, virtual network port configuration information or bridge configuration information, are written into the configuration file of the physical network device, that is, the configuration persistence operation is performed, so that even if the host server is restarted and the operating system loads the network card configuration file, the above network configuration will not be lost. In one embodiment, in the centos7.6 version (other operating systems are the same) operating system, the network card configuration file path is: / etc / sysconfig / network-scrIpts / .
[0161] The network configuration method proposed in the embodiment of the present application is applied to the host server. During the configuration process, the virtual network configuration parameters are obtained, and one or more virtual network sub-interfaces are created according to the virtual network label using the Bond network port of Linux Bridge, and then the virtual network port corresponding to each virtual network sub-interface is generated using Open vSwitch; then each virtual network port is mounted to the corresponding bridge according to the bridge service label; finally, the network plane IP address of each bridge is configured to generate a virtual network plane. In this embodiment, the virtual network configuration parameters are obtained to automatically configure the virtual network plane, and during the configuration process, because the Open vSwitch technology and the Linux Bridge technology are combined, the problem that the two technologies cannot be organically combined in the related technology is overcome, so that the configuration parameters of the network plane are unified, and the difficulty of system maintenance is reduced.
[0162] The embodiment of the present invention also provides a network configuration method applied to a network management server.
[0163] In one embodiment, the network management server is generally a Server server, which can receive Web requests for network setting parameters, then generate corresponding configuration scripts from the Web requests, and then operate the corresponding host server through the Sshpass tool to complete the corresponding network configuration.
[0164] Figure 6 is an optional flow chart of a network configuration method applied to a network management server provided by an embodiment of the present invention. Figure 6 The method in the embodiment may include but is not limited to steps S610 to S640. Figure 6 The order of step S610 to step S640 is not specifically limited, and the order of steps can be adjusted or some steps can be reduced or added according to actual needs.
[0165] Step S610: Send a network card query request to the host server.
[0166] In one embodiment, before configuring the virtual network card of the host server, it is necessary to query the relevant information of the available network cards of the host server, and perform targeted configuration according to the relevant information of the available network cards.
[0167] Step S620: receiving available network card information sent by the host server in response to the network card query request.
[0168] In one embodiment, after receiving the network card query request sent by the network management server, the host server responds to the request and sends its own available network card information back to the network management server, so as to receive targeted network configuration information.
[0169] Step S630: receiving virtual network configuration parameters corresponding to available network card information.
[0170] In one embodiment, the network management server displays available network card information to the user, and the user inputs virtual network configuration parameters to the network management server according to the available network card information.
[0171] In one embodiment, referring to Figure 7 , is a specific implementation flow chart of step S630 shown in an embodiment. In this embodiment, step S630 of receiving virtual network configuration parameters corresponding to available network card information includes:
[0172] Step S631, receiving Web request information corresponding to available network card information.
[0173] In one embodiment, in order to enable users to intuitively configure virtual network cards, front-end software or a Web interface is developed for user operation, available network card information is presented to users in the form of a list, and Web request information generated by network configuration parameters selected by users for the available network card information is received.
[0174] Step S632: Generate virtual network configuration parameters according to the Web request information.
[0175] In one embodiment, the network management server converts the received Web request information into virtual network configuration parameters, where the virtual network configuration parameters are a type of script information.
[0176] Step S640: Send the virtual network configuration parameters to the host server using the Sshpass tool.
[0177] In one embodiment, the network management server generates a corresponding configuration script based on a Web request for virtual network configuration parameters received from a user, and then sends the script information of the virtual network configuration parameters to the host server through the Sshpass tool, so that the corresponding host server can generate a virtual network plane using a network configuration method applied to the host server in any of the above embodiments.
[0178] In the prior art, if you use the ssh tool to log in to a remote host server, generally by default, an interactive prompt will appear requiring you to manually enter a password. When you need to write automated scripts for commands such as ssh and scp, manual participation is required, and it is impossible to perform automated ssh remote connections in the script. Therefore, in this embodiment, the Sshpass tool is used to log in to the remote host server to solve the interactive problem. The Sshpass tool is a simple, lightweight command line tool that can be used to perform non-interactive password verification and operate the host server on the other end when the user name and password of the other end are known.
[0179] In one embodiment, in order to enable users to intuitively configure the virtual network card, a front-end software or a Web interface is developed for users to operate to configure the virtual network. Figure 8 , which is a schematic diagram of the principles of a network configuration method applied to a network management server according to an embodiment of the present application.
[0180] In this embodiment, the front-end software or web page is developed and installed on a network management server (eg, a Server server). The figure takes a Web page as an example for illustration. The Server server mainly uses the shpass tool to send requests to the target host server and receive request return values.
[0181] First, the server sends a network card query request to the target host server, and then the target host server returns the available network card information generated in response to the network card query request to the server. The available network card information here is the physical network device interface in the above embodiment. The server displays the available network card information on the Web page. Fig. 9 Schematic diagram of the web page. The user selects the corresponding available network card from the network card list displayed on the web page and enters the web request information of the virtual network configuration parameters on the web page. The web request information may include: physical network device interface (physical network card in the figure), Bond network port, VLAN tag (vianid in the figure), bridge (br-mgmt, br-pub and br-service), network address (IP address in the figure), network mask (NETMASK in the figure) or gateway (GATEWAY in the figure), etc.
[0182] The server receives the web request information and converts it into script information corresponding to the virtual network configuration parameters and sends it to the target host server. The script information includes necessary configuration parameters such as interface configuration information, virtual network port configuration information or bridge configuration information.
[0183] The target host server performs virtual network configuration according to the virtual network configuration parameters. The process of virtual network configuration is described as follows: using the Bond network port of Linux Bridge to create one or more virtual network sub-interfaces according to the virtual network label, and then using Open vSwitch to generate the virtual network port corresponding to each virtual network sub-interface; then mounting each virtual network port to the corresponding bridge according to the bridge service label; finally, configuring the network plane IP address of each bridge to generate a virtual network plane.
[0184] Finally, after the network configuration is completed, the Server sends a network service restart request to the target host server, and the target host server restarts the network service according to the network service restart request. After the network is restarted, the Server sends a network status query request to the target host server, and receives the virtual network status after the restart returned by the target host server. The Server displays the received virtual network status on the Web page so that users can intuitively detect the virtual network status.
[0185] Reference Figure 8The embodiment of the present application utilizes virtual switching technology to realize automatic configuration of the virtual network of the host server through software. Only simple interface operation is required to configure the virtual network of the host server with one click. It has the following advantages: 1) The operation process is simpler. The software will automatically configure the network according to the user's network planning, and a large number of repetitive command line operations are not required; 2) The operation is more flexible. A single network card can virtualize a large number of virtual network devices to adapt to various forms of cloud platform deployment solutions; 3) The operation is more stable. All configurations are persistent. The network configuration will not be lost due to abnormal system restart. The physical network port link is redundant and dynamically aggregated to ensure the stability and reliability of the host layer network.
[0186] The embodiments of the present application can be applied in the following scenarios: 1) in the field of cloud computing, when a private cloud platform with different network solutions needs to be deployed, automatic network configuration is performed on the physical host; or, 2) in the field of DevOps, when physical network resources are limited, a large number of VLAN-isolated network devices are provided. It is understandable that the application scenarios are only for illustration and do not mean that they can only be used in the above two scenarios.
[0187] In this embodiment, the acquired virtual network configuration parameters are sent to the host server, so that the host server can automatically configure the virtual network plane. In the configuration process, because the Open vSwitch technology and the LinuxBridge technology are combined, the problem that the two technologies cannot be organically combined in the related technology is overcome, the configuration parameters of the network plane are unified, and the difficulty of system maintenance is reduced.
[0188] The embodiment of the present invention also provides a host server, which can implement the above network configuration method, referring to Fig.10 , the host server comprises:
[0189] The configuration parameter acquisition unit 1010 is used to acquire virtual network configuration parameters, where the virtual network configuration parameters include a virtual network label and a bridge service label.
[0190] The virtual network sub-interface creation unit 1020 is used to create one or more virtual network sub-interfaces according to the virtual network label by using the Bond network port of the Linux Bridge, where the Bond network port is generated by at least one master device network interface and at least one slave device network interface according to a first binding relationship.
[0191] The virtual network port generating unit 1030 is used to generate a virtual network port corresponding to each virtual network sub-interface by using Open vSwitch.
[0192] The bridge mounting unit 1040 is used to mount each virtual network port to a corresponding bridge according to the bridge service label.
[0193] The virtual network plane generating unit 1050 is used to configure the network plane IP address of each bridge to generate a virtual network plane.
[0194] The specific implementation of the network configuration device of this embodiment is basically consistent with the specific implementation of the network configuration method applied to the host server mentioned above, and will not be repeated here.
[0195] An embodiment of the present invention further provides an electronic device, including:
[0196] at least one memory;
[0197] at least one processor;
[0198] at least one program;
[0199] The program is stored in the memory, and the processor executes the at least one program to implement the network configuration method of the two embodiments of the present invention. The electronic device can be any intelligent terminal or server including a mobile phone, a tablet computer, a personal digital assistant (PDA), a car computer, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms; it can also be a service node in a blockchain system, and each service node in the blockchain system forms a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol running on the Transmission Control Protocol (TCP) protocol. The server can be installed with a server end of a language synthesis system, through which the server end can interact with the terminal, for example, the corresponding software is installed on the server end, and the software can be an application that implements the target language speech synthesis method, etc., but is not limited to the above form. The terminal and the server may be connected via Bluetooth, USB (Universal Serial Bus) or a network or other communication connection methods, which are not limited in this embodiment.
[0200] See also Fig.11 , Fig.11 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0201] The processor 1101 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention;
[0202] The memory 1102 may be implemented in the form of a ROM (Read Only Memory), a static storage device, a dynamic storage device, or a RAM (Random Access Memory). The memory 1102 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1102, and the processor 1101 calls and executes the network configuration method of the embodiments of the present invention.
[0203] Input / output interface 1103, used to implement information input and output;
[0204] Communication interface 1104, used to realize communication interaction between the device and other devices, which can be realized by wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.); and
[0205] A bus 1105 that transmits information between various components of the device (e.g., the processor 1101, the memory 1102, the input / output interface 1103, and the communication interface 1104);
[0206] The processor 1101 , the memory 1102 , the input / output interface 1103 and the communication interface 1104 are connected to each other in communication within the device via the bus 1105 .
[0207] An embodiment of the present application further provides a storage medium, which is a computer-readable storage medium and stores a computer program. When the computer program is executed by a processor, the above-mentioned network configuration method is implemented.
[0208] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0209] The network configuration method, host server, device and storage medium proposed in the embodiment of the present invention are applied to the network configuration method of the host server, and the virtual network configuration parameters are obtained during the configuration process, and one or more virtual network sub-interfaces are created according to the virtual network label using the Bond network port of Linux Bridge, and then the virtual network port corresponding to each virtual network sub-interface is generated using Open vSwitch; then each virtual network port is mounted to the corresponding bridge according to the bridge service label; finally, the network plane IP address of each bridge is configured to generate a virtual network plane. In this embodiment, the virtual network configuration parameters are obtained to automatically configure the virtual network plane, and in the configuration process, because the Open vSwitch technology and the Linux Bridge technology are combined, the problem that the two technologies cannot be organically combined in the related technology is overcome, so that the configuration parameters of the network plane are unified, and the difficulty of system maintenance is reduced.
[0210] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0211] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0212] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0213] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0214] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0215] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0216] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0217] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0218] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0219] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0220] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A network configuration method, applied to a host server, characterized in that: include: Acquire virtual network configuration parameters, wherein the virtual network configuration parameters include a virtual network label and a bridge service label; Using the Bond network port of Linux Bridge to create one or more virtual network sub-interfaces according to the virtual network label, the Bond network port is generated by at least one physical network device interface according to the first binding relationship; Generate a virtual network port corresponding to each virtual network sub-interface using Open vSwitch; Mounting each of the virtual network ports to a corresponding bridge according to the bridge service label; Configuring the network plane IP address of each of the bridges to generate a virtual network plane; The virtual network label includes: a virtual network interface ID and a virtual network interface working mode; the use of the LinuxBridge Bond network port to create one or more virtual network sub-interfaces according to the virtual network label includes: configuring at least one physical network device interface to obtain first binding information, where the first binding information is the first binding relationship; Configure the virtual network interface working mode of the Bond network port according to the first binding information, the virtual network interface working mode is a switching mode of at least one of the physical network device interfaces, and the virtual network interface working mode includes one of the following: balanced polling strategy, primary backup strategy, balanced strategy, broadcast strategy, dynamic link aggregation, adapter transmission load balancing or adapter adaptive load balancing; Using the Bond network port to create one or more virtual network sub-interfaces based on the virtual network interface ID; The bridge service tag includes: a bridge service name and bridge network configuration information, the bridge network configuration information includes: a network address, a network mask or a gateway; and mounting each of the virtual network ports to a corresponding bridge according to the bridge service tag includes: Configure the network of the bridge according to the bridge network configuration information; Each of the virtual network ports is mounted to a corresponding bridge according to the bridge service name.
2. The network configuration method according to claim 1, characterized in that: Before obtaining the virtual network configuration parameters, the method further includes: Send available network card information according to network card query request; The virtual network configuration parameter generated based on the available network card information is received.
3. The network configuration method according to claim 1, characterized in that: The obtaining of virtual network configuration parameters includes: The virtual network configuration parameters sent by using the Sshpass tool are received.
4. The network configuration method according to any one of claims 1 to 3, characterized in that: Also includes: The configuration parameters in the configuration process are written into the network configuration file of the host server.
5. A network configuration method, applied to a network management server, characterized in that: include: Send a network card query request to the host server; Receiving available network card information sent by the host server in response to the network card query request; Receive the virtual network configuration parameters corresponding to the available network card information; The virtual network configuration parameters are sent to the host server using the Sshpass tool, so that the host server can generate a virtual network plane using the network configuration method according to any one of claims 1 to 4.
6. A network configuration method according to claim 5, characterized in that: The receiving the virtual network configuration parameter corresponding to the available network card information includes: Receiving Web request information corresponding to the available network card information; The virtual network configuration parameters are generated according to the Web request information, and the virtual network configuration parameters are script form data.
7. A host server, characterized in that: include: A configuration parameter acquisition unit, used to acquire virtual network configuration parameters, wherein the virtual network configuration parameters include a virtual network label and a bridge service label; A virtual network sub-interface creation unit, configured to create one or more virtual network sub-interfaces according to the virtual network label by using the Bond network port of the Linux Bridge, wherein the Bond network port is generated by at least one master device network interface and at least one slave device network interface according to a first binding relationship; A virtual network port generating unit, used to generate a virtual network port corresponding to each virtual network sub-interface by using Open vSwitch; A bridge mounting unit, configured to mount each of the virtual network ports to a corresponding bridge according to the bridge service label; A virtual network plane generating unit, used for configuring the network plane IP address of each of the bridges to generate a virtual network plane; The virtual network label includes: a virtual network interface ID and a virtual network interface working mode; the use of the LinuxBridge Bond network port to create one or more virtual network sub-interfaces according to the virtual network label includes: configuring at least one physical network device interface to obtain first binding information, where the first binding information is the first binding relationship; Configure the virtual network interface working mode of the Bond network port according to the first binding information, the virtual network interface working mode is a switching mode of at least one of the physical network device interfaces, and the virtual network interface working mode includes one of the following: balanced polling strategy, primary backup strategy, balanced strategy, broadcast strategy, dynamic link aggregation, adapter transmission load balancing or adapter adaptive load balancing; Using the Bond network port to create one or more virtual network sub-interfaces based on the virtual network interface ID; The bridge service tag includes: a bridge service name and bridge network configuration information, the bridge network configuration information includes: a network address, a network mask or a gateway; and mounting each of the virtual network ports to a corresponding bridge according to the bridge service tag includes: Configure the network of the bridge according to the bridge network configuration information; Each of the virtual network ports is mounted to a corresponding bridge according to the bridge service name.
8. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the network configuration method described in any one of claims 1 to 4, or the network configuration method described in any one of claims 5 or 6 when executing the computer program.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the network configuration method described in any one of claims 1 to 4, or the network configuration method described in any one of claims 5 or 6.
Citation Information
Patent Citations
Network deployment for OVS and Linux bridge in SDN new-type network
CN108599999A
Multiple virtual network interface support for virtual execution elements
CN110875844A