CN112235175B - Access method and access device of network bridge equipment and network bridge equipment - Google Patents

Access method and access device of network bridge equipment and network bridge equipment Download PDF

Info

Publication number
CN112235175B
CN112235175B CN202010904105.5A CN202010904105A CN112235175B CN 112235175 B CN112235175 B CN 112235175B CN 202010904105 A CN202010904105 A CN 202010904105A CN 112235175 B CN112235175 B CN 112235175B
Authority
CN
China
Prior art keywords
address
target
message
bridge device
destination
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
Application number
CN202010904105.5A
Other languages
Chinese (zh)
Other versions
CN112235175A (en
Inventor
伍国祥
董浩
付云龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Gongjin Electronics Co Ltd
Original Assignee
Shenzhen Gongjin Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Gongjin Electronics Co Ltd filed Critical Shenzhen Gongjin Electronics Co Ltd
Priority to CN202010904105.5A priority Critical patent/CN112235175B/en
Publication of CN112235175A publication Critical patent/CN112235175A/en
Application granted granted Critical
Publication of CN112235175B publication Critical patent/CN112235175B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4604LAN interconnection over a backbone network, e.g. Internet, Frame Relay
    • H04L12/462LAN interconnection over a bridge based backbone
    • H04L12/4625Single bridge functionality, e.g. connection of two networks over a single bridge
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Landscapes

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

Abstract

The application is applicable to the technical field of communication, and provides an access method, an access device, a network bridge device and a computer readable storage medium for network bridge device, wherein the method comprises the following steps: if a target message sent by terminal equipment is received, modifying the target MAC address of the target message into the MAC address of the network bridge equipment, wherein the target IP address of the target message is the fixed IP address of the network bridge equipment; processing the target message to obtain a response message of the target message; and sending the response message to the terminal equipment. By the method, the mode of accessing the network bridge equipment by the terminal equipment can be simplified, and convenience is brought to users.

Description

Access method and access device of network bridge equipment and network bridge equipment
Technical Field
The present application belongs to the field of communications technologies, and in particular, to an access method and an access apparatus for a network bridge device, and a computer-readable storage medium.
Background
The network bridge device is a two-layer network device at least including two ports, can implement the functions of storing and forwarding, and can be used to connect different network segments, for example, two local area networks. Because the network bridge device hangs down the terminal device obtains the Internet Protocol (IP) address through the server, if the user wants to access the network bridge device through the terminal device, the user needs to manually modify the IP address of the terminal device, so that the IP address of the terminal device and the IP address of the network bridge device belong to the same network segment.
In the related art, the access mode of the network bridge device is very complicated, which brings inconvenience to users.
Disclosure of Invention
In view of this, the present application provides an access method, an access apparatus, a bridge device and a computer-readable storage medium for a bridge device, which can simplify a manner for a terminal device to access the bridge device and bring convenience to a user.
In a first aspect, the present application provides an access method for a bridge device, including:
if a target message sent by a terminal device is received, modifying a Media Access Control Address (MAC) of the target message into an MAC Address of the bridge device, wherein a target IP Address of the target message is a fixed IP Address of the bridge device;
processing the target message to obtain a response message of the target message;
and sending the response message to the terminal equipment.
In a second aspect, the present application provides an access apparatus for a bridge device, including:
an address modification unit, configured to modify a destination MAC address of a target packet into an MAC address of the bridge device if the target packet sent by a terminal device is received, where a destination IP address of the target packet is a fixed IP address of the bridge device;
a message processing unit, configured to process the target message to obtain a response message of the target message;
and the message sending unit is used for sending the response message to the terminal equipment.
In a third aspect, the present application provides a bridge device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method provided in the first aspect when executing the computer program.
In a fourth aspect, the present application provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the method as provided in the first aspect.
In a fifth aspect, the present application provides a computer program product, which, when run on a bridge device, causes the bridge device to perform the method provided by the first aspect described above.
As can be seen from the above, in the present application, if a target message sent by a terminal device is received, a destination MAC address of the target message is modified to an MAC address of the bridge device, where the destination IP address of the target message is a fixed IP address of the bridge device, then the target message is processed to obtain a response message of the target message, and finally the response message is sent to the terminal device. According to the scheme, when the network bridge equipment receives the target message sent by the terminal equipment, the target MAC address of the target message is modified into the MAC address of the network bridge equipment, so that the target message is redirected to the network bridge equipment, the network bridge equipment processes the target message, the mode that the terminal equipment accesses the network bridge equipment can be simplified, and convenience is brought to users.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a topology diagram of a terminal device, a bridge device, and a server according to an embodiment of the present application;
fig. 2 is a flowchart illustrating an access method of a bridge device according to an embodiment of the present application;
fig. 3 is an interaction flowchart of a terminal device, a network bridge device and a server according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an access device of a bridge device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a bridge device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
For ease of understanding, referring to fig. 1, fig. 1 shows a connection relationship between a terminal device, a bridge device, and a server. The network bridge equipment is respectively connected with the server, the terminal equipment 1, the terminal equipment 2 and the terminal equipment 3 to form a local area network, and the server is used as a gateway of the local area network. It should be noted that fig. 1 is only an example, and the number of terminal devices is not limited in the embodiment of the present application.
Fig. 2 shows a flowchart of an access method of a bridge device according to an embodiment of the present application, which is detailed as follows:
step 201, modifying the destination MAC address of the target message into the MAC address of the network bridge device if the target message sent by the terminal device is received;
in this embodiment, the destination packet, that is, the packet with the destination IP address being the fixed IP address of the bridge device. If the network bridge equipment receives the message sent by the terminal equipment, the destination IP address of the message needs to be obtained, and whether the destination IP address of the message is the fixed IP address of the network bridge equipment is judged. And if the destination IP address of the message is the fixed IP address of the network bridge equipment, determining the message as a target message. Then, for the target message, the bridge device modifies the destination MAC address of the target message into the MAC address of the bridge device.
Exemplarily, it is assumed that the fixed IP address of the bridge device is P1, the MAC address of the bridge device is C1, and the MAC address of the server is C2; if the bridge device receives a message sent by the terminal device, the destination IP address of the message is P1, the destination MAC address of the message is C2, and the bridge device determines that the destination IP address of the message is the same as the fixed IP address of the bridge device, the message is determined as a target message; then, the bridge device modifies the destination MAC address of the target packet from C2 to C1.
Optionally, the step 201 may specifically include:
searching a preset destination address conversion rule from a BROUTING chain of a broute table according to a destination IP address of a target message;
and modifying the destination MAC address of the target message into the MAC address of the network bridge equipment according to the destination address conversion rule.
In the embodiment of the present application, a preset destination address translation rule may be formulated by an ebtable configuration tool for filtering network packets in the Linux system, and the destination address translation rule is to be added to the bruting chain of the broute table. When a target message sent by the terminal equipment is received, the target message is matched with a destination address conversion rule in a BROUTING chain of the broute table. Specifically, the bridge device may search, according to the destination IP address of the target packet, in all rules of the broadcast chain of the broute table, whether a destination address translation rule matching the destination IP address of the target packet exists, and if the destination address translation rule matching the destination IP address of the target packet exists, modify the destination MAC address of the target packet into the MAC address of the bridge device according to the destination address translation rule.
It can be understood that, if the received message sent by the terminal device is not a target message, that is, the destination IP address of the message is not the fixed IP address of the bridge device, the message will not match the preset destination address translation rule, that is, the destination MAC address of the message will not be modified to the fixed IP address of the bridge device. In this way, the terminal device can still be made to normally access devices other than the bridge device.
Step 202, processing the target message to obtain a response message of the target message;
in this embodiment of the present application, after the destination MAC address of the target packet is modified to the MAC address of the bridge device, the bridge device may perform corresponding processing on the target packet to obtain a response packet of the target packet. The destination IP address and the destination port number of the response message are the source IP address and the source port number of the target message.
For example, after the destination MAC address of the target packet is modified to the MAC address of the bridge device, the target packet may be received by a Transmission Control Protocol (TCP)/IP Protocol stack local to the bridge device, and the TCP/IP Protocol stack processes the target packet, so as to generate a response packet of the target packet.
Step 203, sending the response message to the terminal device.
In this embodiment, the bridge device may send the response packet to the terminal device according to a destination IP address of the response packet (the destination IP address is an IP address of the terminal device). The terminal device receives the response message, which means that the terminal device completes one access to the network bridge device.
Optionally, before receiving the target packet sent by the terminal device, the method further includes:
a1, establishing connection with a preset server;
and A2, running a first process to acquire the dynamic IP address allocated by the server to the bridge device.
In this embodiment of the present application, before receiving a target packet sent by a terminal device, a network bridge device needs to establish a wired connection with a preset server. After the network bridge device establishes a wired connection with the server, the server serves as a gateway of the local area network and can allocate a dynamic IP address to the network bridge device. In order to obtain the Dynamic IP address allocated by the server to the bridge device, the bridge device is required to run a first process, which may be a process of a Dynamic Host Configuration Protocol Client (DHCP Client) program. After the network bridge device runs the process of the DHCP Client program, the dynamic IP address allocated to the network bridge device by the server can be obtained. The bridge device can access the internet, i.e. the network outside the local area network where the bridge device is located, according to the dynamic IP address assigned by the server. The bridge device can realize the internet service by accessing the internet.
Optionally, the step a2 may specifically include:
designating an interface of a first process as a virtual network interface of a bridge device;
the first process sends an IP acquisition request to the server through the virtual network interface so as to acquire the dynamic IP address allocated by the server for the network bridge equipment.
In this embodiment, taking the first process as the process of the DHCP Client program as an example, an interface of the process of the DHCP Client program may be designated as a virtual network interface of the bridge device. When the dynamic IP address distributed by the server to the network bridge equipment needs to be acquired, the process of the DHCP Client program sends an IP acquisition request to the server through the virtual network interface, and after receiving the IP acquisition request, the server allocates the dynamic IP address to the network bridge equipment and sends the dynamic IP address allocated to the network bridge equipment.
Optionally, before receiving the target packet sent by the terminal device, the method further includes:
the fixed IP address is configured for the virtual network interface of the bridge device by means of an ifconfig command.
In the embodiment of the application, the dynamic IP addresses allocated by the server to the bridge device each time are different, so that it is inconvenient for a user to access the bridge device through the terminal device, and therefore, a fixed IP address can be configured for the virtual network interface of the bridge device, so that the user can access the bridge device through the fixed IP address every time the user needs to access the bridge device. Specifically, the bridge device may execute an ifconfig command of the Linux system to configure a fixed IP address for the virtual network interface of the bridge device. For example, if the virtual network interface is br0 and the fixed IP address configured for the virtual network interface of the bridge device is P1, then the ifconfig command may be "ifocnfig br0:1P 1".
Optionally, the access method further includes:
when the dynamic IP address allocated to the network bridge equipment by the server is obtained, stopping running the second process;
and resetting the link of the switch on the LAN side of the bridge device to instruct the terminal device accessed to the LAN side to acquire the dynamic IP address allocated to the terminal device by the server.
In this embodiment of the present application, before the dynamic IP address allocated by the server to the bridge device is obtained, the bridge device may run a second process, where the second process is used to allocate the dynamic IP address to the terminal device. The second process may be a process of a Dynamic Host Configuration Protocol Server (DHCP Server) program, and the process of the DHCP Server program selects an IP address from an IP address pool to allocate to the terminal device during the operation process. When the dynamic IP address allocated to the bridge device by the Server is acquired, the bridge device stops running the DHCP Server program, that is, the bridge device does not allocate the IP address to the terminal device any more, then the link of the switch on the LAN side of the bridge device is reset (the link is disconnected and then reconnected), the terminal device is connected with the LAN side of the bridge device, and the terminal device acquires the IP address again after the link of the switch on the LAN side of the bridge device is reset. Because the DHCP Server program in the bridge device is already closed and no IP address is allocated to the terminal device, the terminal device will acquire the dynamic IP address allocated to the terminal device by the Server. The terminal equipment can access the Internet through the dynamic IP address allocated to the terminal equipment by the server.
As can be seen from the above, in the present application, if a target message sent by a terminal device is received, a destination MAC address of the target message is modified to an MAC address of the bridge device, where the destination IP address of the target message is a fixed IP address of the bridge device, then the target message is processed to obtain a response message of the target message, and finally the response message is sent to the terminal device. According to the scheme, when the network bridge equipment receives the target message sent by the terminal equipment, the target MAC address of the target message is modified into the MAC address of the network bridge equipment, so that the target message is redirected to the network bridge equipment, the network bridge equipment processes the target message, the mode that the terminal equipment accesses the network bridge equipment can be simplified, and convenience is brought to users.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 3 shows an interaction flowchart of a terminal device, a bridge device, and a server provided in an embodiment of the present application, which is detailed as follows:
step 301, the bridge device runs a second process;
step 302, the network bridge device allocates an IP address to the terminal device through a second process;
step 303, connecting the network bridge equipment with a server, and running a first process;
step 304, the server allocates a dynamic IP address for the network bridge device;
305, the network bridge equipment acquires the dynamic IP address allocated to the network bridge equipment by the server, stops running the second process and does not allocate the IP address to the terminal equipment any more;
step 306, the bridge device resets the link of the switch on the LAN side of the bridge device, and the resetting is to reconnect the link after disconnecting the link;
step 307, the server allocates a dynamic IP address to the terminal device.
Fig. 4 is a schematic structural diagram of an access apparatus of a bridge device according to an embodiment of the present application, and only a part related to the embodiment of the present application is shown for convenience of description.
The access device 400 includes:
an address modification unit 401, configured to modify a destination MAC address of a target packet into an MAC address of the bridge device if the target packet sent by a terminal device is received, where a destination IP address of the target packet is a fixed IP address of the bridge device;
a message processing unit 402, configured to process the target message to obtain a response message of the target message;
a message sending unit 403, configured to send the response message to the terminal device.
Optionally, the address modification unit 401 includes:
a rule searching subunit, configured to search, according to the destination IP address of the target packet, a preset destination address conversion rule from the bruting chain of the broute table;
and an address modification subunit, configured to modify the destination MAC address of the target packet into the MAC address of the bridge device according to the destination address translation rule.
Optionally, the message processing unit 402 is specifically configured to receive and process the target message through a local TCP/IP protocol stack of the bridge device, so as to obtain a response message of the target message.
Optionally, the access device 400 further includes:
the connection establishing unit is used for establishing connection with a preset server;
and the first process running unit is used for running a first process so as to acquire the dynamic IP address allocated by the server to the network bridge equipment.
Optionally, the first process running unit includes:
an interface specification subunit, configured to specify an interface of the first process as a virtual network interface of the bridge device;
a request sending subunit, configured to send, by the first process, an IP acquisition request to the server through the virtual network interface, so as to acquire a dynamic IP address allocated by the server to the bridge device.
Optionally, the access apparatus 400 further includes:
and the fixed IP configuration unit is used for configuring a fixed IP address for the virtual network interface of the bridge equipment through an ifconfig command.
Optionally, the access apparatus 400 further includes:
a second process stopping unit, configured to stop running a second process when a dynamic IP address allocated by the server to the bridge device is obtained, where the second process is used to allocate a dynamic IP address to the terminal device;
a link resetting unit configured to reset a link of a switch on the LAN side of the bridge device to instruct the terminal device accessing the LAN side to acquire the dynamic IP address allocated by the server to the terminal device.
As can be seen from the above, in the present application, if a target message sent by a terminal device is received, a destination MAC address of the target message is modified to an MAC address of the bridge device, where the destination IP address of the target message is a fixed IP address of the bridge device, then the target message is processed to obtain a response message of the target message, and finally the response message is sent to the terminal device. According to the scheme, when the network bridge equipment receives the target message sent by the terminal equipment, the target MAC address of the target message is modified into the MAC address of the network bridge equipment, so that the target message is redirected to the network bridge equipment, the network bridge equipment processes the target message, the mode that the terminal equipment accesses the network bridge equipment can be simplified, and convenience is brought to users.
Fig. 5 is a schematic structural diagram of a bridge device according to an embodiment of the present application. As shown in fig. 5, the bridge device 5 of this embodiment includes: at least one processor 50 (only one is shown in fig. 5), a memory 51, and a computer program 52 stored in the memory 51 and executable on the at least one processor 50, wherein the processor 50 executes the computer program 52 to implement the following steps:
if a target message sent by the terminal equipment is received, modifying the target MAC address of the target message into the MAC address of the network bridge equipment, wherein the target IP address of the target message is the fixed IP address of the network bridge equipment;
processing the target message to obtain a response message of the target message;
and sending the response message to the terminal equipment.
Assuming that the above is the first possible implementation manner, in a second possible implementation manner provided on the basis of the first possible implementation manner, the modifying the destination MAC address of the target packet to the MAC address of the bridge device includes:
searching a preset destination address conversion rule from a BROUTING chain of a broute table according to the destination IP address of the target message;
and modifying the destination MAC address of the target message into the MAC address of the network bridge equipment according to the destination address conversion rule.
In a third possible implementation manner provided based on the first possible implementation manner, the processing the target packet to obtain a response packet of the target packet includes:
and receiving and processing the target message through a local TCP/IP protocol stack of the network bridge equipment to obtain a response message of the target message.
In a fourth possible implementation manner provided on the basis of the first possible implementation manner, before the receiving of the target packet sent by the terminal device, the processor 50 executes the computer program 52 to further implement the following steps:
establishing connection with a preset server;
and running a first process to acquire the dynamic IP address allocated by the server to the network bridge equipment.
In a fifth possible implementation manner provided on the basis of the fourth possible implementation manner, the running a first process to acquire a dynamic IP address allocated by the server to the bridge device includes:
designating an interface of the first process as a virtual network interface of the bridge device;
and the first process sends an IP acquisition request to the server through the virtual network interface so as to acquire the dynamic IP address allocated to the bridge device by the server.
In a sixth possible implementation manner provided on the basis of the fifth possible implementation manner, when the processor 50 executes the computer program 52, the following steps are implemented:
and configuring a fixed IP address for the virtual network interface of the bridge device through an ifconfig command.
In a seventh possible implementation manner provided as a basis for the fourth possible implementation manner, when the processor 50 executes the computer program 52, the following steps are implemented:
when the dynamic IP address allocated to the network bridge equipment by the server is acquired, stopping running a second process, wherein the second process is used for allocating the dynamic IP address to the terminal equipment;
resetting a link of a switch on the LAN side of the bridge device to instruct the terminal device accessing the LAN side to acquire the dynamic IP address assigned by the server to the terminal device.
The bridge device may include, but is not limited to, a processor 50, a memory 51. It will be appreciated by those skilled in the art that fig. 5 is merely an example of a bridge device 5 and does not constitute a limitation of the bridge device 5 and may include more or less components than those shown, or some components may be combined, or different components may be included, such as input output devices, network access devices, etc.
The Processor 50 may be a Central Processing Unit (CPU), and the Processor 50 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 51 may be an internal storage unit of the bridge device 5 in some embodiments, for example, a hard disk or a memory of the bridge device 5. In other embodiments, the memory 51 may be an external storage device of the bridge device 5, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the bridge device 5. Further, the memory 51 may include both an internal storage unit of the bridge device 5 and an external storage device. The memory 51 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, other programs, and the like, such as program codes of the computer programs. The above-mentioned memory 51 may also be used to temporarily store data that has been output or is to be output.
As can be seen from the above, in the present application, if a target message sent by a terminal device is received, a destination MAC address of the target message is modified to an MAC address of the bridge device, where the destination IP address of the target message is a fixed IP address of the bridge device, then the target message is processed to obtain a response message of the target message, and finally the response message is sent to the terminal device. According to the scheme, when the network bridge equipment receives the target message sent by the terminal equipment, the target MAC address of the target message is modified into the MAC address of the network bridge equipment, so that the target message is redirected to the network bridge equipment, the network bridge equipment processes the target message, the mode that the terminal equipment accesses the network bridge equipment can be simplified, and convenience is brought to users.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned functions may be distributed as different functional units and modules according to needs, that is, the internal structure of the apparatus may be divided into different functional units or modules to implement all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the steps in the above method embodiments.
Embodiments of the present application provide a computer program product, which, when running on a bridge device, causes the bridge device to perform the steps in the above-mentioned method embodiments.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. The computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file or some intermediate form. The computer-readable medium may include at least: any entity or apparatus capable of carrying computer program code to a bridge device, recording medium, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/bridge device and method may be implemented in other ways. For example, the above-described apparatus/bridge device embodiments are merely illustrative, and for example, the division of the above modules or units is only one logical function division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (9)

1. An access method of a bridge device, comprising:
if a target message sent by a terminal device is received, modifying a destination MAC address of the target message into an MAC address of the network bridge device, including: searching a preset destination address conversion rule from a BROUTING chain of a broute table according to the destination IP address of the target message; modifying the destination MAC address of the target message into the MAC address of the network bridge equipment according to the destination address conversion rule; wherein, the destination IP address of the target message is the fixed IP address of the network bridge device;
processing the target message to obtain a response message of the target message;
and sending the response message to the terminal equipment.
2. The access method according to claim 1, wherein the processing the target packet to obtain a response packet of the target packet comprises:
and receiving and processing the target message through a local TCP/IP protocol stack of the network bridge equipment to obtain a response message of the target message.
3. The access method according to claim 1, wherein before the receiving a target packet sent by a terminal device, the access method further comprises:
establishing connection with a preset server;
and running a first process to acquire the dynamic IP address allocated to the network bridge equipment by the server.
4. The method according to claim 3, wherein the executing the first process to obtain the dynamic IP address allocated by the server to the bridge device comprises:
designating an interface of the first process as a virtual network interface of the bridge device;
and the first process sends an IP acquisition request to the server through the virtual network interface so as to acquire the dynamic IP address allocated to the network bridge equipment by the server.
5. The access method according to claim 4, wherein before the receiving of the target packet sent by the terminal device, the access method further comprises:
and configuring a fixed IP address for the virtual network interface of the network bridge equipment through an ifconfig command.
6. The access method according to claim 3, further comprising:
when the dynamic IP address allocated to the network bridge equipment by the server is obtained, stopping running a second process, wherein the second process is used for allocating the dynamic IP address to the terminal equipment;
resetting a link of a switch on the LAN side of the bridge device to indicate the terminal device accessing the LAN side to acquire the dynamic IP address allocated to the terminal device by the server.
7. An access apparatus of a bridge device, comprising:
an address modification unit, configured to modify a destination MAC address of a target packet into an MAC address of the network bridge device if the target packet sent by a terminal device is received, where a destination IP address of the target packet is a fixed IP address of the network bridge device; the address modification unit includes: a rule searching subunit, configured to search, according to the destination IP address of the target packet, a preset destination address conversion rule from the bruting chain of the broute table; an address modification subunit, configured to modify a destination MAC address of the target packet into an MAC address of the bridge device according to the destination address translation rule;
the message processing unit is used for processing the target message to obtain a response message of the target message;
and the message sending unit is used for sending the response message to the terminal equipment.
8. Bridge device comprising a memory, a processor and a computer program stored in said memory and executable on said processor, characterized in that said processor implements the method according to any of claims 1 to 6 when executing said computer program.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 6.
CN202010904105.5A 2020-09-01 2020-09-01 Access method and access device of network bridge equipment and network bridge equipment Active CN112235175B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010904105.5A CN112235175B (en) 2020-09-01 2020-09-01 Access method and access device of network bridge equipment and network bridge equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010904105.5A CN112235175B (en) 2020-09-01 2020-09-01 Access method and access device of network bridge equipment and network bridge equipment

Publications (2)

Publication Number Publication Date
CN112235175A CN112235175A (en) 2021-01-15
CN112235175B true CN112235175B (en) 2022-03-18

Family

ID=74116456

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010904105.5A Active CN112235175B (en) 2020-09-01 2020-09-01 Access method and access device of network bridge equipment and network bridge equipment

Country Status (1)

Country Link
CN (1) CN112235175B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114268470B (en) * 2021-12-06 2024-06-07 深圳飞音时代网络通讯技术有限公司 Message transmission method, device and equipment
CN114448750B (en) * 2022-01-19 2024-06-04 深圳市联洲国际技术有限公司 Communication method, device, equipment and medium of pure network bridge mode
CN114745419B (en) * 2022-05-07 2024-02-23 深信服科技股份有限公司 Method, device, equipment and storage medium for acquiring terminal MAC address
CN117812117A (en) * 2022-09-30 2024-04-02 华为技术有限公司 Data transmission system, data transmission method and networking equipment
CN115834291B (en) * 2022-11-16 2024-04-09 中国联合网络通信集团有限公司 Distributed intranet service data acquisition method, device, equipment and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510853A (en) * 2009-04-09 2009-08-19 杭州华三通信技术有限公司 Method and apparatus for implementing WLAN wireless bridge, and wireless access client terminal
CN101515950A (en) * 2009-04-09 2009-08-26 杭州华三通信技术有限公司 Realization method and device for WLAN subnet terminal and wireless access client
CN101577722A (en) * 2009-06-03 2009-11-11 中兴通讯股份有限公司 Method for realizing MAC forced forwarding function and device
EP2197159A1 (en) * 2008-12-12 2010-06-16 SELEX COMMUNICATIONS S.p.A. Group-learning method for a network having a tree topology
CN103685588A (en) * 2012-09-10 2014-03-26 中兴通讯股份有限公司 Bridge packet forwarding method and device for wireless network equipment in client mode
CN103685592A (en) * 2012-09-20 2014-03-26 杭州华三通信技术有限公司 Wireless bridge and method for realizing DHCP address application
CN103973570A (en) * 2013-01-31 2014-08-06 华为技术有限公司 Message transmission method, AP (access point) and message transmission system
CN104426816A (en) * 2013-08-19 2015-03-18 华为技术有限公司 Virtual machine communication method and device
CN107528847A (en) * 2017-09-01 2017-12-29 天津赞普科技股份有限公司 A kind of guard method based on MAC shuntings
CN111131541A (en) * 2019-12-25 2020-05-08 深圳市共进电子股份有限公司 Network communication method, device, electronic equipment and storage medium
CN113132218A (en) * 2019-12-31 2021-07-16 中兴通讯股份有限公司 Home gateway access method, device, system processor and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5239502B2 (en) * 2007-11-07 2013-07-17 株式会社明電舎 Bridging system, bridging and bridging method
CN101656671A (en) * 2009-08-28 2010-02-24 中兴通讯股份有限公司 Packet sending method and device
US8625597B2 (en) * 2011-01-07 2014-01-07 Jeda Networks, Inc. Methods, systems and apparatus for the interconnection of fibre channel over ethernet devices
US9497073B2 (en) * 2011-06-17 2016-11-15 International Business Machines Corporation Distributed link aggregation group (LAG) for a layer 2 fabric
CN103731288B (en) * 2012-10-16 2017-04-12 杭州华三通信技术有限公司 Message forwarding method and device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2197159A1 (en) * 2008-12-12 2010-06-16 SELEX COMMUNICATIONS S.p.A. Group-learning method for a network having a tree topology
CN101510853A (en) * 2009-04-09 2009-08-19 杭州华三通信技术有限公司 Method and apparatus for implementing WLAN wireless bridge, and wireless access client terminal
CN101515950A (en) * 2009-04-09 2009-08-26 杭州华三通信技术有限公司 Realization method and device for WLAN subnet terminal and wireless access client
CN101577722A (en) * 2009-06-03 2009-11-11 中兴通讯股份有限公司 Method for realizing MAC forced forwarding function and device
CN103685588A (en) * 2012-09-10 2014-03-26 中兴通讯股份有限公司 Bridge packet forwarding method and device for wireless network equipment in client mode
CN103685592A (en) * 2012-09-20 2014-03-26 杭州华三通信技术有限公司 Wireless bridge and method for realizing DHCP address application
CN103973570A (en) * 2013-01-31 2014-08-06 华为技术有限公司 Message transmission method, AP (access point) and message transmission system
CN104426816A (en) * 2013-08-19 2015-03-18 华为技术有限公司 Virtual machine communication method and device
CN107528847A (en) * 2017-09-01 2017-12-29 天津赞普科技股份有限公司 A kind of guard method based on MAC shuntings
CN111131541A (en) * 2019-12-25 2020-05-08 深圳市共进电子股份有限公司 Network communication method, device, electronic equipment and storage medium
CN113132218A (en) * 2019-12-31 2021-07-16 中兴通讯股份有限公司 Home gateway access method, device, system processor and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Design and implementation of experimental SPB network simulator on NS-3;Yoonsoon Chang;《2013 26th IEEE Canadian Conference on Electrical and Computer Engineering (CCECE)》;20130725;全文 *
TDD/TDMA微波通信系统中无线网桥的设计与实现;刘志鹏;《中国优秀硕士学位论文全文数据库 (信息科技辑)》;20150531;全文 *

Also Published As

Publication number Publication date
CN112235175A (en) 2021-01-15

Similar Documents

Publication Publication Date Title
CN112235175B (en) Access method and access device of network bridge equipment and network bridge equipment
JP7282146B2 (en) BRAS system-based packet encapsulation method and apparatus
CN109156046B (en) Home gateway and method for forwarding service thereof
CN105207873A (en) Message processing method and apparatus
US8856271B2 (en) Data accessing method used for customer premises equipment, and customer premises equipment
CN111901177B (en) Bare metal server network configuration method, system and related equipment
CN107809386B (en) IP address translation method, routing device and communication system
CN111294416A (en) Method for obtaining IP address and related product
CN105959188B (en) Method and device for controlling user terminal to be on-line
CN114338594A (en) ARP (Address resolution protocol) response-substituting method, device, equipment and storage medium in Kubernetes environment
US9294389B2 (en) Method to select interface for IP packets when destination subnet is reachable on multiple interfaces
CN114697388B (en) Data transmission method and device
CN109698845B (en) Data transmission method, server, unloading card and storage medium
CN104426816A (en) Virtual machine communication method and device
WO2023221708A1 (en) Pdn dialing method, system and apparatus, multi-pdn dialing configuration method, system and apparatus, and device and storage medium
CN108574587B (en) Capacity updating method and device for distributed equipment
CN106302845A (en) The Domain Name System addresses collocation method of data channel product and device
CN110351394B (en) Network data processing method and device, computer device and readable storage medium
CN113014680A (en) Broadband access method, device, equipment and storage medium
CN108989173B (en) Message transmission method and device
CN114679370B (en) Server hosting method, device, system and storage medium
EP4216510A1 (en) Method for acquiring address, apparatus and system
CN111988446B (en) Message processing method and device, electronic equipment and storage medium
CN113784201A (en) Auxiliary screen device networking processing method and device, intelligent terminal and medium
CN112714202A (en) Equipment configuration method and device

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
GR01 Patent grant
GR01 Patent grant