CN116321325A - Method and device for switching management VLAN, electronic equipment and storage medium - Google Patents

Method and device for switching management VLAN, electronic equipment and storage medium Download PDF

Info

Publication number
CN116321325A
CN116321325A CN202310485411.3A CN202310485411A CN116321325A CN 116321325 A CN116321325 A CN 116321325A CN 202310485411 A CN202310485411 A CN 202310485411A CN 116321325 A CN116321325 A CN 116321325A
Authority
CN
China
Prior art keywords
dhcp
management vlan
fit
response message
sent
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310485411.3A
Other languages
Chinese (zh)
Inventor
单丽娜
黄翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies 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 New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN202310485411.3A priority Critical patent/CN116321325A/en
Publication of CN116321325A publication Critical patent/CN116321325A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/0005Control or signalling for completing the hand-off
    • H04W36/0011Control or signalling for completing the hand-off for data sessions of end-to-end connection
    • H04W36/0033Control or signalling for completing the hand-off for data sessions of end-to-end connection with transfer of context information
    • 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
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/14Reselecting a network or an air interface
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]

Landscapes

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

Abstract

The application provides a method, a device, electronic equipment and a storage medium for managing VLAN switching. The method is applied to the Fit AP, and comprises the following steps: when a first DHCP response message sent by a switching equipment DHCP server connected with the first management VLAN is received for the first time, a first management VLAN corresponding to an AP group to which the first management VLAN belongs is obtained from a designated option field in the first DHCP response message; and creating a first management VLAN, and switching the default management VLAN of the first management VLAN into the first management VLAN. The utility model can save labor cost.

Description

Method and device for switching management VLAN, electronic equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and apparatus for VLAN switching management, an electronic device, and a storage medium.
Background
Currently, in wireless local area networks (Wireless Local Area Network, WLAN), the Fit AP typically uses a managed virtual local area network (Virtual Local Area Network, VLAN) to establish a wireless access point control and provisioning (Controlling and Provisioning of Wireless Access Point, CAPWAP) tunnel with the AC and to communicate wirelessly based on the CAPWAP tunnel.
In practical applications, the management VLAN of the Fit AP needs to avoid a default management VLAN (typically VLAN 1) that is automatically created after the zero configuration of the Fit AP is started, which requires an administrator to manually modify the port-based VLAN identifier (Port VLAN Identifier, PVID) of the corresponding physical interface on the switch device connected to the Fit AP one by one, and switch the management VLAN of the Fit AP to non-VLAN 1 by modifying the PVID.
Because the switching mode needs to be manually participated, under the condition of large WLAN network scale, more labor cost is required to be consumed, and the problem of switching error easily occurs.
Disclosure of Invention
In order to overcome the problems in the related art, the application provides a method, a device, an electronic device and a storage medium for managing VLAN switching.
According to a first aspect of an embodiment of the present application, there is provided a method for managing VLAN switching, where the method is applied to a Fit AP, the method including:
when a first DHCP response message sent by a dynamic host configuration protocol (Dynamic Host Configuration Protocol, DHCP) server of a switching device connected with the switching device is received for the first time, a first management VLAN corresponding to an AP group to which the switching device belongs is obtained from a designated option field in the first DHCP response message;
Creating the first management VLAN, and switching the default management VLAN of the first management VLAN into the first management VLAN;
when the switching device receives a second DHCP response message which is sent by a DHCP server and is sent by the destination terminal to the Fit AP and carries PVID of the switching device, deleting the PVID carried in the second DHCP response message to obtain the first DHCP response message and then sending the first DHCP response message to the Fit AP;
when the second DHCP response message is a first DHCP request message which is sent by the switch device and has the first PVID at the source end, the second DHCP response message is a first management VLAN corresponding to the AP group to which the Fit AP belongs, and the second DHCP response message which has the IP address allocated by the DHCP server for the Fit AP and the first management VLAN is generated and sent to the switch device, wherein the first DHCP request message is sent by the DHCP server;
and when the switching equipment receives a second DHCP request message sent by the Fit AP, adding the PVID in the second DHCP request message to obtain the first DHCP request message, and then sending the first DHCP request message to the DHCP server.
According to a second aspect of embodiments of the present application, there is provided a method for managing VLAN switching, the method being applied to a DHCP server, the method including:
when a first DHCP request message which is sent by a switching device and has a source end of a Fit AP and carries PVID of the switching device is received for the first time, an unoccupied IP address is allocated for the Fit AP from an address pool corresponding to the PVID, and the first management VLAN corresponding to an AP group to which the Fit AP belongs is obtained;
generating a first DHCP response message carrying an IP address corresponding to the PVID and the first management VLAN, sending the first DHCP response message to the switching equipment, deleting the PVID carried in the first DHCP response message when the switching equipment receives the first DHCP response message to obtain a second DHCP response message, and sending the second DHCP response message to the Fit AP, so that the Fit AP obtains the first management VLAN from a designated option field in the second DHCP response message, creates the first management VLAN, and switches a default management VLAN of the switching equipment to the first management VLAN;
when the switching device receives a second DHCP request message sent by the Fit AP, the first DHCP request message is sent to the DHCP server after the PVID is added to the second DHCP request message to obtain the first DHCP request message.
According to a third aspect of embodiments of the present application, there is provided a management VLAN switching device, the device being applied to a Fit AP, the device including:
the acquisition module is used for acquiring a first management VLAN corresponding to an AP group to which the switching equipment is self from a designated option field in a first DHCP response message when the first DHCP response message sent by the switching equipment DHCP server connected with the switching equipment is received for the first time;
the switching module is used for creating the first management VLAN and switching the default management VLAN of the switching module into the first management VLAN;
when the switching device receives a second DHCP response message which is sent by a DHCP server and is sent by the destination terminal to the Fit AP and carries PVID of the switching device, deleting the PVID carried in the second DHCP response message to obtain the first DHCP response message and then sending the first DHCP response message to the Fit AP;
when the second DHCP response message is a first DHCP request message which is sent by the switch device and has the first PVID at the source end, the second DHCP response message is a first management VLAN corresponding to the AP group to which the Fit AP belongs, and the second DHCP response message which has the IP address allocated by the DHCP server for the Fit AP and the first management VLAN is generated and sent to the switch device, wherein the first DHCP request message is sent by the DHCP server;
And when the switching equipment receives a second DHCP request message sent by the Fit AP, adding the PVID in the second DHCP request message to obtain the first DHCP request message, and then sending the first DHCP request message to the DHCP server.
According to a fourth aspect of embodiments of the present application, there is provided a management VLAN switching device, the device being applied to a DHCP server, the device comprising:
an allocation obtaining module, configured to allocate an unoccupied IP address to a Fit AP from an address pool corresponding to a PVID when a first DHCP request packet sent by a switching device and having a source end of the Fit AP and carrying the PVID of the switching device is received for the first time, and obtain the first management VLAN corresponding to an AP group to which the Fit AP belongs;
a first generation and transmission module, configured to generate a first DHCP response message carrying an IP address corresponding to the PVID and the first management VLAN, and send the first DHCP response message to the switching device, so that when the switching device receives the first DHCP response message, the PVID carried in the first DHCP response message is deleted, a second DHCP response message is obtained, and the second DHCP response message is sent to the Fit AP, so that the Fit AP obtains the first management VLAN from a designated option field in the second DHCP response message, creates the first management VLAN, and switches a default management VLAN of the switching device to the first management VLAN;
When the switching device receives a second DHCP request message sent by the Fit AP, the first DHCP request message is sent to the DHCP server after the PVID is added to the second DHCP request message to obtain the first DHCP request message.
According to a fifth aspect of embodiments of the present application, there is provided an electronic device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: the method steps of any one of the management VLAN switching methods are realized.
According to a sixth aspect of embodiments of the present application, there is provided a computer readable storage medium having stored therein a computer program which, when executed by a processor, implements the method steps of any of the management VLAN switching methods described above.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects:
in the embodiment of the application, the Fit AP in the WLAN can actively acquire the management VLAN corresponding to the AP group to which the Fit AP belongs from the appointed option field in the DHCP response message, and the switching operation of creating and managing the VLAN is completed locally, so that the whole switching process of the management VLAN does not need to be manually participated, the labor cost is greatly saved, and the problem of switching errors does not occur.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic flow chart of a method for managing VLAN switching according to an embodiment of the present application;
FIG. 2 is a second flow chart of a method for managing VLAN switching according to the present embodiment;
fig. 3 is a schematic diagram of a network architecture of a WLAN network according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a management VLAN switching device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a management VLAN switching device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
The terminology used in the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first message may also be referred to as a second message, and similarly, a second message may also be referred to as a first message, without departing from the scope of the present application. The word "if" or "if" as used herein may be interpreted as "at … …" or "at … …", depending on the context.
Next, embodiments of the present application will be described in detail.
The embodiment of the application provides a method for managing VLAN switching, which is applied to a Fit AP, as shown in fig. 1, and may include the following steps:
S11, when a first DHCP response message sent by a switching device DHCP server connected with the switching device is received for the first time, a first management VLAN corresponding to an AP group to which the switching device belongs is obtained from a designated option field in the first DHCP response message.
In the step, when the switching device receives a second DHCP response message which is sent by the DHCP server and is carried with PVID of the switching device and is of which the destination end is a Fit AP, deleting PVID carried in the second DHCP response message to obtain the first DHCP response message and then sending the first DHCP response message to the Fit AP;
when the second DHCP response message is a first DHCP request message which is sent by the switching equipment and has the Fit AP at the source end and carries PVID, the second DHCP response message allocates an unoccupied IP address for the Fit AP from an address pool corresponding to the PVID, acquires a first management VLAN corresponding to an AP group to which the Fit AP belongs, generates a second DHCP response message carrying the IP address allocated by the DHCP server for the Fit AP and the first management VLAN, and sends the second DHCP response message to the switching equipment;
when the switching equipment receives a second DHCP request message sent by the Fit AP, the first DHCP request message is sent to the DHCP server after PVID is added in the second DHCP request message to obtain the first DHCP request message.
S12, creating a first management VLAN, and switching a default management VLAN of the first management VLAN into the first management VLAN.
In this step, the specific creation process of the first management VLAN by the Fit AP is similar to the creation process of the default management VLAN by the Fit AP, and will not be described in detail herein.
It should be noted that, in this embodiment of the present application, after zero configuration is started, as in the prior art, a default management VLAN (typically VLAN 1) is automatically created as the PVID of the Fit AP (i.e., the PVID of the physical interface (interface type is Trunk port) of the Fit AP connected to the switch device to which the Fit AP is connected), and then the Fit AP sends a DHCP request message that does not carry VLAN information to the switch device connected to the Fit AP.
Here, the client type (also referred to as DHCP client type) in the Option (Option) 60 field in the DHCP request message is a Fit AP.
When receiving the DHCP request message, the switching device finds that the DHCP request message does not carry VLAN information, adds the PVID of the switching device (i.e., the PVID of the physical interface connected to the Fit AP on the switching device) to the DHCP request message, and forwards the added DHCP request message to the DHCP server.
When the subsequent DHCP server receives the added DHCP request message for the first time, the client type in the Option60 field carried in the DHCP request message is found to be a Fit AP, then the DHCP server allocates an unoccupied IP address to the Fit AP from an address pool corresponding to PVID carried in the added DHCP request message, acquires a management VLAN corresponding to an AP group to which the Fit AP belongs, generates an IP address carrying the IP address allocated to the Fit AP by the DHCP server, and transmits the acquired management VLAN and a DHCP response message of the PVID to the switching equipment.
Here, for the client device with the client type of non-Fit AP, the DHCP server responds to the DHCP request message according to the existing response mode of the DHCP request message.
In one example, when acquiring the management VLAN corresponding to the AP group to which the Fit AP belongs, the DHCP server may acquire the management VLAN corresponding to the AP group to which the Fit AP belongs from management VLANs corresponding to all AP groups (each AP group includes MAC addresses of a plurality of Fit APs) bound by an address pool corresponding to the PVID carried in the DHCP request message.
In another example, when acquiring the management VLAN corresponding to the AP group to which the Fit AP belongs, the DHCP server may acquire the management VLAN corresponding to the AP group to which the Fit AP belongs from the locally stored management VLANs corresponding to all AP groups (each AP group includes MAC addresses of a plurality of Fit APs).
Of course, in the embodiment of the present application, the DHCP server may also acquire the management VLAN corresponding to the AP group to which the Fit AP belongs in other manners, which is not limited in the present application.
Furthermore, the obtained management VLAN may be located in the Option180 field in the DHCP response message.
And then, when the switching equipment receives the DHCP response message, deleting the PVID carried in the DHCP response message, and forwarding the deleted DHCP response message to the Fit AP.
When the Fit AP receives the deleted DHCP response message for the first time, the Fit AP acquires a management VLAN corresponding to the AP group to which the Fit AP belongs from a designated Option field (namely an Option180 field) in the deleted DHCP response message; and then, the Fit AP creates a first management VLAN, and switches the default management VLAN into the acquired management VLAN so as to save labor cost.
Further, in the embodiment of the present application, the Fit AP may further perform the following operations:
after switching the default management VLAN of the user into a first management VLAN, sending a third DHCP request message carrying the first management VLAN to a DHCP server through a switching device;
When a third DHCP response message aiming at a third DHCP request message and sent by a DHCP server is received through the switching equipment, an IP address allocated by the DHCP server for the self is obtained from the third DHCP response message, and a CAPWAP tunnel is established based on the obtained IP address and a target AC determined by the self;
when the third DHCP request message is received by the DHCP server, the third DHCP response message is sent to the Fit AP after an unoccupied IP address is allocated to the Fit AP from an address pool corresponding to the first management VLAN carried in the third DHCP request message.
By executing the above operation flow, it can be ensured that the Fit AP performs data communication in a new management VLAN, and the specific data communication process is the prior art and will not be described in detail herein.
It should be noted that, in this operation flow, the specific determining process for determining the target AC is a prior art for the Fit AP, which is not described in detail herein.
Still further, in the embodiment of the present application, the Fit AP may further perform the following operations:
when the lease time of the currently used IP address is reached, a DHCP offer request message carrying the currently used IP address and a management VLAN is sent to a DHCP server through a switching device;
When receiving a DHCP offer response message sent by a DHCP server through the switching equipment, if a designated option field in the DHCP offer response message carries a second management VLAN, creating the second management VLAN, and switching the own management VLAN into the second management VLAN;
the DHCP offer response message is an IP address carried in the DHCP offer response message and used by the Fit AP currently, and the DHCP server receives the DHCP offer request message and determines that the second management VLAN corresponding to the AP group to which the acquired Fit AP belongs is not generated and transmitted at the same time as the first management VLAN.
That is, the Fit AP may implement automatic switching of the management VLAN through the renewal process of the IP address.
After the Fit AP finishes executing the operation flow, the Fit AP still sends a fourth DHCP request message carrying a second management VLAN to a DHCP server through the switching equipment; when a fourth DHCP response message aiming at a fourth DHCP request message and sent by a DHCP server is received through the switching equipment, an IP address corresponding to the first management VLAN is obtained from the fourth DHCP response message, and a CAPWAP tunnel is established based on the obtained IP address and the currently accessed AC.
The above is the implementation procedure of the management VLAN switching method described by the station on the Fit AP side.
The following describes the implementation procedure of the management VLAN switching method at the DHCP server side.
The embodiment of the application also provides a method for managing VLAN switching, which is applied to a DHCP server, as shown in fig. 2, and may include the following steps:
s21, when a first DHCP request message which is sent by the switching equipment and contains PVID of the switching equipment at the source end is first received, an unoccupied IP address is allocated for the Fit AP from an address pool corresponding to the PVID, and a first management VLAN corresponding to an AP group to which the Fit AP belongs is obtained.
In this step, when the switching device receives the second DHCP request message sent by the Fit AP, the first DHCP request message is sent to the DHCP server after adding the PVID to the second DHCP request message to obtain the first DHCP request message.
S22, a first DHCP response message carrying an IP address corresponding to the PVID and a first management VLAN is generated, and the first DHCP response message is sent to the switching equipment, so that when the switching equipment receives the first DHCP response message, the PVID carried in the first DHCP response message is deleted, a second DHCP response message is obtained, the second DHCP response message is sent to the Fit AP, the Fit AP obtains the first management VLAN from a designated option field in the second DHCP response message, the first management VLAN is created, and the default management VLAN of the switching equipment is switched to the first management VLAN.
Further, in the embodiment of the present application, the DHCP server may further perform the following operations:
when a third DHCP request message which is sent by the switching equipment and comes from the Fit AP and carries a first management VLAN is received, an unoccupied IP address is allocated for the Fit AP from an IP address pool corresponding to the first management VLAN;
generating a third DHCP response message carrying the first management VLAN and an IP address allocated for the Fit AP by the Fit AP, sending the third DHCP response message to the switching equipment, enabling the switching equipment to forward the third DHCP response message to the Fit AP, acquiring the IP address corresponding to the first management VLAN from the third DHCP response message by the Fit AP, and establishing a CAPWAP tunnel based on the acquired IP address and a target AC determined by the Fit AP.
Still further, in the embodiment of the present application, the DHCP server may further perform the following operations:
when receiving a DHCP offer request message which is sent by the switching equipment and comes from the Fit AP and carries the IP address currently used by the Fit AP and the management VLAN, acquiring a second management VLAN corresponding to the AP group to which the Fit AP belongs;
if the second management VLAN is different from the management VLAN currently used by the Fit AP, a DHCP offer response message carrying the second management VLAN is generated, wherein the second management VLAN is carried in a designated option field in the DHCP offer response message;
And sending the DHCP renewal response message to the switching equipment so that the switching equipment forwards the DHCP renewal response message to the Fit AP, and when the Fit AP determines that the appointed option field in the DHCP renewal response message carries the second management VLAN, creating the second management VLAN and switching the self management VLAN into the second management VLAN.
It should be noted that, after the DHCP server obtains the second management VLAN corresponding to the AP group to which the Fit AP belongs, if the second management VLAN is the same as the management VLAN currently used by the Fit AP, the DHCP server still responds to the DHCP offer request message according to the existing response manner of the DHCP offer request message.
The above-mentioned management VLAN switching method is described in detail with reference to specific embodiments.
As shown in fig. 3, it is assumed that an AC, a switching device 1, a switching device 2, a switching device 3, a Fit AP1, a Fit AP2, a Fit AP3, and a Fit AP4 are included in a certain WLAN network. Wherein the switching device 1 is connected with the AC, and the switching device 1 acts as a DHCP server; the Fit AP1 and the Fit AP2 are respectively connected with the switching equipment 2; the Fit AP3 and the Fit AP4 are connected to the switching device, respectively.
Other network devices are also included in the WLAN network and are not listed here.
Taking the Fit AP1 as an example, after the zero configuration is started, the Fit AP1 automatically creates a default management VLAN (for example, VLAN 1) as the PVID of the Fit AP1 (i.e., the PVID of the physical interface (interface type is Trunk port) connected to the switching device 2 on the Fit AP 1), and then the Fit AP1 sends a DHCP request message 1 that does not carry VLAN information to the switching device 2. Here, the client type in the Option60 field in DHCP request message 1 is a Fit AP.
When receiving the DHCP request message 1, the switching device 2 discovers that the DHCP request message 1 does not carry VLAN information, adds the PVID of the switching device 2 (i.e., the PVID of the physical interface connected to the Fit AP1 on the switching device 2, for example, VLAN 20) to the DHCP request message 1, and forwards the added DHCP request message (denoted as DHCP request message 2) to the switching device 1.
When the subsequent switching device 1 receives the DHCP request message 2 for the first time, it finds that the client type in the Option60 field carried in the DHCP request message 2 is a Fit AP, and then, the switching device 1 allocates an unoccupied IP address (for example, IP address 1) to the Fit AP1 from an address pool corresponding to the PVID carried in the DHCP request message 1, obtains a management VLAN (for example, VLAN 10) corresponding to the AP group (for example, AP group 1) to which the Fit AP1 belongs, and generates a DHCP response message carrying the IP address 1, VLAN10 and VLAN20 and sends the DHCP response message to the switching device 2.
Here, when acquiring the first management VLAN corresponding to the AP group to which the Fit AP1 belongs, the switching device 1 may acquire the management VLAN corresponding to the AP group to which the Fit AP1 belongs from management VLANs corresponding to all AP groups (each AP group includes MAC addresses of a plurality of Fit APs) bound by the address pool corresponding to the PVID carried in the DHCP request message 2.
Next, when receiving the DHCP response message 1, the switching device 2 deletes the PVID carried in the DHCP response message, and forwards the deleted DHCP response message (denoted as DHCP response message 2) to the Fit AP1.
When receiving the DHCP response message 2 for the first time, the Fit AP1 obtains a management VLAN (i.e., VLAN 10) corresponding to the AP group to which it belongs from an Option180 field in the DHCP response message 2; fit AP1 then creates VLAN10 and switches its default management VLAN (i.e., VLAN 1) to VLAN10.
Afterwards, the Fit AP1 sends a DHCP request packet 3 carrying VLAN10 to the switching device 1 through the switching device 2;
when receiving the DHCP request message 3, the switching device 1 allocates an unoccupied IP address (denoted as IP address 2) from the IP address pool corresponding to the VLAN10 to the Fit AP1, generates a DHCP response message 3 carrying the IP address 2 and the VLAN10, and forwards the DHCP response message 3 to the Fit AP1 through the switching device 2.
When receiving the DHCP response message 3, the Fit AP1 acquires the IP address 2 from the DHCP response message 3, establishes a CAPWAP tunnel with the determined target AC based on the IP address 2, and uses the CAPWAP tunnel to perform data communication with the AC.
It is assumed that the lease time for IP address 2 has been reached, at this point, the Fit AP1 sends a DHCP renewal request message 1 carrying IP address 2 and VLAN10 to the switching device 1 via the switching device 2.
When receiving the DHCP offer request message 1, the switching device 1 acquires a management VLAN corresponding to the AP group to which the Fit AP1 belongs; assuming that the acquired management VLAN is VLAN30, the switch device 1 generates a DHCP offer response message 1 carrying VLAN30, and forwards the DHCP offer response message 1 to the Fit AP1 through the switch device 2, unlike the management VLAN currently used by the Fit AP1 (i.e., VLAN 10). Here, VLAN30 is still located in the Option180 field in DHCP offer response message 1.
When receiving the DHCP offer response message 1, the Fit AP1 finds that the Option180 field in the DHCP offer response message 1 carries the VLAN30, and at this time, the Fit AP1 creates the management VLAN30 and switches its own management VLAN from VLAN10 to VLAN30.
The Fit AP1 then sends a DHCP request message 4 carrying the VLAN30 to the switching device 1 via the switching device 2.
When receiving the DHCP request message 4, the switching device 1 allocates an unoccupied IP address (for example, IP address 3) to the Fit AP1 from the IP address pool corresponding to the VLAN30, generates a DHCP response message 4 carrying the VLAN30 and the IP address 3, and forwards the DHCP response message 4 to the Fit AP1 through the switching device 2.
When receiving the DHCP response message 4, the Fit AP1 acquires the IP address 4 from the DHCP response message 4, and establishes a CAPWAP tunnel with the AC based on the IP address 4.
According to the technical scheme, in the embodiment of the application, the Fit AP in the WLAN can actively acquire the management VLAN corresponding to the AP group to which the Fit AP belongs from the appointed option field in the DHCP response message, and the switching operation of creating and managing the VLAN is finished locally, so that the whole switching process of the management VLAN does not need to be manually participated, the labor cost is greatly saved, and the problem of switching errors is avoided.
Based on the same inventive concept, the present application further provides a VLAN management switching device, where the device is applied to a Fit AP, and the structural schematic diagram of the VLAN management device is shown in fig. 4, and specifically includes:
an obtaining module 41, configured to obtain, when a first DHCP response packet sent by a DHCP server of a switching device connected to the first management VLAN corresponding to an AP group to which the first management VLAN belongs from a designated option field in the first DHCP response packet is received for the first time;
A switching module 42, configured to create the first management VLAN and switch a default management VLAN of the switching module to the first management VLAN;
when the switching device receives a second DHCP response message which is sent by a DHCP server and is sent by the destination terminal to the Fit AP and carries PVID of the switching device, deleting the PVID carried in the second DHCP response message to obtain the first DHCP response message and then sending the first DHCP response message to the Fit AP;
when the second DHCP response message is a first DHCP request message which is sent by the switch device and has the first PVID at the source end, the second DHCP response message is a first management VLAN corresponding to the AP group to which the Fit AP belongs, and the second DHCP response message which has the IP address allocated by the DHCP server for the Fit AP and the first management VLAN is generated and sent to the switch device, wherein the first DHCP request message is sent by the DHCP server;
and when the switching equipment receives a second DHCP request message sent by the Fit AP, adding the PVID in the second DHCP request message to obtain the first DHCP request message, and then sending the first DHCP request message to the DHCP server.
Preferably, the apparatus further comprises:
a first processing module (not shown in fig. 4) configured to send, after switching its default management VLAN to the first management VLAN, a third DHCP request packet carrying the first management VLAN to the DHCP server through the switching device; and
when a third DHCP response message aiming at a third DHCP request message and sent by the DHCP server is received through the switching equipment, acquiring an IP address allocated by the DHCP server for the DHCP server from the third DHCP response message, and establishing a CAPWAP tunnel based on the acquired IP address and a target AC determined by the DHCP server;
when the third DHCP request message is received by the DHCP server, the third DHCP response message is sent after an unoccupied IP address is allocated to the Fit AP from an address pool corresponding to the first management VLAN carried in the third DHCP request message.
Preferably, the apparatus further comprises:
a second processing module (not shown in fig. 4) configured to send, to the DHCP server, a DHCP offer request message carrying the currently used IP address and the management VLAN through the switching device when reaching the lease time of the currently used IP address; and
When receiving a DHCP offer response message sent by the DHCP server through the switching equipment, if a second management VLAN is carried in the appointed option field in the DHCP offer response message, creating the second management VLAN, and switching the own management VLAN into the second management VLAN;
the DHCP offer response message is generated and sent by the DHCP server when the DHCP offer request message is received and it is determined that a second management VLAN corresponding to the AP group to which the acquired Fit AP belongs is different from the first management VLAN.
The application also provides a device for switching management VLANs, which is applied to a DHCP server, and the structure schematic diagram is shown in fig. 5, and specifically includes:
an allocation obtaining module 51, configured to allocate an unoccupied IP address to a Fit AP from an address pool corresponding to a PVID when a first DHCP request packet sent by a switching device and having a Fit AP as a source end and carrying the PVID of the switching device is received for the first time, and obtain the first management VLAN corresponding to an AP group to which the Fit AP belongs;
a first generation and sending module 52, configured to generate a first DHCP response packet carrying an IP address corresponding to the PVID and the first management VLAN, and send the first DHCP response packet to the switching device, so that when the switching device receives the first DHCP response packet, delete the PVID carried in the first DHCP response packet, obtain a second DHCP response packet, and send the second DHCP response packet to the Fit AP, so that the Fit AP obtains the first management VLAN from a specified option field in the second DHCP response packet, creates the first management VLAN, and switches a default management VLAN of the switching device to the first management VLAN;
When the switching device receives a second DHCP request message sent by the Fit AP, the first DHCP request message is sent to the DHCP server after the PVID is added to the second DHCP request message to obtain the first DHCP request message.
Preferably, the apparatus further comprises:
an allocation module (not shown in fig. 5), configured to allocate an unoccupied IP address to the Fit AP from an IP address pool corresponding to the first management VLAN when receiving a third DHCP request packet sent by the switching device and carrying the first management VLAN from the Fit AP;
a second generation and sending module (not shown in fig. 5) configured to generate a third DHCP response packet carrying the first management VLAN and an IP address allocated to the Fit AP by itself, and send the third DHCP response packet to the switching device, so that the switching device forwards the third DHCP response packet to the Fit AP, and the Fit AP obtains the IP address corresponding to the first management VLAN from the third DHCP response packet, and establishes a CAPWAP tunnel based on the obtained IP address and the target AC determined by itself.
Preferably, the apparatus further comprises:
An obtaining module (not shown in fig. 5), configured to obtain a second management VLAN corresponding to an AP group to which the Fit AP belongs when receiving a DHCP offer request packet sent by the switching device and coming from the Fit AP and carrying an IP address currently used by the Fit AP and the management VLAN;
a third generation and sending module (not shown in fig. 5) configured to generate a DHCP offer response message carrying the second management VLAN if the second management VLAN is different from a management VLAN currently used by the Fit AP, where the second management VLAN is carried in the specified option field in the DHCP offer response message; and
and sending the DHCP offer response message to the switching equipment, so that the switching equipment forwards the DHCP offer response message to the Fit AP, and when the Fit AP determines that the appointed option field in the DHCP offer response message carries the second management VLAN, the second management VLAN is created, and the self management VLAN is switched into the second management VLAN.
According to the technical scheme, in the embodiment of the application, the Fit AP in the WLAN can actively acquire the management VLAN corresponding to the AP group to which the Fit AP belongs from the appointed option field in the DHCP response message, and the switching operation of creating and managing the VLAN is finished locally, so that the whole switching process of the management VLAN does not need to be manually participated, the labor cost is greatly saved, and the problem of switching errors is avoided.
The present embodiment also provides an electronic device, as shown in fig. 6, including a processor 61 and a machine-readable storage medium 62, the machine-readable storage medium 62 storing machine-executable instructions executable by the processor 61, the processor 61 being caused by the machine-executable instructions to: implementing any one of the above management VLAN switching methods.
The machine-readable storage medium may include random access Memory (Random Access Memory, RAM) or Non-Volatile Memory (NVM), such as at least one magnetic disk Memory. In the alternative, the machine-readable storage medium may also be at least one memory device located remotely from the foregoing processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment provided herein, there is also provided a computer readable storage medium having stored therein a computer program which when executed by a processor implements the steps of any of the management VLAN switching methods described above.
The foregoing description of the preferred embodiments of the present invention is not intended to limit the invention to the precise form disclosed, and any modifications, equivalents, improvements and alternatives falling within the spirit and principles of the present invention are intended to be included within the scope of the present invention.

Claims (14)

1. A method for managing VLAN switching, wherein the method is applied to a Fit AP, the method comprising:
when a first DHCP response message sent by a switching equipment DHCP server connected with the first management VLAN is received for the first time, a first management VLAN corresponding to an AP group to which the first management VLAN belongs is obtained from a designated option field in the first DHCP response message;
creating the first management VLAN, and switching the default management VLAN of the first management VLAN into the first management VLAN;
when the switching device receives a second DHCP response message which is sent by a DHCP server and is sent by the destination terminal to the Fit AP and carries PVID of the switching device, deleting the PVID carried in the second DHCP response message to obtain the first DHCP response message and then sending the first DHCP response message to the Fit AP;
When the second DHCP response message is a first DHCP request message which is sent by the switch device and has the first PVID at the source end, the second DHCP response message is a first management VLAN corresponding to the AP group to which the Fit AP belongs, and the second DHCP response message which has the IP address allocated by the DHCP server for the Fit AP and the first management VLAN is generated and sent to the switch device, wherein the first DHCP request message is sent by the DHCP server;
and when the switching equipment receives a second DHCP request message sent by the Fit AP, adding the PVID in the second DHCP request message to obtain the first DHCP request message, and then sending the first DHCP request message to the DHCP server.
2. The method according to claim 1, wherein the method further comprises:
after switching the default management VLAN of the switch device to the first management VLAN, sending a third DHCP request message carrying the first management VLAN to the DHCP server through the switching device;
when a third DHCP response message aiming at a third DHCP request message and sent by the DHCP server is received through the switching equipment, acquiring an IP address allocated by the DHCP server for the DHCP server from the third DHCP response message, and establishing a CAPWAP tunnel based on the acquired IP address and a target AC determined by the DHCP server;
When the third DHCP request message is received by the DHCP server, the third DHCP response message is sent after an unoccupied IP address is allocated to the Fit AP from an address pool corresponding to the first management VLAN carried in the third DHCP request message.
3. The method according to claim 2, wherein the method further comprises:
when the lease time of the currently used IP address is reached, sending a DHCP offer request message carrying the currently used IP address and a management VLAN to the DHCP server through the switching equipment;
when receiving a DHCP offer response message sent by the DHCP server through the switching equipment, if a second management VLAN is carried in the appointed option field in the DHCP offer response message, creating the second management VLAN, and switching the own management VLAN into the second management VLAN;
the DHCP offer response message is generated and sent by the DHCP server when the DHCP offer request message is received and it is determined that a second management VLAN corresponding to the AP group to which the acquired Fit AP belongs is different from the first management VLAN.
4. A method for managing VLAN handoff, the method being applied to a DHCP server, the method comprising:
when a first DHCP request message which is sent by a switching device and has a source end of a Fit AP and carries PVID of the switching device is received for the first time, an unoccupied IP address is allocated for the Fit AP from an address pool corresponding to the PVID, and the first management VLAN corresponding to an AP group to which the Fit AP belongs is obtained;
generating a first DHCP response message carrying an IP address corresponding to the PVID and the first management VLAN, sending the first DHCP response message to the switching equipment, deleting the PVID carried in the first DHCP response message when the switching equipment receives the first DHCP response message to obtain a second DHCP response message, and sending the second DHCP response message to the Fit AP, so that the Fit AP obtains the first management VLAN from a designated option field in the second DHCP response message, creates the first management VLAN, and switches a default management VLAN of the switching equipment to the first management VLAN;
when the switching device receives a second DHCP request message sent by the Fit AP, the first DHCP request message is sent to the DHCP server after the PVID is added to the second DHCP request message to obtain the first DHCP request message.
5. The method according to claim 4, wherein the method further comprises:
when a third DHCP request message which is sent by the switching equipment and comes from the Fit AP and carries the first management VLAN is received, an unoccupied IP address is allocated for the Fit AP from an IP address pool corresponding to the first management VLAN;
generating a third DHCP response message carrying the first management VLAN and an IP address allocated for the Fit AP, and sending the third DHCP response message to the switching equipment, so that the switching equipment forwards the third DHCP response message to the Fit AP, the Fit AP acquires the IP address corresponding to the first management VLAN from the third DHCP response message, and establishes a CAPWAP tunnel based on the acquired IP address and a target AC determined by the Fit AP.
6. The method of claim 5, wherein the method further comprises:
when receiving a DHCP offer request message which is sent by the switching equipment and comes from the Fit AP and carries an IP address currently used by the Fit AP and a management VLAN, acquiring a second management VLAN corresponding to an AP group to which the Fit AP belongs;
If the second management VLAN is different from the management VLAN currently used by the Fit AP, a DHCP renewal response message carrying the second management VLAN is generated, wherein the second management VLAN is carried in the appointed option field in the DHCP renewal response message;
and sending the DHCP offer response message to the switching equipment, so that the switching equipment forwards the DHCP offer response message to the Fit AP, and when the Fit AP determines that the appointed option field in the DHCP offer response message carries the second management VLAN, the second management VLAN is created, and the self management VLAN is switched into the second management VLAN.
7. A management VLAN switching device, wherein the device is applied to a Fit AP, the device comprising:
the acquisition module is used for acquiring a first management VLAN corresponding to an AP group to which the switching equipment is self from a designated option field in a first DHCP response message when the first DHCP response message sent by the switching equipment DHCP server connected with the switching equipment is received for the first time;
the switching module is used for creating the first management VLAN and switching the default management VLAN of the switching module into the first management VLAN;
When the switching device receives a second DHCP response message which is sent by a DHCP server and is sent by the destination terminal to the Fit AP and carries PVID of the switching device, deleting the PVID carried in the second DHCP response message to obtain the first DHCP response message and then sending the first DHCP response message to the Fit AP;
when the second DHCP response message is a first DHCP request message which is sent by the switch device and has the first PVID at the source end, the second DHCP response message is a first management VLAN corresponding to the AP group to which the Fit AP belongs, and the second DHCP response message which has the IP address allocated by the DHCP server for the Fit AP and the first management VLAN is generated and sent to the switch device, wherein the first DHCP request message is sent by the DHCP server;
and when the switching equipment receives a second DHCP request message sent by the Fit AP, adding the PVID in the second DHCP request message to obtain the first DHCP request message, and then sending the first DHCP request message to the DHCP server.
8. The apparatus of claim 7, wherein the apparatus further comprises:
The first processing module is used for sending a third DHCP request message carrying the first management VLAN to the DHCP server through the switching equipment after switching the default management VLAN of the first processing module into the first management VLAN; and
when a third DHCP response message aiming at a third DHCP request message and sent by the DHCP server is received through the switching equipment, acquiring an IP address allocated by the DHCP server for the DHCP server from the third DHCP response message, and establishing a CAPWAP tunnel based on the acquired IP address and a target AC determined by the DHCP server;
when the third DHCP request message is received by the DHCP server, the third DHCP response message is sent after an unoccupied IP address is allocated to the Fit AP from an address pool corresponding to the first management VLAN carried in the third DHCP request message.
9. The apparatus of claim 8, wherein the apparatus further comprises:
the second processing module is used for sending a DHCP offer request message carrying the current IP address and the management VLAN to the DHCP server through the switching equipment when the lease time of the current IP address is reached; and
When receiving a DHCP offer response message sent by the DHCP server through the switching equipment, if a second management VLAN is carried in the appointed option field in the DHCP offer response message, creating the second management VLAN, and switching the own management VLAN into the second management VLAN;
the DHCP offer response message is generated and sent by the DHCP server when the DHCP offer request message is received and it is determined that a second management VLAN corresponding to the AP group to which the acquired Fit AP belongs is different from the first management VLAN.
10. A management VLAN switching device, the device being applied to a DHCP server, the device comprising:
an allocation obtaining module, configured to allocate an unoccupied IP address to a Fit AP from an address pool corresponding to a PVID when a first DHCP request packet sent by a switching device and having a source end of the Fit AP and carrying the PVID of the switching device is received for the first time, and obtain the first management VLAN corresponding to an AP group to which the Fit AP belongs;
a first generation and transmission module, configured to generate a first DHCP response message carrying an IP address corresponding to the PVID and the first management VLAN, and send the first DHCP response message to the switching device, so that when the switching device receives the first DHCP response message, the PVID carried in the first DHCP response message is deleted, a second DHCP response message is obtained, and the second DHCP response message is sent to the Fit AP, so that the Fit AP obtains the first management VLAN from a designated option field in the second DHCP response message, creates the first management VLAN, and switches a default management VLAN of the switching device to the first management VLAN;
When the switching device receives a second DHCP request message sent by the Fit AP, the first DHCP request message is sent to the DHCP server after the PVID is added to the second DHCP request message to obtain the first DHCP request message.
11. The apparatus of claim 10, wherein the apparatus further comprises:
the distribution module is used for distributing an unoccupied IP address for the Fit AP from an IP address pool corresponding to the first management VLAN when receiving a third DHCP request message which is sent by the switching equipment and comes from the Fit AP and carries the first management VLAN;
the second generation and sending module is configured to generate a third DHCP response message carrying the first management VLAN and an IP address allocated to the Fit AP by itself, and send the third DHCP response message to the switching device, so that the switching device forwards the third DHCP response message to the Fit AP, and the Fit AP obtains the IP address corresponding to the first management VLAN from the third DHCP response message, and establishes a CAPWAP tunnel based on the obtained IP address and the target AC determined by itself.
12. The apparatus of claim 11, wherein the apparatus further comprises:
the acquiring module is used for acquiring a second management VLAN corresponding to an AP group to which the Fit AP belongs when receiving a DHCP offer request message which is sent by the switching equipment, comes from the Fit AP and carries an IP address currently used by the Fit AP and the management VLAN;
a third generation and sending module, configured to generate a DHCP offer response message carrying the second management VLAN if the second management VLAN is different from a management VLAN currently used by the Fit AP, where the second management VLAN is carried in the specified option field in the DHCP offer response message; and
and sending the DHCP offer response message to the switching equipment, so that the switching equipment forwards the DHCP offer response message to the Fit AP, and when the Fit AP determines that the appointed option field in the DHCP offer response message carries the second management VLAN, the second management VLAN is created, and the self management VLAN is switched into the second management VLAN.
13. An electronic device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: method steps of implementing any of claims 1-3 or claims 4-6.
14. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-3 or claims 4-6.
CN202310485411.3A 2023-04-27 2023-04-27 Method and device for switching management VLAN, electronic equipment and storage medium Pending CN116321325A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310485411.3A CN116321325A (en) 2023-04-27 2023-04-27 Method and device for switching management VLAN, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310485411.3A CN116321325A (en) 2023-04-27 2023-04-27 Method and device for switching management VLAN, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116321325A true CN116321325A (en) 2023-06-23

Family

ID=86832672

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310485411.3A Pending CN116321325A (en) 2023-04-27 2023-04-27 Method and device for switching management VLAN, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116321325A (en)

Similar Documents

Publication Publication Date Title
US12004066B2 (en) Path, path information processing method and device, storage medium and electronic device
AU2019284169C1 (en) Network configuration method and communications apparatus
US20180262959A1 (en) Selection of anchor controllers for access points within a network environment
US11528225B2 (en) Communication method, session management device, and system for packet routing by access network devices belonging to a same network instance having different network addresses
EP3589037A1 (en) Method and user equipment for accessing network slices which are not mutually exclusive
CN102833721B (en) Wireless roaming data forwarding method and wireless access point
CN106255089B (en) A kind of method and apparatus of radio three layer roaming
CN103684966A (en) Method and device for processing dynamic host configuration protocol messages
CN101945374A (en) Network switching method, communication system and corresponding device
US20150365911A1 (en) System and method for a distributed wireless network
JP2007509566A (en) Handover method, handover apparatus, and information recording medium having instructions for performing the handover method under DHCPv4 environment
JP2018152691A (en) Control apparatus
EP3135071B1 (en) User anchor controller communication within a network environment
CN112243279B (en) Method, related device and system for realizing service continuity
CN107231449B (en) ARP request forwarding method and device and W L AN communication system
CN111163463A (en) Method, device, equipment and storage medium for accessing wireless equipment to router
CN115086946B (en) Communication method, system, wireless access device and access controller
CN116321325A (en) Method and device for switching management VLAN, electronic equipment and storage medium
JP2019514273A (en) Access method, apparatus, device and system
CN107666443B (en) Message forwarding method and device
CN113132326A (en) Access control method, device and system
WO2016145969A1 (en) Handover method and apparatus for mobile network
WO2023071634A1 (en) Communication method and apparatus
CN112383645A (en) ARP proxy method, equipment and device
CN115037609A (en) AP management method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination