CN106790735A - The virtual machine static network method to set up communicated using serial ports and DHCP protocol - Google Patents

The virtual machine static network method to set up communicated using serial ports and DHCP protocol Download PDF

Info

Publication number
CN106790735A
CN106790735A CN201611003510.XA CN201611003510A CN106790735A CN 106790735 A CN106790735 A CN 106790735A CN 201611003510 A CN201611003510 A CN 201611003510A CN 106790735 A CN106790735 A CN 106790735A
Authority
CN
China
Prior art keywords
network
virtual machine
network configuration
dhcp
configuration information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201611003510.XA
Other languages
Chinese (zh)
Inventor
罗义兵
熊梦
杨松
季统凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
G Cloud Technology Co Ltd
Original Assignee
G Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by G Cloud Technology Co Ltd filed Critical G Cloud Technology Co Ltd
Priority to CN201611003510.XA priority Critical patent/CN106790735A/en
Publication of CN106790735A publication Critical patent/CN106790735A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting

Abstract

The present invention relates to field of cloud computer technology, the virtual machine static network method to set up of particularly a kind of utilization serial ports and DHCP protocol communication.The method of the present invention includes setting on the dhcp server the network configuration information of virtual machine;Virtual machine carry network interface card is given in virtual machine host machine;Host sends network configuration event by serial communication to virtual machine;After virtual machine internal network configuration agency obtains network configuration event, then using DHCP protocol, the network configuration information on Dynamic Host Configuration Protocol server is obtained, by network configuration information persistence network profile, most the network of virtual machine becomes static network configuration at last.By the way that the invention provides a kind of method to set up of virtual machine static network, the reliability and stability for setting static network can be improved.

Description

The virtual machine static network method to set up communicated using serial ports and DHCP protocol
Technical field
The present invention relates to field of cloud computer technology, the virtual machine of particularly a kind of utilization serial ports and DHCP protocol communication is static Network setting method.
Background technology
Set in the static network of field of cloud calculation virtual machine, current major part is using the skill of virtual machine serial communication Art, virtual machine internal is passed to by the network information of virtual machine, and virtual machine internal receives network information static state setting network again.This The method of kind needs incoming more network packet to virtual machine internal, and virtual machine internal constantly reads its network packet, believes Breath amount is big and communication is than in the case of more frequently, it may appear that clogged with messages and the situation of messaging failure, so as to influence virtual The static network of machine network is set.And DHCP protocol obtains dynamic network information as ripe technology, its protocol communication Stability it is reliable, but if virtual machine completely by the way of DHCP dynamic access, it is necessary to some cycles are continued Phase operates, and just can guarantee that the normal of network;If renewing failure, the information of network can be influenceed to lose, cause the interruption of network.
The content of the invention
Present invention solves the technical problem that being that the virtual machine static network that a kind of utilization serial ports and DHCP protocol communicate sets Method is put, solving tradition carries out the instability problem of static IP setting using the serial ports transmission network information.
The present invention solve above-mentioned technical problem technical scheme be,
Described method comprises the following steps:
Step 1:The network configuration information of virtual machine is set on the dhcp server;
Step 2:Virtual machine carry network interface card is given in virtual machine host machine;
Step 3:Host sends network configuration event by serial communication to virtual machine;
Step 4:Virtual machine internal network configuration agency obtains network configuration event;
Step 5:Network configuration agency's adjustment network configuration is the automatic acquisition modes of DHCP, and DHCP is obtained using DHCP protocol Network configuration information on server;
Step 6:Network configuration information is persisted in network profile, most at last the network of virtual machine from DHCP from Dynamic acquisition modes become static network configuration.
Dynamic Host Configuration Protocol server network configuration information includes MAC Address, IP address, gateway address, the network segment, domain name resolution service Device.
The virtual machine network interface card of described carry is consistent with MAC;Described virtual machine supports network interface card hot plug mechanism.
Dhcp client is broadcast on Dynamic Host Configuration Protocol server using DHCP protocol, obtains network configuration letter on Dynamic Host Configuration Protocol server Breath.
Virtual machine internal network configuration agency concretely comprise the following steps:
(1) reliable and stable acquisition network configuration event;
(2) network configuration acts on behalf of running environment and supports cross-platform, including the operation of Windows, linux system;
(3) static network is set using DHCP protocol to set.
Static network sets and concretely comprises the following steps:
(1) dhcp client is utilized, DHCP request is sent to Dynamic Host Configuration Protocol server, obtain corresponding network configuration information;
(2) after obtaining network configuration information, network configuration information is persisted to by network configuration by network configurator In file;
(3) network interface card is reloaded, static configuration is come into force.
Described network configuration event improves the packet of serial communication it is characterized in that the packet for sending is as far as possible short and small Reliability, for example send message data " 1 " to virtual machine internal.
The method of the present invention is effectively solved complete using the stability of control ability and the DHCP protocol communication of serial communication The instability problem of virtual machine network is set using serial communication, and realization principle is simple, reliable, is easily integrated into cloud computing In platform.
Brief description of the drawings
The present invention is further described below in conjunction with the accompanying drawings:
Fig. 1 is flow chart of the invention.
Specific embodiment
As shown in figure 1, implementation steps of the present invention are as follows:
(1) network configuration information of virtual machine, by taking dnsmasq servers as an example, wherein DHCP are set to DHCP Server The configuration file of Server is as follows:
Virtual machine network interface card relevant configuration:Contain MAC Address, Hostname, ip addresses
fa:16:3e:b0:ff:0c, host-101-101-101-4.gcloudlocal, 101.101.101.5
Other specification is configured:Route, domain name service etc.
tag:Tag0, option:Router, 101.101.101.1
tag:Tag0, option:Dns-server, 101.101.101.4,101.101.101.3
(2) virtual machine carry network interface card is given in virtual machine host machine.
Implement using virsh order carries, wherein libvirt network profiles, it is as follows:
Wherein mac address are consistent with mac address in virtual machine network card configuration in DHCP Server, it is ensured that Virtual machine internal obtains the correctness of virtual machine network configuration using DHCP protocol below.
(3) host sends network configuration event by serial communication to virtual machine
At present realize virtual machine one throw the net card network control, its serial data bag for being sent to virtual machine, with " 1 " data Bag control, " 1 " represents and obtains virtual machine network configuration using DHCP protocol.Matching somebody with somebody for multiple virtual machine network interface cards is controlled if desired Put, then using network interface card Mac addresses mark.
(4) virtual machine internal network configuration Agent obtains network configuration event, and the serial ports for implementing monitoring virtual machine leads to Letter data, gets " 1 " packet, then it represents that to carry out network configuration.
(5) by taking Centos systems as an example, the network interface card for adjusting virtual machine is DHCP modes,
Network card configuration file ifcfg-eth0, it is as follows:
BOOTPROTO=dhcp
DEVICE=eth0
ONBOOT=yes
Then dhcp client programs are performed and obtains network configuration from dhcp server, such as issued orders:
Dhcpclient eth0 obtain the network configuration information of the network interface card of virtual machine, as follows:
interface“eth0”
fixed-address 101.101.101.5
routers 101.101.101.1
..............
(6) network configuration information by more than, is written in network card configuration file ifcfg-eth0, as follows:TYPE =Ethernet
BOOTPROTO=static
DEVICE=eth0
ONBOOT=yes
IPADDR=101.101.101.5
GATEWAY=101.101.101.1
NETMASK=255.255.255.0
DNS1=101.101.101.4
DNS2=101.101.101.3.

Claims (8)

1. a kind of virtual machine static network method to set up that utilization serial ports and DHCP protocol communicate, it is characterised in that described side Method comprises the following steps:
Step 1:The network configuration information of virtual machine is set on the dhcp server;
Step 2:Virtual machine carry network interface card is given in virtual machine host machine;
Step 3:Host sends network configuration event by serial communication to virtual machine;
Step 4:Virtual machine internal network configuration agency obtains network configuration event;
Step 5:Network configuration agency's adjustment network configuration is the automatic acquisition modes of DHCP, and DHCP service is obtained using DHCP protocol Network configuration information on device;
Step 6:Network configuration information is persisted in network profile, most the network of virtual machine is obtained automatically from DHCP at last The mode of taking becomes static network configuration.
2. method according to claim 1, it is characterised in that:Dynamic Host Configuration Protocol server network configuration information includes MAC Address, IP Address, gateway address, the network segment, domain name resolution server.
3. method according to claim 2, it is characterised in that:The virtual machine network interface card of described carry is consistent with MAC;It is described Virtual machine support network interface card hot plug mechanism.
4. the method according to any one of claims 1 to 3, it is characterised in that:Dhcp client is broadcasted using DHCP protocol Onto Dynamic Host Configuration Protocol server, network configuration information on Dynamic Host Configuration Protocol server is obtained.
5. the method according to any one of claims 1 to 3, it is characterised in that:Virtual machine internal network configuration agency is specific Step is:
(1) reliable and stable acquisition network configuration event;
(2) network configuration acts on behalf of running environment and supports cross-platform, including the operation of Windows, linux system;
(3) static network is set using DHCP protocol to set.
6. method according to claim 4, it is characterised in that:Virtual machine internal network configuration agency concretely comprise the following steps:
(1) reliable and stable acquisition network configuration event;
(2) network configuration acts on behalf of running environment and supports cross-platform, including the operation of Windows, linux system;
(3) static network is set using DHCP protocol to set.
7. method according to claim 5, it is characterised in that:Static network sets and concretely comprises the following steps:
(1) dhcp client is utilized, DHCP request is sent to Dynamic Host Configuration Protocol server, obtain corresponding network configuration information;
(2) after obtaining network configuration information, network configuration information is persisted to by network profile by network configurator In;
(3) network interface card is reloaded, static configuration is come into force.
8. method according to claim 6, it is characterised in that:Static network sets and concretely comprises the following steps:
(1) dhcp client is utilized, DHCP request is sent to Dynamic Host Configuration Protocol server, obtain corresponding network configuration information;
(2) after obtaining network configuration information, network configuration information is persisted to by network profile by network configurator In;
(3) network interface card is reloaded, static configuration is come into force.
CN201611003510.XA 2016-11-15 2016-11-15 The virtual machine static network method to set up communicated using serial ports and DHCP protocol Pending CN106790735A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611003510.XA CN106790735A (en) 2016-11-15 2016-11-15 The virtual machine static network method to set up communicated using serial ports and DHCP protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611003510.XA CN106790735A (en) 2016-11-15 2016-11-15 The virtual machine static network method to set up communicated using serial ports and DHCP protocol

Publications (1)

Publication Number Publication Date
CN106790735A true CN106790735A (en) 2017-05-31

Family

ID=58968699

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611003510.XA Pending CN106790735A (en) 2016-11-15 2016-11-15 The virtual machine static network method to set up communicated using serial ports and DHCP protocol

Country Status (1)

Country Link
CN (1) CN106790735A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107370622A (en) * 2017-07-14 2017-11-21 郑州云海信息技术有限公司 A kind of virtual machine multiplexing host MAC and IP method and system
CN108595248A (en) * 2018-04-24 2018-09-28 深信服科技股份有限公司 A kind of virtualization system communication means, device, equipment and virtualization system
CN109684035A (en) * 2018-12-17 2019-04-26 武汉烽火信息集成技术有限公司 A kind of adaptive virtual machine and host communication means and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102685267A (en) * 2012-05-16 2012-09-19 上海兆民云计算科技有限公司 IP (Internet Protocol) address leak preventing method in desktop cloud cluster running state
CN102710814A (en) * 2012-06-21 2012-10-03 奇智软件(北京)有限公司 Method and device for controlling Internet protocol (IP) address of virtual machine
CN103716416A (en) * 2012-09-29 2014-04-09 北京搜狐互联网信息服务有限公司 IP configuration method and apparatus under cloud computing platform
US20160134584A1 (en) * 2014-11-12 2016-05-12 International Business Machines Corporation Dynamically assigning network addresses

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102685267A (en) * 2012-05-16 2012-09-19 上海兆民云计算科技有限公司 IP (Internet Protocol) address leak preventing method in desktop cloud cluster running state
CN102710814A (en) * 2012-06-21 2012-10-03 奇智软件(北京)有限公司 Method and device for controlling Internet protocol (IP) address of virtual machine
CN103716416A (en) * 2012-09-29 2014-04-09 北京搜狐互联网信息服务有限公司 IP configuration method and apparatus under cloud computing platform
US20160134584A1 (en) * 2014-11-12 2016-05-12 International Business Machines Corporation Dynamically assigning network addresses

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
烂泥行天下: "自动获取IP,然后设置为静态IP", 《HTTPS://YQ.ALIYUN.COM/ARTICLES/42770》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107370622A (en) * 2017-07-14 2017-11-21 郑州云海信息技术有限公司 A kind of virtual machine multiplexing host MAC and IP method and system
CN107370622B (en) * 2017-07-14 2020-05-26 苏州浪潮智能科技有限公司 Method and system for multiplexing host machine MAC and IP by virtual machine
CN108595248A (en) * 2018-04-24 2018-09-28 深信服科技股份有限公司 A kind of virtualization system communication means, device, equipment and virtualization system
CN109684035A (en) * 2018-12-17 2019-04-26 武汉烽火信息集成技术有限公司 A kind of adaptive virtual machine and host communication means and system
CN109684035B (en) * 2018-12-17 2020-11-17 武汉烽火信息集成技术有限公司 Self-adaptive virtual machine and host machine communication method and system

Similar Documents

Publication Publication Date Title
US10116518B2 (en) Mechanism for management controllers to learn the control plane hierarchy in a data center environment
US9485147B2 (en) Method and device thereof for automatically finding and configuring virtual network
CN107070691B (en) Cross-host communication method and system of Docker container
US10341185B2 (en) Dynamic service insertion
US9219640B2 (en) Performing failover in a redundancy group
CN106412142B (en) Resource equipment address obtaining method and device
EP2362587B1 (en) Method and apparatus for realizing ARP request broadcasting limitation
US20080028071A1 (en) Communication load reducing method and computer system
EP3854064B1 (en) Unique identities of endpoints across layer 3 networks
US10917289B2 (en) Handling network failures in networks with redundant servers
US8478891B1 (en) Employing socket ranges to ascertain layer 2 addresses
CN109379291B (en) Method and device for processing service request in networking
US8868708B2 (en) Methods and devices for communicating diagnosis data in a real time communication network
EP3588859B1 (en) Network device configuration versioning
CN106790735A (en) The virtual machine static network method to set up communicated using serial ports and DHCP protocol
US9954730B2 (en) Method for delivering static route and ultimate provider edge
US20130254425A1 (en) Dns forwarder for multi-core platforms
US9426217B2 (en) Service node and inter-service node user protocol message synchronization method
CN110806946B (en) Detection method, detection device, server and storage medium
CN104618148A (en) Firewall device and backup method thereof
CN109842692B (en) VxLAN switch, system and method for obtaining host information in physical network
CN116170409A (en) SD-WAN network address planning system based on virtual domain name
Cisco Administering the Switch
US9912557B2 (en) Node information detection apparatus, node information detection method, and program
CN108259391B (en) Port configuration method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20170531

WD01 Invention patent application deemed withdrawn after publication