CN106534401A - Method for transforming host storage network IP from dynamic state to static state - Google Patents

Method for transforming host storage network IP from dynamic state to static state Download PDF

Info

Publication number
CN106534401A
CN106534401A CN201611065811.5A CN201611065811A CN106534401A CN 106534401 A CN106534401 A CN 106534401A CN 201611065811 A CN201611065811 A CN 201611065811A CN 106534401 A CN106534401 A CN 106534401A
Authority
CN
China
Prior art keywords
network
static
address
host
dynamic
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.)
Granted
Application number
CN201611065811.5A
Other languages
Chinese (zh)
Other versions
CN106534401B (en
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.)
Zhongke Cloud Dongguan 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 CN201611065811.5A priority Critical patent/CN106534401B/en
Publication of CN106534401A publication Critical patent/CN106534401A/en
Application granted granted Critical
Publication of CN106534401B publication Critical patent/CN106534401B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2557Translation policies or rules
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to the technical field of cloud computing, and especially relates to a method for transforming a cloud computing automatic deployment host storage network IP from dynamic state to static state. The method comprises the following steps of: acquiring a dynamic IP address assigned by DHCP through a host storage network card; identifying the name of the host storage network card; acquiring dynamic IP address information of the storage network card; creating a static IP configuration file; and setting the address information of a static storage network to finally transform the storage network of a host to static network configuration. According to a setting method for transforming the dynamic IP of the cloud computing host storage network to the static network, the reliability and stability of the cloud computing automatic deployment host storage static network can be increased.

Description

A kind of host stores network IP dynamic conversions into static method
Technical field
The present invention relates to field of cloud computer technology, it is dynamic that particularly a kind of cloud computing automatic deployment host stores network IP The method for changing into static state.
Background technology
After field of cloud calculation host automatic deployment, dynamic IP changes into static network method to set up, most of at present It is the network information that dynamic network interface card is obtained using ifconfig orders, then obtains ip addresses, mask digit is covered calculating subnet The numerical value of code, finally by the edit commands of vim, is added manually in the middle of configuration file, then restarts network and come into force.For this The method of kind especially drawback, needs acquisition IP address information manually simultaneously to change corresponding network profile, compares in deployment node In the case of many, it may appear that a large amount of to repeat the manual confirmation network information and change the situation of configuration file, it is easy to configuration occur Mistake, causes network communication problem, so as to affect the speed of cloud computing automatic deployment host installation and deployment.And this method makes With effectively reducing configuration error appearance, or even occur without, while reducing the working time of configuration.
The content of the invention
Present invention solves the technical problem that being that a kind of cloud computing automatic deployment host storage network dynamic ip conversion is quiet The method of state ip, it is unstable to solve cloud computing automatic deployment host storage network dynamic IP, and manual modification is into fixed IP Easily there is configuration error, expend the problem of a large amount of configuration works.
The present invention solves the technical scheme of above-mentioned technical problem,
Described method comprises the steps:
Step 1:Host storage network interface card obtains DHCP dynamic IP addressings;
Step 2:Identification host storage network interface card title;
Step 3:Obtain storage network interface card dynamic IP addressing information;
Step 4:Create static ip address configuration file;
Step 5:Static storage network ip address is set;
Step 6:Network configuration information is persisted in network profile, most at last the network of host from DHCP from Dynamic acquisition modes become static network configuration.
Remote deployment host of the described method using PXE, and the specified network interface card acquisition storage network of host is set.
Described host storage network interface card obtains dynamic IP, is passed through in the middle of cloud computing host automatic deployment process DHCP modes are distributed the mode of IP address and obtain dynamic IP addressing information;
Described IP address information includes IP address, gateway address, the network segment, domain name resolution server.
Described establishment static ip address file, refers to according to network type, creates new by touch orders Ifcfg-* files.
Described static network configuration, after referring to acquisition network configuration information, by network configurator by network configuration Information is persisted in network profile;Network interface card is reloaded, static configuration is come into force.
The method that the method for the present invention combines the self-defined transmission of parameter and the identification of system network interface card, by the concrete network information Transmission, and the automatic decision of relevant network conditions carries out automatically conversion of the networking from dynamic IP to static network, effectively solves Certainly by the artificial acquisition network information and configuration file is set to it is easily configured mistake encountered in, it is in a large number numerous and diverse to match somebody with somebody Work is put, operating efficiency is realized that principle is simple, reliable, is easily integrated in cloud computing platform than relatively low problem.
Description of the drawings
The present invention is further described below in conjunction with the accompanying drawings:
Fig. 1 is the flow chart of the present invention.
Specific embodiment
According to flow process Fig. 1, the step of the present invention is:
(1) host storage network interface card obtains dhcp dynamic IP addressings
(2) recognize host storage network interface card title
Implement and can be found under/sys/class/net using all of network interface of linux lower networks, no matter Interface type.
The network interface card title recognized by following interception of commands operating system:
Ls/sys/class/net/ | grep e | awk ' NR==3 { print $ 1 } '
And pass to call by value parameter DHCP_CARD
(3) obtain storage network interface card dynamic IP addressing information
Implement the information that network interface card is obtained using linux lower network order ip addr:
ip addr|grep″dynamic$DHCP_CARD″
For example:
3:enpls0f1:<BROADCAST, MULTICAST, UP, LOWER_UP>mtu 1500
qdisc mq state UP qlen 1000
link/ether 00:a0:d1:eb:5e:65brd ff:ff:ff:ff:ff:ff
inet 192.168.2.43/24brd 192.168.2.255scope global enpls0f1
valid_lft forever preferred_lft forever
inet6fe80::2a0:dlff:feeb:5e65/64scope link
valid_lft forever preferred_lft forever
Then the IP address of current network node is:192.168.2.43/24
The IP address of network is obtained by the intercepting order of script again:
Ip addr | grep " dynamic $ DHCP_CARD " | awk ' { print $ 2 } ' | 1 subnet masks of cut-d "/"-f:
Ip addr | grep " dynamic $ DHCP_CARD " | awk ' { print $ 2 } ' | cut-d "/"-f2 gateways:
`echo$DHCP_IP|awk-F.′{print$1″f.″$2″.″$3}′`.254
(4) create static IP configuration file
Related file is created by touch orders
touch/etc/sysconfig/network-scripts/ifcfg-$DHCP_CARD
(5) static storage network ip address is set
The network schemer of conversion current configuration file:
sed-i′s/dhcp/static/g′$ETHCONF
Remove IPV6 settings, remove UUID
sed-i-e′s/∧UUID/#UUID/g′-e″s/∧IPV6INIT/#IPV6INIT/g″-e
″s/∧NETBOOT/#NETBOOT/g″$ETHCONF
Setting IP relevant informations are in the middle of current network configuration file:
echo-e
" IPADDR=$ DHCP_IP nNETMASK=255.255.255.0 nGATEWAY=`echo
$ DHCP_IP | awk-F. ' { 2 ". " 3 of print 1 ". " } ' ` .254 " > > ETHCONF.

Claims (7)

1. a kind of host stores network IP dynamic conversions into static method, it is characterised in that described method includes as follows Step:
Step 1:Host storage network interface card obtains DHCP dynamic IP addressings;
Step 2:Identification host storage network interface card title;
Step 3:Obtain storage network interface card dynamic IP addressing information;
Step 4:Create static ip address configuration file;
Step 5:Static storage network ip address is set;
Step 6:Network configuration information is persisted in network profile, most the network of host 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:Remote deployment host of the described method using PXE, and Arranging host specifies network interface card to obtain storage network.
3. method according to claim 1, it is characterised in that:
Described host storage network interface card obtains dynamic IP, is to pass through DHCP side in the middle of cloud computing host automatic deployment process The mode of formula distribution IP address obtains dynamic IP addressing information;
Described IP address information includes IP address, gateway address, the network segment, domain name resolution server.
4. method according to claim 2, it is characterised in that:
Described host storage network interface card obtains dynamic IP, is to pass through DHCP side in the middle of cloud computing host automatic deployment process The mode of formula distribution IP address obtains dynamic IP addressing information;
Described IP address information includes IP address, gateway address, the network segment, domain name resolution server.
5. the method according to any one of Claims 1-4, it is characterised in that:Described establishment static ip address file, refers to Be, according to network type, new ifcfg-* files to be created by touch orders.
6. the method according to any one of Claims 1-4, it is characterised in that:Described setting static network, refers to acquisition After network configuration information, network configuration information is persisted in network profile by network configurator;Reload Network interface card, static configuration is come into force.
7. method according to claim 5, it is characterised in that:Described static network configuration, refers to acquisition network configuration After information, network configuration information is persisted in network profile by network configurator;Network interface card is reloaded, will be quiet State configuration take-effective.
CN201611065811.5A 2016-11-28 2016-11-28 A kind of host storage network IP dynamic conversion is at static method Active CN106534401B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611065811.5A CN106534401B (en) 2016-11-28 2016-11-28 A kind of host storage network IP dynamic conversion is at static method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611065811.5A CN106534401B (en) 2016-11-28 2016-11-28 A kind of host storage network IP dynamic conversion is at static method

Publications (2)

Publication Number Publication Date
CN106534401A true CN106534401A (en) 2017-03-22
CN106534401B CN106534401B (en) 2019-11-15

Family

ID=58357712

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611065811.5A Active CN106534401B (en) 2016-11-28 2016-11-28 A kind of host storage network IP dynamic conversion is at static method

Country Status (1)

Country Link
CN (1) CN106534401B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113641364A (en) * 2021-07-27 2021-11-12 上海云轴信息科技有限公司 Method and system for deploying multi-node system of super-fusion cloud platform
CN114389949A (en) * 2022-01-20 2022-04-22 网宿科技股份有限公司 Route upgrading method, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101518022A (en) * 2006-09-20 2009-08-26 三星电子株式会社 Method and apparatus for configuring internet protocol address, information server, and information storage medium storing data format of message therefor
CN105426184A (en) * 2015-11-12 2016-03-23 浪潮电子信息产业股份有限公司 Method for setting static IP of Linux system of whole cabinet in batch
CN106131245A (en) * 2016-08-31 2016-11-16 迈普通信技术股份有限公司 The collocation method of a kind of AP, configuration service device, AP and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101518022A (en) * 2006-09-20 2009-08-26 三星电子株式会社 Method and apparatus for configuring internet protocol address, information server, and information storage medium storing data format of message therefor
CN105426184A (en) * 2015-11-12 2016-03-23 浪潮电子信息产业股份有限公司 Method for setting static IP of Linux system of whole cabinet in batch
CN106131245A (en) * 2016-08-31 2016-11-16 迈普通信技术股份有限公司 The collocation method of a kind of AP, configuration service device, AP and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HUOLARRY: "为Linux服务器设置静态IP的方法", 《URL: HTTP://WWW.CNBLOGS.COM/HUOLARRY/P/5343635.HTML》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113641364A (en) * 2021-07-27 2021-11-12 上海云轴信息科技有限公司 Method and system for deploying multi-node system of super-fusion cloud platform
CN114389949A (en) * 2022-01-20 2022-04-22 网宿科技股份有限公司 Route upgrading method, electronic equipment and storage medium
CN114389949B (en) * 2022-01-20 2024-04-12 网宿科技股份有限公司 Route upgrading method, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN106534401B (en) 2019-11-15

Similar Documents

Publication Publication Date Title
RU2417415C2 (en) Method and system for deploying software, software deployment server and user server
CN101232395B (en) Method for implementing network appliance to automatically collocation install
CN104767649A (en) Bare metal server deployment method and device
EP3245778B1 (en) Network device identification in an industrial control network
CN103812704A (en) Public network IP (Internet Protocol) dynamic management method for virtual machine
CN109067599B (en) Cluster deployment method and device
CN102523110A (en) Method and device for realizing automatic configuration of equipment with zero configuration
WO2006124809A2 (en) Dynamic hierarchical address resource management architecture, method and apparatus
CN104503802A (en) Server-side configuration method for unattended and remote installation operation system
US20120269091A1 (en) Auto-configuration of network devices
CN103957117A (en) System and method for achieving intelligent installation of network equipment
CN104935468A (en) PXE technology-based interactive system and method for realizing operation of operating system thereof
CN104104720A (en) Server cluster management method and system
CN105117293A (en) Windows system environment automatic deployment method and automatic deployment system
EP2580889B1 (en) Device commissioning and replacement
CN103777979A (en) Method and device for recovering BIOD through cloud end
CN101431523A (en) Method and micro-system for updating target system configuration in computer
CN106534401A (en) Method for transforming host storage network IP from dynamic state to static state
CN105359458A (en) Network device communication method and network device
CN105337754A (en) Method and system for opening data communication network (DCN)
CN111711698A (en) Intelligent equipment network access method and device and intelligent equipment control system and method
CN103581353A (en) Method and system of automatic configuration of gateway device
CN109413222B (en) Automatic batch order setting method and system for cloud terminals
EP2249247B1 (en) Data converting method, device, terminal and server
CN114089711B (en) Industrial equipment control management method, electronic equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 523808 19th Floor, Cloud Computing Center, Chinese Academy of Sciences, No. 1 Kehui Road, Songshan Lake Hi-tech Industrial Development Zone, Dongguan City, Guangdong Province

Applicant after: G-CLOUD TECHNOLOGY Co.,Ltd.

Address before: 523808 Guangdong province Dongguan City Songshan Lake Science and Technology Industrial Park Building No. 14 Keyuan pine

Applicant before: G-CLOUD TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230609

Address after: Room 303, Building 1, No.1 Kehui Road, Songshan Lake Park, Dongguan City, Guangdong Province, 523000

Patentee after: Zhongke Cloud (Dongguan) Technology Co.,Ltd.

Address before: 523808 19th floor, Cloud Computing Center, Chinese Academy of Sciences, No.1 Kehui Road, Songshanhu high tech Industrial Development Zone, Dongguan City, Guangdong Province

Patentee before: G-CLOUD TECHNOLOGY Co.,Ltd.