CN104601737B - The method that AP obtains client ip address - Google Patents
The method that AP obtains client ip address Download PDFInfo
- Publication number
- CN104601737B CN104601737B CN201310534007.7A CN201310534007A CN104601737B CN 104601737 B CN104601737 B CN 104601737B CN 201310534007 A CN201310534007 A CN 201310534007A CN 104601737 B CN104601737 B CN 104601737B
- Authority
- CN
- China
- Prior art keywords
- arp
- address
- tmp
- mac address
- files
- 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.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W80/00—Wireless network protocols or protocol adaptations to wireless operation
- H04W80/04—Network layer protocols, e.g. mobile IP [Internet Protocol]
Abstract
The present invention proposes a kind of method that AP obtains client ip address, and the method establishment/tmp/arp files preserve the ARP lists of client, while also backup/tmp/arp files;The MAC Address and IP address of ARP lists in reading/tmp/arp backup files, judge whether to be included in wireless MAC address list;If it is not, then this MAC Address and IP address are not saved in/tmp/arp files in ARP lists in, continue to read next;If so, judging whether identical with the MAC Address of the taking-up of system log, if identical, the MAC Address of the taking-up from system log and its corresponding IP address are saved in/tmp/arp files in ARP lists in.When AP and uplink Dynamic Host Configuration Protocol server address pool be not in the case of the same network segment, an ARP list of the invention by safeguarding self-defined establishment, the IP address of each client got is saved into ARP lists, so as to which convenient acquisition is linked to the IP address of the client of AP, and then a series of IP address-based management are carried out to client.
Description
Technical field
The present invention relates to a kind of method for obtaining client ip address, more particularly to the mould in client and AP wireless connections
The method that AP obtains client ip address under formula.
Background technology
AP is as bridge, for linking wireless client and upstream service device, when the IP address and uplink DHCP service of AP
Device address pool not in the case of the same network segment, ARP (Address Resolution Protocol, address resolution protocol,
An ICP/IP protocol for obtaining physical address) bag will not be handled into the network layer of AP, AP will obtain less than by
Dynamic Host Configuration Protocol server distributes to the IP address of client.Thus, the IP address and uplink Dynamic Host Configuration Protocol server address pool of AP will be same
A network segment, AP could obtain the IP address for the client for being connected to AP in ARP lists.And in actual application environment, the IP of AP
Address, but often in the different network segments, can so save the assignable IP address of Dynamic Host Configuration Protocol server from Dynamic Host Configuration Protocol server.
It is then desired to solve to work as AP and uplink Dynamic Host Configuration Protocol server address pool not in the case of the same network segment, AP can
The problem of IP address of client is distributed in acquisition by Dynamic Host Configuration Protocol server.
The content of the invention
The technical problem that the present invention need to solve is to provide a kind of IP address as AP and uplink Dynamic Host Configuration Protocol server address pool not
The method that AP obtains client ip address in the case of the same network segment.
To solve above-mentioned technical problem, the present invention devises a kind of method that AP obtains client ip address, it includes
Following steps:
step1:The ARP information of AP system logs is obtained, then the MAC Address and IP of client are taken out from ARP information
Location;
step2:The parameter information for each client for being connected to AP is obtained in the wireless driving of AP, reads the parameter
The MAC Address of each client in information, and the MAC Address of each client is saved as into wireless MAC address list;
step3:Establishment/tmp/arp files preserve the ARP lists for the client that upstream router is connected to by AP;
step4:General/tmp/arp files replicate portion, obtain a tmp/arp backups file, and configure an initial value
For 0 token variable, meanwhile, the ARP list informations of general/tmp/arp files are reset;
step5:Opening/tmp/arp backup files, the MAC Address of the ARP lists in reading/tmp/arp backup files and
Whether IP address, the MAC Address of the ARP lists in judgement/tmp/arp backup files are included in the wireless MAC address list
In;If it is not, then this MAC Address and IP address are not saved in/tmp/arp files in ARP lists in, continue to read/
The MAC Address and IP address of next of ARP lists in tmp/arp backup files;If so, in judgement/tmp/arp backup files
ARP lists MAC Address it is whether identical from the MAC Address of the taking-up of system log with according to step1, if identical,
Be saved in from the MAC Address of the taking-up of system log and its corresponding IP address/tmp/arp files in ARP lists in, and
The value for assigning token variable is 1, if it is not the same, the MAC Address and IP address of the ARP lists in handle/tmp/arp backup files
Be saved in/the ARP lists of tmp/arp files in, with continuing in reading/tmp/arp backup files the MAC of next of ARP lists
Location and IP address;The MAC Address and IP address of ARP lists in reading/tmp/arp backup files one by one, until handle/tmp/
Untill ARP list contents are run through in arp backup files;
step6:The value of judge mark variable, if the value of indexed variable is 0, the MAC of the taking-up from system log
Address and its corresponding IP address be saved into/tmp/arp files in ARP lists in.
Further improve as of the invention, before step1, also first the log information in AP system logs was carried out
Filter.
Further improved as of the invention, in step2, by the way that " iwpriv ra0show stainfo " are ordered, from AP
Wireless driving in obtain the parameter information of each client for being connected to AP.
When AP and uplink Dynamic Host Configuration Protocol server address pool be not in the case of the same network segment, the present invention is self-defined by safeguarding
The ARP list created, ARP lists are saved into by the IP address of each client got, so that convenient obtain link
A series of IP address-based management are carried out to the IP address of the client of AP, and then to client.
Brief description of the drawings
Fig. 1 is the method flow diagram that AP of the present invention obtains client ip address.
Embodiment
In order to make relevant technical staff in the field more fully understand technical scheme, below in conjunction with of the invention real
The attached drawing of mode is applied, the technical solution in embodiment of the present invention is clearly and completely described, it is clear that described reality
Apply mode only a part of embodiment of the present invention, rather than whole embodiments.
The present invention provides a kind of method that AP obtains client ip address, when AP and uplink Dynamic Host Configuration Protocol server address pool not
In the case of the same network segment, AP is with can obtaining IP that the client for being connected to AP is distributed to by uplink Dynamic Host Configuration Protocol server
Location.
As shown in Figure 1, the present invention provides the method that AP obtains client ip address, comprise the following steps:
step1:The ARP information of AP system logs is obtained, then the MAC Address and IP of client are taken out from ARP information
Location.Since the information content of AP system logs is bigger, in order to be accurately obtained MAC Address and IP address on client
Information, the present invention also first the log information in AP system logs is filtered, useless information filtering is fallen.
step2:By the way that " iwpriv ra0show stainfo " are ordered, and are obtained in the wireless driving of AP and are connected to AP's
The parameter information of each client, reads the MAC Address of each client in the parameter information, and by each client
MAC Address saves as wireless MAC address list.
step3:Establishment/tmp/arp files preserve the ARP lists for the client that upstream router is connected to by AP.
ARP lists are to be used for preserving the MAC Address and IP address of client, by maintenance/renewal should/the ARP lists of tmp/arp files
Information, realizes the IP address for obtaining the client for being linked to AP.
step4:For convenience of the ARP lists for safeguarding tmp/arp files, general/tmp/arp files first are replicated a, obtained
A tmp/arp backups file, and the token variable that an initial value is 0 is configured, meanwhile, the ARP row of general/tmp/arp files
Table information is reset.Tmp/arp backups file is used as the comparison and judgement of later step, the client for preserving needs after judgement
MAC Address and IP address information is saved into/tmp/arp files in reset after ARP lists.
step5:Opening/tmp/arp backup files, the one by one MAC of the ARP lists in reading/tmp/arp backup files
Whether location and IP address, the MAC Address of the ARP lists in judgement/tmp/arp backup files are included in the wireless MAC address
In list.
If it is not, then this MAC Address and IP address are not saved in/tmp/arp files in ARP lists in, this says
Bright this MAC Address is not comprised in the wireless MAC address list, and the corresponding client of the MAC Address has been moved off AP, because
And, it is not necessary to the ARP lists in/tmp/arp files again preserve, and should delete.Judged this information, continue read/
The MAC Address and IP address of next of ARP lists in tmp/arp backup files.
If so, the MAC Address for the ARP lists being further continued in judgement/tmp/arp backup files whether with according to step1
It is identical from the MAC Address of the taking-up of system log.
If identical, the MAC Address of the taking-up from system log and its corresponding IP address are saved in/tmp/
In ARP lists in arp files, and the value for assigning token variable is 1.
If it is not the same, the MAC Address and IP address of ARP lists in handle/tmp/arp backup files are saved in/tmp/
In the ARP lists of arp files, continue the MAC Address and IP address of next of ARP lists in reading/tmp/arp backup files.
The MAC Address and IP address of ARP lists in reading/tmp/arp backup files one by one, cycle criterion, until/
Untill ARP list contents are run through in tmp/arp backup files.
step6:The value of judge mark variable, if the value of indexed variable is 0, the MAC of the taking-up from system log
Address and its corresponding IP address be saved into/tmp/arp files in ARP lists in.This explanation AP newly increases connection one
Client, the MAC Address and IP address information of the client are obtained from system log, and/tmp/arp backups file and tmp/
Both arp files ARP lists do not have also, and AP is then directly newly increased the client of one client such case of connection by step6
MAC Address and IP address be saved into/tmp/arp files in ARP lists in.
When AP and uplink Dynamic Host Configuration Protocol server address pool be not in the case of the same network segment, the present invention is self-defined by safeguarding
The ARP list created, ARP lists are saved into by the IP address of each client got, so that convenient obtain link
A series of IP address-based management are carried out to the IP address of the client of AP, and then to client.
Only express one embodiment of the present invention above, its describe it is more specific and in detail, but can not therefore and
It is interpreted as the limitation to the scope of the claims of the present invention.It should be pointed out that for those of ordinary skill in the art, do not taking off
On the premise of present inventive concept, various modifications and improvements can be made, these belong to protection scope of the present invention.Cause
This, the protection domain of patent of the present invention should be determined by the appended claims.
Claims (3)
1. a kind of method that AP obtains client ip address, it is characterised in that:Comprise the following steps:
step1:The ARP information of AP system logs is obtained, then the MAC Address and IP address of client are taken out from ARP information;
step2:The parameter information for each client for being connected to AP is obtained in the wireless driving of AP, reads the parameter information
In each client MAC Address, and the MAC Address of each client is saved as into wireless MAC address list;
step3:Establishment/tmp/arp files preserve the ARP lists for the client that upstream router is connected to by AP;
step4:General/tmp/arp files replicate portion, obtain a tmp/arp backups file, and it is 0 to configure an initial value
Token variable, meanwhile, the ARP list informations of general/tmp/arp files are reset;
step5:Opening/tmp/arp backup files, the MAC Address and IP of the ARP lists in reading/tmp/arp backup files
Whether location, the MAC Address of the ARP lists in judgement/tmp/arp backup files are included in the wireless MAC address list;Such as
Fruit is no, then this MAC Address and IP address are not saved in/tmp/arp files in ARP lists in, continue reading/tmp/
The MAC Address and IP address of next of ARP lists in arp backup files;If so, in judgement/tmp/arp backup files
Whether the MAC Address of ARP lists identical from the MAC Address of the taking-up of system log with according to step1, if identical, from
The MAC Address of the taking-up of system log and its corresponding IP address be saved in/tmp/arp files in ARP lists in, and assign
The value for giving token variable is 1, if it is not the same, the MAC Address of the ARP lists in handle/tmp/arp backup files and IP address are protected
Be stored to/the ARP lists of tmp/arp files in, continue the MAC Address of next of ARP lists in reading/tmp/arp backup files
And IP address;The MAC Address and IP address of ARP lists in reading/tmp/arp backup files one by one, until handle/tmp/arp
Untill ARP list contents are run through in backup file;
step6:The value of judge mark variable, if the value of indexed variable is 0, the MAC Address of the taking-up from system log
And its corresponding IP address be saved into/tmp/arp files in ARP lists in.
2. the method that AP obtains client ip address according to claim 1, it is characterised in that:It is also first right before step1
Log information in AP system logs is filtered.
3. the method that AP obtains client ip address according to claim 1, it is characterised in that:In step2, pass through
" iwpriv ra0show stainfo " are ordered, and the parameter letter for each client for being connected to AP is obtained in the wireless driving of AP
Breath.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310534007.7A CN104601737B (en) | 2013-10-31 | 2013-10-31 | The method that AP obtains client ip address |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310534007.7A CN104601737B (en) | 2013-10-31 | 2013-10-31 | The method that AP obtains client ip address |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104601737A CN104601737A (en) | 2015-05-06 |
CN104601737B true CN104601737B (en) | 2018-05-01 |
Family
ID=53127229
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310534007.7A Active CN104601737B (en) | 2013-10-31 | 2013-10-31 | The method that AP obtains client ip address |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104601737B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104869553A (en) * | 2015-05-22 | 2015-08-26 | 上海斐讯数据通信技术有限公司 | Electronic equipment discovery method and apparatus, and router |
CN105227695B (en) * | 2015-10-19 | 2018-07-17 | 华讯方舟科技有限公司 | Access point based on multiple VLAN obtains the method and device of client mac address |
CN105682140B (en) * | 2015-12-31 | 2019-10-18 | 北京锐安科技有限公司 | The uplink and downlink judgement of mobile core network user data and shunt method and system |
CN106559284A (en) * | 2016-03-22 | 2017-04-05 | 深圳Tcl新技术有限公司 | The method and device of STA reception states is detected at AP ends |
CN106231002A (en) * | 2016-07-22 | 2016-12-14 | 杭州华三通信技术有限公司 | A kind of method and device safeguarding ARP table |
CN108092842B (en) * | 2017-03-24 | 2020-10-16 | 深圳市必联电子有限公司 | Router production test burning method |
CN112272179B (en) * | 2020-10-23 | 2022-02-22 | 新华三信息安全技术有限公司 | Network security processing method, device, equipment and machine readable storage medium |
CN115002071A (en) * | 2022-05-25 | 2022-09-02 | 深信服科技股份有限公司 | Information updating method, device, equipment and readable storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101119371A (en) * | 2007-08-28 | 2008-02-06 | 杭州华三通信技术有限公司 | Method, client terminal, server and system for preventing network attack using ARP |
CN101179566A (en) * | 2007-11-24 | 2008-05-14 | 华为技术有限公司 | Method and apparatus for preventing ARP packet attack |
CN101262505A (en) * | 2008-04-22 | 2008-09-10 | 杭州华三通信技术有限公司 | A method, system and device for establishing ARP table items |
CN101835145A (en) * | 2010-03-30 | 2010-09-15 | 北京傲天动联技术有限公司 | User information management method based on thin AP |
CN102710439A (en) * | 2012-05-29 | 2012-10-03 | 南京邮电大学 | Obtaining method of user terminal parameter information |
-
2013
- 2013-10-31 CN CN201310534007.7A patent/CN104601737B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101119371A (en) * | 2007-08-28 | 2008-02-06 | 杭州华三通信技术有限公司 | Method, client terminal, server and system for preventing network attack using ARP |
CN101179566A (en) * | 2007-11-24 | 2008-05-14 | 华为技术有限公司 | Method and apparatus for preventing ARP packet attack |
CN101262505A (en) * | 2008-04-22 | 2008-09-10 | 杭州华三通信技术有限公司 | A method, system and device for establishing ARP table items |
CN101835145A (en) * | 2010-03-30 | 2010-09-15 | 北京傲天动联技术有限公司 | User information management method based on thin AP |
CN102710439A (en) * | 2012-05-29 | 2012-10-03 | 南京邮电大学 | Obtaining method of user terminal parameter information |
Also Published As
Publication number | Publication date |
---|---|
CN104601737A (en) | 2015-05-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104601737B (en) | The method that AP obtains client ip address | |
CN101098291B (en) | Method for preventing disturbance of medium accessing control address table on access equipment | |
CN103718527B (en) | Communication security processing method, apparatus and system | |
US20070255832A1 (en) | Method for configuring a windfarm network | |
CN105490931A (en) | FPGA-based multifunctional Internet-of-things gateway device | |
CN102868693A (en) | URL (Uniform Resource Locator) filtering method and URL (Uniform Resource Locator) filtering system aiming at HTTP (Hyper Text Transport Protocol) segment request | |
CN103475526A (en) | IP setting and detecting method supporting multi-VLAN virtual machine | |
CN108737385A (en) | A kind of malice domain name matching method mapping IP based on DNS | |
CN104702623B (en) | IP blockage method and system | |
CN105049546B (en) | A kind of Dynamic Host Configuration Protocol server is the method and device of client distribution IP address | |
CN105939241B (en) | Connection disconnects method and device | |
CN106909828A (en) | Based on cloud desktop USB device filter method | |
CN112910854B (en) | Method and device for safe operation and maintenance of Internet of things, terminal equipment and storage medium | |
EP2637357B1 (en) | Validating reachability of nodes of a network of an industrial automation and control system | |
CN107547676B (en) | Address processing method and device | |
CN105279073A (en) | Method and device for testing online system | |
CN110661903B (en) | Cloud platform route management method and device | |
EP3490227B1 (en) | Internet reachability detection and internet high availability for multi-homed network devices | |
CN106201834A (en) | A kind for the treatment of method and apparatus of disk failures | |
CN106559503A (en) | A kind of communication means and device based on Internet of Things | |
CN107800810A (en) | A kind of Server remote control method and system | |
CN108366120A (en) | A kind of internet-of-things terminal management method and device | |
CN105577464A (en) | Dual stack user network detection method, apparatus and system thereof | |
CN106411603A (en) | Intranet network topology structure automatic discovery realization method | |
CN102638365B (en) | A kind of implementation method of webmaster magnanimity automatic device discovery |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
EXSB | Decision made by sipo to initiate substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20201113 Address after: 221700 4-1-110-shop, Nanyuan new town, Fengxian County, Xuzhou City, Jiangsu Province Patentee after: Song Yixiao Address before: 201616 Shanghai city Songjiang District Guangfulin Road No. 4855 Building No. 90 big industry territory Patentee before: Phicomm (Shanghai) Co.,Ltd. |
|
TR01 | Transfer of patent right |