CN104601737A - Method for AP (Access Point) to acquire IP (Internet Protocol) addresses of clients - Google Patents

Method for AP (Access Point) to acquire IP (Internet Protocol) addresses of clients Download PDF

Info

Publication number
CN104601737A
CN104601737A CN201310534007.7A CN201310534007A CN104601737A CN 104601737 A CN104601737 A CN 104601737A CN 201310534007 A CN201310534007 A CN 201310534007A CN 104601737 A CN104601737 A CN 104601737A
Authority
CN
China
Prior art keywords
arp
address
mac address
tmp
list
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
CN201310534007.7A
Other languages
Chinese (zh)
Other versions
CN104601737B (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.)
Song Yixiao
Original Assignee
Shanghai Feixun Data Communication 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 Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201310534007.7A priority Critical patent/CN104601737B/en
Publication of CN104601737A publication Critical patent/CN104601737A/en
Application granted granted Critical
Publication of CN104601737B publication Critical patent/CN104601737B/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W80/00Wireless network protocols or protocol adaptations to wireless operation
    • H04W80/04Network layer protocols, e.g. mobile IP [Internet Protocol]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention provides a method for an AP (Access Point) to acquire the IP (Internet Protocol) addresses of clients. The method comprises the following steps: creating a /tmp/arp file folder for saving an ARP (Address Resolution Protocol) list of the clients, and simultaneously backing up a /tmp/arp file; reading the MAC (Media Access Control) addresses and the IP addresses of the ARP list in the /tmp/arp backup file, and judging whether a certain MAC address is included in a wireless MAC address list or not; if the certain MAC address is not included in the wireless MAC address list, not saving the certain MAC address and a certain IP address in the ARP list in the /tmp/arp file, and continuing to read a next MAC address and a next IP address; and if the certain MAC address is included in the wireless MAC address list, judging whether the certain MAC address is the same as an MAC address where a system log is extracted or not, and saving the MAC address where the system log is extracted and a corresponding IP address in the ARP list in the /tmp/arp file if the certain MAC address is the same as the MAC address where the system log is extracted. Under the situation that the AP and an uplink DHCP (Dynamic Host Configuration Protocol) server address pool are not on the same network segment, the ARP list created in a customized way is maintained, and the acquired IP address of each client is saved in the ARP list, so that the IP addresses of the clients linking to the AP can be acquired conveniently, and a series of management based on the IP addresses can be performed on the clients.

Description

AP obtains the method for client ip address
Technical field
The present invention relates to a kind of method obtaining client ip address, particularly relate to AP under the pattern of client and AP wireless connections and obtain the method for client ip address.
Background technology
AP is as bridge, for linking wireless client and upstream service device, when the IP address of AP and up Dynamic Host Configuration Protocol server address pool not at the same network segment, ARP(Address ResolutionProtocol, address resolution protocol, obtain an ICP/IP protocol of physical address) the bag network layer that can not enter AP processes, and AP will obtain less than the IP address being distributed to client by Dynamic Host Configuration Protocol server.Thus, the IP address of AP and up Dynamic Host Configuration Protocol server address pool will at the same network segments, and AP could obtain the IP address being connected to the client of AP in ARP list.And in actual application environment, the IP address of AP but through being everlasting the different network segments, can save the assignable IP address of Dynamic Host Configuration Protocol server from Dynamic Host Configuration Protocol server like this.
Thus, need to solve when AP and up Dynamic Host Configuration Protocol server address pool be not when the same network segment, AP can obtain the problem of the IP address being distributed to client by Dynamic Host Configuration Protocol server.
Summary of the invention
The technical problem that the present invention need solve be to provide a kind of IP address as AP and up Dynamic Host Configuration Protocol server address pool not when the same network segment AP obtain the method for client ip address.
For solving above-mentioned technical problem, the present invention devises a kind of method that AP obtains client ip address, and it comprises the following steps:
Step1: the ARP information obtaining AP system journal, then from ARP information, take out MAC Address and the IP address of client;
Step2: obtain the parameter information being connected to each client of AP from the wireless driving of AP, read the MAC Address of each client in described parameter information, and the MAC Address of each client is saved as wireless MAC address list;
The ARP list being connected to the client of upstream router by AP preserved by step3: establishment/tmp/arp file;
Step4: general/tmp/arp file copy is a, obtains a tmp/arp backup file, and to configure an initial value be the token variable of 0, meanwhile, general/tmp/arp file the clearing of ARP list information;
Step5: open/tmp/arp backup file, the MAC Address of the ARP list in reading/tmp/arp backup file and IP address, whether the MAC Address of the ARP list in judgement/tmp/arp backup file is included in described wireless MAC address list, if not, then this MAC Address and IP address are not saved in/tmp/arp file in ARP list in, continue ARP list in reading/tmp/arp backup file next MAC Address and IP address, if, whether the MAC Address of the ARP list in judgement/tmp/arp backup file is with identical from the MAC Address of the taking-up of system journal according to step1, if identical, then the IP address of the MAC Address of the taking-up from system journal and its correspondence be saved in/tmp/arp file in ARP list in, and the value of giving token variable is 1, if not identical, the MAC Address of the ARP list in/tmp/arp backup file and IP address be saved in/the ARP list of tmp/arp file in, continue ARP list in reading/tmp/arp backup file next MAC Address and IP address, the MAC Address of the ARP list one by one in reading/tmp/arp backup file and IP address, until ARP list content runs through in handle/tmp/arp backup file,
Step6: the value of judge mark variable, if the value of indexed variable is 0, then preserves the IP address of the MAC Address of the taking-up from system journal and its correspondence in the ARP list in/tmp/arp file.
Improve further as the present invention, before step1, also first the log information in AP system journal is filtered.
Improve further as the present invention, in step1, by " iwpriv rao show stainfo " order, from the wireless driving of AP, obtain the parameter information being connected to each client of AP.
When AP and up Dynamic Host Configuration Protocol server address pool not at the same network segment, the present invention is by safeguarding an ARP list of self-defined establishment, the IP address of each client got is preserved into ARP list, thus convenient acquisition is linked to the IP address of the client of AP, and then a series of IP address-based management is carried out to client.
Accompanying drawing explanation
Fig. 1 is the method flow diagram that AP of the present invention obtains client ip address.
Embodiment
Technical scheme of the present invention is understood better in order to make relevant technical staff in the field, below in conjunction with the accompanying drawing of embodiment of the present invention, technical scheme in embodiment of the present invention is clearly and completely described, obviously, described execution mode is only the present invention's part execution mode, instead of whole execution modes.
The invention provides a kind of AP and obtain the method for client ip address, when when AP and up Dynamic Host Configuration Protocol server address pool not at the same network segment, AP can obtain the IP address being distributed to the client being connected to AP by up Dynamic Host Configuration Protocol server.
As shown in Figure 1, the invention provides the method that AP obtains client ip address, comprise the following steps:
Step1: the ARP information obtaining AP system journal, then from ARP information, take out MAC Address and the IP address of client.Due to, the amount of information of AP system journal is larger, in order to can Obtaining Accurate to about the MAC Address of client and the information of IP address, the present invention also first filters the log information in AP system journal, and useless information filtering is fallen.
Step2: ordered by " iwpriv rao show stainfo ", the parameter information being connected to each client of AP is obtained from the wireless driving of AP, read the MAC Address of each client in described parameter information, and the MAC Address of each client is saved as wireless MAC address list.
The ARP list being connected to the client of upstream router by AP preserved by step3: establishment/tmp/arp file.Namely ARP list is used for preserving the MAC Address of client and IP address, by safeguard/upgrade should/the ARP list information of tmp/arp file, realize obtaining the IP address being linked to the client of AP.
Step4: the ARP list safeguarding tmp/arp file for convenience, first general/tmp/arp file copy is a, obtains a tmp/arp backup file, and to configure an initial value be the token variable of 0, meanwhile, the ARP list information clearing of general/tmp/arp file.Tmp/arp backup file is used as the comparison of later step and judgement, after judgement, the MAC Address and IP address information that need the client of preserving is preserved the ARP list after resetting in/tmp/arp file.
Step5: open/tmp/arp backup file, the MAC Address of the ARP list one by one in reading/tmp/arp backup file and IP address, whether the MAC Address of the ARP list in judgement/tmp/arp backup file is included in described wireless MAC address list.
If not, then this MAC Address and IP address are not saved in/tmp/arp file in ARP list in, this illustrates that this MAC Address is not included in described wireless MAC address list, client corresponding to this MAC Address leaves AP, thus, do not need the ARP list again in/tmp/arp file to preserve, should delete.Judged this information, continue ARP list in reading/tmp/arp backup file next MAC Address and IP address.
If so, then the MAC Address continuing the ARP list in judgement/tmp/arp backup file whether with identical from the MAC Address of the taking-up of system journal according to step1.
If identical, then the IP address of the MAC Address of the taking-up from system journal and its correspondence be saved in/tmp/arp file in ARP list in, and the value of giving token variable is 1.
If not identical, the MAC Address of the ARP list in/tmp/arp backup file and IP address be saved in/the ARP list of tmp/arp file in, continue ARP list in reading/tmp/arp backup file next MAC Address and IP address.
The MAC Address of the ARP list one by one in reading/tmp/arp backup file and IP address, cycle criterion, until ARP list content runs through in handle/tmp/arp backup file.
Step6: the value of judge mark variable, if the value of indexed variable is 0, then preserves the IP address of the MAC Address of the taking-up from system journal and its correspondence in the ARP list in/tmp/arp file.This illustrates that AP newly increases connection client, MAC Address and the IP address information of this client obtain from system journal, and/tmp/arp backup file and tmp/arp file ARP list also do not have, step6 then direct AP is newly increased the client of a connection this situation of client MAC Address and IP address preserve in the ARP list in/tmp/arp file.
When AP and up Dynamic Host Configuration Protocol server address pool not at the same network segment, the present invention is by safeguarding an ARP list of self-defined establishment, the IP address of each client got is preserved into ARP list, thus convenient acquisition is linked to the IP address of the client of AP, and then a series of IP address-based management is carried out to client.
Below only have expressed one embodiment of the present invention, it describes comparatively concrete and detailed, but therefore can not be interpreted as the restriction to the scope of the claims of the present invention.It should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection range of patent of the present invention should be as the criterion with claims.

Claims (3)

1. AP obtains a method for client ip address, it is characterized in that: comprise the following steps:
Step1: the ARP information obtaining AP system journal, then from ARP information, take out MAC Address and the IP address of client;
Step2: obtain the parameter information being connected to each client of AP from the wireless driving of AP, read the MAC Address of each client in described parameter information, and the MAC Address of each client is saved as wireless MAC address list;
The ARP list being connected to the client of upstream router by AP preserved by step3: establishment/tmp/arp file;
Step4: general/tmp/arp file copy is a, obtains a tmp/arp backup file, and to configure an initial value be the token variable of 0, meanwhile, general/tmp/arp file the clearing of ARP list information;
Step5: open/tmp/arp backup file, the MAC Address of the ARP list in reading/tmp/arp backup file and IP address, whether the MAC Address of the ARP list in judgement/tmp/arp backup file is included in described wireless MAC address list, if not, then this MAC Address and IP address are not saved in/tmp/arp file in ARP list in, continue ARP list in reading/tmp/arp backup file next MAC Address and IP address, if, whether the MAC Address of the ARP list in judgement/tmp/arp backup file is with identical from the MAC Address of the taking-up of system journal according to step1, if identical, then the IP address of the MAC Address of the taking-up from system journal and its correspondence be saved in/tmp/arp file in ARP list in, and the value of giving token variable is 1, if not identical, the MAC Address of the ARP list in/tmp/arp backup file and IP address be saved in/the ARP list of tmp/arp file in, continue ARP list in reading/tmp/arp backup file next MAC Address and IP address, the MAC Address of the ARP list one by one in reading/tmp/arp backup file and IP address, until ARP list content runs through in handle/tmp/arp backup file,
Step6: the value of judge mark variable, if the value of indexed variable is 0, then preserves the IP address of the MAC Address of the taking-up from system journal and its correspondence in the ARP list in/tmp/arp file.
2. AP obtains the method for client ip address according to claim 1, it is characterized in that: before step1, also first filters the log information in AP system journal.
3. AP obtains the method for client ip address according to claim 1, it is characterized in that: in step1, by " iwpriv rao show stainfo " order, obtains the parameter information being connected to each client of AP from the wireless driving of AP.
CN201310534007.7A 2013-10-31 2013-10-31 The method that AP obtains client ip address Active CN104601737B (en)

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 true CN104601737A (en) 2015-05-06
CN104601737B 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)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104869553A (en) * 2015-05-22 2015-08-26 上海斐讯数据通信技术有限公司 Electronic equipment discovery method and apparatus, and router
CN105227695A (en) * 2015-10-19 2016-01-06 深圳市华讯方舟科技有限公司 Access point based on multiple VLAN obtains method and the device of client mac address
CN105682140A (en) * 2015-12-31 2016-06-15 北京锐安科技有限公司 Uplink and downlink judgment and shunting method and system for mobile core network user data
CN106231002A (en) * 2016-07-22 2016-12-14 杭州华三通信技术有限公司 A kind of method and device safeguarding ARP table
CN106559284A (en) * 2016-03-22 2017-04-05 深圳Tcl新技术有限公司 The method and device of STA reception states is detected at AP ends
CN108092842A (en) * 2017-03-24 2018-05-29 深圳市必联电子有限公司 A kind of router production test method for burn-recording
CN112272179A (en) * 2020-10-23 2021-01-26 新华三信息安全技术有限公司 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)

* Cited by examiner, † Cited by third party
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
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

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104869553A (en) * 2015-05-22 2015-08-26 上海斐讯数据通信技术有限公司 Electronic equipment discovery method and apparatus, and router
CN105227695A (en) * 2015-10-19 2016-01-06 深圳市华讯方舟科技有限公司 Access point based on multiple VLAN obtains method and the device of client mac address
CN105227695B (en) * 2015-10-19 2018-07-17 华讯方舟科技有限公司 Access point based on multiple VLAN obtains the method and device of client mac address
CN105682140A (en) * 2015-12-31 2016-06-15 北京锐安科技有限公司 Uplink and downlink judgment and shunting method and system for mobile core network user data
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
CN108092842A (en) * 2017-03-24 2018-05-29 深圳市必联电子有限公司 A kind of router production test method for burn-recording
CN112272179A (en) * 2020-10-23 2021-01-26 新华三信息安全技术有限公司 Network security processing method, device, equipment and machine readable storage medium
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

Also Published As

Publication number Publication date
CN104601737B (en) 2018-05-01

Similar Documents

Publication Publication Date Title
CN104601737A (en) Method for AP (Access Point) to acquire IP (Internet Protocol) addresses of clients
CN110098948B (en) Automatic login of terminal device using device profile
EP2919500B1 (en) Method and apparatus for monitoring network device
US7969975B2 (en) Data collection from CPE devices on a remote LAN
US20150334089A1 (en) Managing mac moves with secure port groups
WO2011065708A3 (en) System and method for managing ipv6 address and access policy
EP2842285A1 (en) Migration of a security policy of a virtual machine
CN101098291B (en) Method for preventing disturbance of medium accessing control address table on access equipment
EP2928141A1 (en) Ipv6 address tracing method, device, and system
CN104507103A (en) Method for checking state of equipment connected below router
CN108737385A (en) A kind of malice domain name matching method mapping IP based on DNS
CN102868693A (en) URL (Uniform Resource Locator) filtering method and URL (Uniform Resource Locator) filtering system aiming at HTTP (Hyper Text Transport Protocol) segment request
CN103595825A (en) Domain name resolution detection method, domain name resolution detection device and server
CN102594834B (en) Method and device for defending network attack and network equipment
WO2014149671A3 (en) Gateway system and process for ip enabled devices
CN110099015B (en) Method executed by network switching equipment, network switching equipment and medium
DE602007006596D1 (en) WAP data extraction method using mobile identification numbers
CN105939241B (en) Connection disconnects method and device
CN104579979A (en) Network topology discovery method based on MAC information
CN102006290B (en) IP source address tracing method
CN107579988B (en) Method and device for configuring security policy
CN105279073A (en) Method and device for testing online system
CN105024989A (en) Malicious URL heuristic detection method and system based on abnormal port
KR102544733B1 (en) Internet reachability detection and internet high availability for multi-homed network devices
JP2005505975A (en) Subnet pooling

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
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.