CN104270269A - Method for automatically configuring network cards - Google Patents

Method for automatically configuring network cards Download PDF

Info

Publication number
CN104270269A
CN104270269A CN201410508963.2A CN201410508963A CN104270269A CN 104270269 A CN104270269 A CN 104270269A CN 201410508963 A CN201410508963 A CN 201410508963A CN 104270269 A CN104270269 A CN 104270269A
Authority
CN
China
Prior art keywords
network interface
interface card
far
end computer
main control
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
CN201410508963.2A
Other languages
Chinese (zh)
Other versions
CN104270269B (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.)
Shenzhen Gongjin Electronics Co Ltd
Original Assignee
Shenzhen Gongjin Electronics 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 Shenzhen Gongjin Electronics Co Ltd filed Critical Shenzhen Gongjin Electronics Co Ltd
Priority to CN201410508963.2A priority Critical patent/CN104270269B/en
Publication of CN104270269A publication Critical patent/CN104270269A/en
Application granted granted Critical
Publication of CN104270269B publication Critical patent/CN104270269B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a method for automatically configuring network cards. The network cards of a master control end computer and the network cards of any far-end computer in network connection with the master control end computer are automatically configured through the method, wherein the far-end computer is internally provided with the known far-end monitoring network cards connected with the master control end computer, and after carrying out initialization by means of the OSSITE bank of the master control end computer and the far-end computer, the master control end computer reads names, MAC and IP/MASK of all the network cards of the master control end computer and the far-end computer and initializes all the network cards. In the automatic test process, automatic configuration is adopted for replacing tedious manual configuration of the network MAC, manual operation is replaced, and efficiency and reliability are improved.

Description

A kind of method of automatic configuration network interface card
Technical field
The present invention relates to the method for configuration network interface card automatically.
Background technology
In order to save manpower, time or hardware resource, raising testing efficiency, product test more and more introduces automatic test, and these test operational system or application program on a preset condition based, and object is assessment operation result.These tests are the processes artificial behavioral test driven being converted to machine execution.
At present; in network-termination device test process; usually multiple PC can be used or multiple network interface cards are tested; and in automatic test; first we need to carry out initialization to test environment, and initialization is exactly that variable is composed as default value, and control is set to default conditions; not having ready being ready to, initialization of the control required for global variable assignment, test, operating system, required network interface card etc.In automatic test, usually need the MAC of the test network interface card that will use to be set to global variable, also need to carry out initialization by the MAC Address of network interface card, but there is such problem, if numerous network interface card MAC manually fills in one by one, not only loaded down with trivial details, use inflexible, inefficiency, but also easily make mistakes.
In order to solve the problem in above-mentioned automatic test course, realizing network interface card and automatically configuring fast, reduce the problem of user's manual configuration, strengthen the reliability of configuration network interface card, devise the reliable method of a kind of automatic configuration network interface card MAC herein.
Summary of the invention
The object of this invention is to provide a kind of method of automatic configuration network interface card, the wired or wireless network card by a main control computer pair and the computer be on same network are installed in the method configures automatically.
Technical scheme of the present invention is: a kind of method of automatic configuration network interface card, the method configures main control end computer and network interface card on any far-end computer of being connected with this main control end computer network automatically, wherein, there is in far-end computer the known far-end be connected with main control end computer and monitor network interface card, it is characterized in that: comprise the following steps
The Operating System Site storehouse of step one, initialization main control end computer and all far-end computers;
Step 2, utilize Operation System Site storehouse keyword extraction to go out main control end computer respectively to throw the net title, MAC, IP/MASK information of card, confirm the monitoring network interface card of main control end computer according to IP/MASK; Described monitoring network interface card is that the far-end in main control end computer and far-end computer monitors the network interface card of network interface card at same local area network (LAN);
Step 3, main control end computer determine wired network adapter on main control end computer in other network interface cards and wireless network card by Wireless storehouse keyword;
Each network interface card of MAC initialization main control end computer of the main control end computer that step 4, basis get, and each network interface card MAC is set to global variable; Then in the monitoring network interface card of main control end computer, wired network adapter, wireless network card used the MAC of respective name variable and correspondence to be written to file that main control end PC specifies;
Step 5, utilize Operation System Site storehouse keyword extraction to go out title, MAC, IP/MASK information of the card of respectively throwing the net of far-end computer, and confirm the monitoring network interface card of far-end computer.
Step 6, Wireless storehouse keyword is utilized to monitor except far-end to remain wired network adapter in network interface card and wireless network card except network interface card to determine far-end PC;
Step 7, network interface card according to the MAC of far-end computer got initialization far-end PC one by one, then monitor network interface card, in wired network adapter, wireless network card use the MAC of respective name variable and correspondence to be appended to file that main control end computer specifies by the far-end of far-end computer.
Due to the name variable of network interface card and the MAC of correspondence are recorded in the file of specifying, avoid owing to filling in manually, not only loaded down with trivial details, use inflexible, inefficiency, but also the deficiency of easily makeing mistakes.
Optimal way of the present invention is: before step one, is that IP and MASK by inputting the far-end monitoring network interface card on far-end computer in main control computer realizes linking with far-end computer.In step 2, according to the IP/MASK information of each network interface card of main control end computer obtained, if to monitor the IP/MASK of network interface card identical with the far-end of input, then the network interface card of two identical IP/MASK is respectively monitoring network interface card and the far-end monitoring network interface card of main control end computer.The monitoring network interface card of main control end computer is according to returning IP/MASK information, IP/MASK in conjunction with input judges, if identical with the IP/MASK of input, then confirm the monitoring network interface card of main control end computer, far-end is monitored network interface card and is then determined according to the P/MASK of input.
Below in conjunction with specific embodiment, the present invention is described in more detail.
Accompanying drawing explanation
Fig. 1 is institute of the present invention applied environment schematic diagram.
Fig. 2 is flow chart of the present invention.
Fig. 3 is the flow chart that the embodiment of the present invention 1 is concrete.
Embodiment
Core concept of the present invention is: in automatic test, loaded down with trivial details manual configuration network interface card MAC is adopted configuration automatically, substitute manual operation, raise the efficiency and reliability.
This example with the automatic test networking of wireless product for accompanying drawing 1, automatic test program operates on main control end computer (main control end PC), far-end storehouse (test in order to coordinate main control end PC to carry out wireless product) operates on far-end computer (far-end PC), the network interface card M10X-MC of main control end PC is connected with the network interface card R20X-RC of far-end PC by switch, form the monitoring network interface card of main control end and far-end, realize linking between main control end PC with far-end PC, main control end PC like this can control the various operations of far-end PC.The workflow of the present embodiment, as shown in accompanying drawing 2, Fig. 3.Specifically comprise the steps:
Step 1, main control end PC bring into operation automatic test program time, eject input frame prompting user and input monitoring IP and the subnet mask of far-end PC, the IP of the R20X-RC network interface card namely in Fig. 1, this is known.Because the monitoring IP of far-end PC and subnet mask are known, therefore directly can input, IP can be monitored by this simultaneously and far-end PC is operated.
The Operating System Site storehouse of step 2, initialization main control end PC, then according to the Operating System Site storehouse of the monitoring IP initialization far-end PC of far-end PC.Operation System Site storehouse is the key word library in automatic test platform, mainly for the certain operations of system, system for computer information can be returned by this storehouse keyword, the title of each network interface card, MAC, IP/MASK etc. can be extracted from the information returned.
Step 3, inquire about with or without auto_mac.txt file here under the assigned catalogue (use variable $ { TEMPDIR} replacement) of main control end PC, if not, newly-built auto_mac.txt, and skip to step 4, if had, judge that whether this file is as empty, for sky then skips to step 4, from this file, then do not read MAC information for sky, and carry out initialization network interface card according to the MAC Address read; If (each network interface card initialization successfully represents that the MAC information that reads from this file and the network interface card MAC needed for actual test environment are one to one in network interface card all initialization successes, show that MAC Address configuration is correct) then read MAC Address is set to global variable after terminate, otherwise skip to step 4.
Step 4, use the keyword in Operating System storehouse can get the title of each network interface card of main control end PC, MAC, IP/MASK information, the IP/MASK of each network interface card of main control end PC is compared with the monitoring IP/MASK of far-end PC one by one, if with the monitoring IP of far-end PC at consolidated network, then can confirm the monitoring network interface card of main control end PC, the monitoring network interface card of main control end computer is according to returning IP/MASK information, IP/MASK in conjunction with input judges, if identical with the IP/MASK of input, then confirm the monitoring network interface card of main control end computer, far-end is monitored network interface card and is then determined according to the P/MASK of input.Utilize Wireless storehouse keyword to determine wired network adapter and the wireless network card of main control end PC.Judge that the reason of wired network adapter and wireless network card mainly contains 2 points, one is that different network interface cards will use different name variables, has some difference in addition at intiating radio network interface card and initializing cable network interface card.
Each network interface card MAC each network interface card of initialization one by one of the main control end PC that step 5, basis get, and the MAC of each network interface card of main control end PC is set to global variable, then use the MAC information of respective name variable and correspondence to be written to the $ of main control end PC { in the auto_mac.txt file under TEMPDIR} catalogue the monitoring network interface card of main control end PC, wired network adapter, wireless network card.
Being used by network interface card the MAC Address of different name variables and correspondence to write in the specified file of main control end PC is in order to follow-up test or next round test, as long as test environment is constant, just directly can read the MAC of each network interface card to carry out initialization and to be set to global variable from this file, so do not need to extract the information such as the MAC of network interface card, efficiency can be higher again.
Step 6, the title by each network interface card of the keyword acquisition far-end PC in Operating System storehouse, MAC, IP/MASK, determine the monitoring network interface card of far-end PC according to the IP/MASK of the R20X-RC network interface card of step 1 input.
Step 7, to determine far-end PC with Wireless storehouse keyword and remain wired network adapter in network interface card and wireless network card.
Step 8, network interface card according to the MAC of far-end PC got initialization far-end PC one by one, and the MAC of each network interface card of far-end PC is set to global variable, then use the MAC of respective name variable and correspondence to be appended to the $ of main control end PC { in the auto_mac.txt file under TEMPDIR} catalogue the monitoring network interface card of far-end PC, wired network adapter, wireless network card.The success of initialization each network interface card also just represent the MAC of card of respectively throwing the net obtain correct, network interface card is enabled normally, wireless network card and wired network adapter judgement are also correct.
Step 9, complete network interface card needed for automatic test MAC configuration.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.

Claims (4)

1. one kind configures the method for network interface card automatically, the method configures main control end computer and network interface card on any far-end computer of being connected with this main control end computer network automatically, wherein, there is in far-end computer the known far-end be connected with main control end computer and monitor network interface card, it is characterized in that: comprise the following steps
The Operating System Site storehouse of step one, initialization main control end computer and all far-end computers;
Step 2, utilize Operation System Site storehouse keyword extraction to go out main control end computer respectively to throw the net title, MAC, IP/MASK information of card, confirm the monitoring network interface card of main control end computer according to IP/MASK; Described monitoring network interface card is that the far-end in main control end computer and far-end computer monitors the network interface card of network interface card at same local area network (LAN);
Step 3, main control end computer determine wired network adapter on main control end computer in other network interface cards and wireless network card by Wireless storehouse keyword;
Step 4, utilize Operation System Site storehouse keyword extraction to go out main control end computer respectively to throw the net the title of card, the card of respectively throwing the net of MAC, IP/MASK information configuration main control end computer;
Step 5, utilize Operation System Site storehouse keyword extraction to go out title, MAC, IP/MASK information of the card of respectively throwing the net of far-end computer, and confirm the monitoring network interface card of far-end computer;
Step 6, Wireless storehouse keyword is utilized to monitor except far-end to remain wired network adapter in network interface card and wireless network card except network interface card to determine far-end PC;
Step 7, network interface card according to the MAC of far-end computer got initialization far-end PC one by one, then monitor network interface card, in wired network adapter, wireless network card use the MAC of respective name variable and correspondence to be appended to file that main control end computer specifies by the far-end of far-end computer.
2. the method for automatic configuration network interface card according to claim 1, it is characterized in that: in described step 2, according to the IP/MASK information of each network interface card of main control end computer obtained, if with the far-end of input, to monitor the IP/MASK of network interface card identical, then the network interface card of two identical IP/MASK is respectively monitoring network interface card and the far-end monitoring network interface card of main control end computer.
3. the method for automatic configuration network interface card according to claim 1, is characterized in that: before step one, is that IP and MASK by inputting the far-end monitoring network interface card on far-end computer in main control computer realizes linking with far-end computer.
4. the method for automatic configuration network interface card according to claim 1, is characterized in that: in described step 4, according to each each network interface card of MAC initialization main control end computer of the main control end computer got, and each network interface card MAC is set to global variable; Then in the monitoring network interface card of main control end computer, wired network adapter, wireless network card used the MAC of respective name variable and correspondence to be written to file that main control end PC specifies.
CN201410508963.2A 2014-09-28 2014-09-28 A kind of method for automatically configuring network interface card Expired - Fee Related CN104270269B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410508963.2A CN104270269B (en) 2014-09-28 2014-09-28 A kind of method for automatically configuring network interface card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410508963.2A CN104270269B (en) 2014-09-28 2014-09-28 A kind of method for automatically configuring network interface card

Publications (2)

Publication Number Publication Date
CN104270269A true CN104270269A (en) 2015-01-07
CN104270269B CN104270269B (en) 2017-07-04

Family

ID=52161763

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410508963.2A Expired - Fee Related CN104270269B (en) 2014-09-28 2014-09-28 A kind of method for automatically configuring network interface card

Country Status (1)

Country Link
CN (1) CN104270269B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106506714A (en) * 2016-09-30 2017-03-15 深圳市和芯润德科技有限公司 USB turns the collocation method of ethernet nic, the network equipment
CN107222357A (en) * 2017-08-03 2017-09-29 郑州云海信息技术有限公司 A kind of device and method for configuring network interface card
CN107592209A (en) * 2016-07-08 2018-01-16 北京奇虎科技有限公司 A kind of multi-network card server automatically configures the method and system of IP address information
CN110798346A (en) * 2019-10-25 2020-02-14 北京浪潮数据技术有限公司 Configuration method of newly added network card of Linux virtual machine and related components

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020108002A1 (en) * 1999-08-02 2002-08-08 Gordon W. Gifford Method for automatically configuring network interface card and capable of randomizing a media access controller address of the network interface card
CN1508675A (en) * 2002-12-18 2004-06-30 联想(北京)有限公司 Method for batch copying bare computer
CN101917281A (en) * 2010-06-10 2010-12-15 福建升腾资讯有限公司 Automatic collocation method for network cards
US8359380B2 (en) * 2009-08-31 2013-01-22 Red Hat Israel, Ltd. Configuring a host using configuration parameters of another host
CN103475704A (en) * 2013-09-06 2013-12-25 中国科学院计算技术研究所 Method for virtual node configuration for virtual cluster application
CN103685392A (en) * 2012-09-13 2014-03-26 北京大唐高鸿数据网络技术有限公司 Method for storing and distributing terminal configuration information in automatic configuration server

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020108002A1 (en) * 1999-08-02 2002-08-08 Gordon W. Gifford Method for automatically configuring network interface card and capable of randomizing a media access controller address of the network interface card
CN1508675A (en) * 2002-12-18 2004-06-30 联想(北京)有限公司 Method for batch copying bare computer
US8359380B2 (en) * 2009-08-31 2013-01-22 Red Hat Israel, Ltd. Configuring a host using configuration parameters of another host
CN101917281A (en) * 2010-06-10 2010-12-15 福建升腾资讯有限公司 Automatic collocation method for network cards
CN103685392A (en) * 2012-09-13 2014-03-26 北京大唐高鸿数据网络技术有限公司 Method for storing and distributing terminal configuration information in automatic configuration server
CN103475704A (en) * 2013-09-06 2013-12-25 中国科学院计算技术研究所 Method for virtual node configuration for virtual cluster application

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107592209A (en) * 2016-07-08 2018-01-16 北京奇虎科技有限公司 A kind of multi-network card server automatically configures the method and system of IP address information
CN107592209B (en) * 2016-07-08 2021-04-02 北京奇虎科技有限公司 Method and system for automatically configuring IP address information by multi-network card server
CN106506714A (en) * 2016-09-30 2017-03-15 深圳市和芯润德科技有限公司 USB turns the collocation method of ethernet nic, the network equipment
CN106506714B (en) * 2016-09-30 2019-12-17 深圳市和芯润德科技有限公司 Configuration method for USB-to-Ethernet network card and network equipment
CN107222357A (en) * 2017-08-03 2017-09-29 郑州云海信息技术有限公司 A kind of device and method for configuring network interface card
CN107222357B (en) * 2017-08-03 2021-02-09 苏州浪潮智能科技有限公司 Device and method for configuring network card
CN110798346A (en) * 2019-10-25 2020-02-14 北京浪潮数据技术有限公司 Configuration method of newly added network card of Linux virtual machine and related components
CN110798346B (en) * 2019-10-25 2022-11-04 北京浪潮数据技术有限公司 Configuration method of newly added network card of Linux virtual machine and related components

Also Published As

Publication number Publication date
CN104270269B (en) 2017-07-04

Similar Documents

Publication Publication Date Title
CN104978258B (en) Automatic software test method and system
CN111399873B (en) Model updating method and device
CN108959059B (en) Test method and test platform
CN106528395A (en) Test case generation method and apparatus
US20230388885A1 (en) Enhanced data analytics for actionable improvements based on data collected in wireless and streaming data networks
CN105095059B (en) A kind of method and apparatus of automatic test
CN104641673A (en) A method and a test system for automatically configuring a tester
CN105302716A (en) Method and apparatus for test in joint development mode
CN109656597A (en) Firmware upgrade method, device and computer readable storage medium
CN104270269A (en) Method for automatically configuring network cards
US20170359844A1 (en) Switching-on method, base station, base station controller, switching-on system and storage medium
CN103970566A (en) Router firmware updating method and device
CN110196804B (en) Service testing method and device, storage medium and electronic device
CN104270389A (en) Method and system for automatically restoring security configuration vulnerability of router/ interchanger
CN105787364A (en) Automated testing method, device and system for task
CN105446868A (en) System compatibility testing method, test case management method and related devices
CN104020763A (en) Automatic test method and system for input and output interfaces
CN106371881A (en) Method and system for updating program versions in servers
CN103973858A (en) Automatic testing system of mobile terminals
CN104536874A (en) Client collapse locating method and device
CN106776350A (en) The accurate method of testing and device of a kind of program
CN103559098B (en) Smart card test number control, Apparatus and system
CN107204898A (en) Production test method, system and the storage device of intelligent appliance, mobile terminal
CN105577879A (en) Address book management method and mobile terminal
CN104468288A (en) Terminal network data testing method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170704

CF01 Termination of patent right due to non-payment of annual fee