CN103516820A - Port forwarding method and apparatus based on MAC address - Google Patents

Port forwarding method and apparatus based on MAC address Download PDF

Info

Publication number
CN103516820A
CN103516820A CN201210210327.2A CN201210210327A CN103516820A CN 103516820 A CN103516820 A CN 103516820A CN 201210210327 A CN201210210327 A CN 201210210327A CN 103516820 A CN103516820 A CN 103516820A
Authority
CN
China
Prior art keywords
port
address
port mapping
mac address
mapping information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201210210327.2A
Other languages
Chinese (zh)
Other versions
CN103516820B (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201210210327.2A priority Critical patent/CN103516820B/en
Publication of CN103516820A publication Critical patent/CN103516820A/en
Application granted granted Critical
Publication of CN103516820B publication Critical patent/CN103516820B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a port forwarding method based on an MAC address. The method comprises: configuring port forwarding information of an internal host; obtaining, based on the port forwarding information, an IP address corresponding to an MAC address when an access request message including the MAC address of the internal host is received; and forwarding a port based on the IP address and the port forwarding information. The invention also provides a corresponding port forwarding apparatus based on an MAC address. According to the port forwarding method and apparatus based on an MAC address, a port forwarding function corresponding to the internal host can be achieved based on a corresponding relation between the MAC address and the IP address of the internal host as long as the port forwarding information of the internal host in an internal network is configured. In the above way, configuration processes of the port forwarding function are simplified to a large degree, such that it is simple to achieve the port forwarding function and better experience can be brought for users.

Description

Port mapping method based on MAC Address and device
Technical field
The present invention relates to communication technical field, specially refer to a kind of port mapping method and device based on MAC Address.
Background technology
In a typical IPV4 access network, CPE(Customer Premise Epuipment, customer terminal equipment) or the terminal equipment such as gateway and router all have an Internet public network address, and each main frame of internal network is sightless to Internet, they use private net address, and by the NAT(Network Address Translation of CPE, network address translation) function unification converts public network address to complete and the communicating by letter of exterior I nternet private net address.For common Internet business (as HTTP, FTP etc.) can be applied on internal network main frame, just need on CPE, carry out port mapping (Port forwarding) function.Port mapping is, by configuration rule, the destination address of external request access is become to home address and port with port translation, and does not change source address and the port of external request message.Certainly, also can pass through the configuration of the completing port mapping function of UPnP (Universal Plug and Play protocol) protocol dynamic.
In order to prevent malicious attack, fire compartment wall is installed in internal network main frame conventionally, and fire compartment wall need to be forbidden the access rights of external network to internal network traffic application.Therefore,, in IPv6 access network, if need access to be deployed in main frame or the server of fire compartment wall internal network below, can complete by port mapping function equally.Like this, not only limit the random access of external network, and can hide the port information of internal network service, can use ciphertext open-ended external reference authority, strengthened the fail safe of internal network.
Yet, in the network system of an IPv4/IPv6 dual stack, because needs separate IPv4 and IPv6 address, and on an equipment, conventionally can there are a plurality of IPv6 global addresses, like this, with regard to for the configuration of port mapping function has brought great inconvenience, need to be configured respectively according to IPv4 and IPv6 address, make the realization of port mapping function comparatively loaded down with trivial details, and can not bring good experience for user.
Summary of the invention
Main purpose of the present invention, for a kind of port mapping method and device based on MAC Address is provided, is intended to simplify the layoutprocedure of port mapping function, thereby makes the realization of port mapping function comparatively simple, and can bring good experience for user.
The invention provides a kind of port mapping method based on MAC Address, comprising:
The port mapping information of configuration internal host;
Receive after the access request message of the MAC Address that comprises internal host, according to described port mapping information, obtain IP address corresponding to described MAC Address;
According to described IP address and described port mapping information, mapped port.
Preferably, described port mapping information at least comprises one of following: the MAC Address of internal host, protocol type, listening port, port type, destination host and destination interface.
Preferably, described according to port mapping information, obtain IP address corresponding to described MAC Address and comprise:
According to described port mapping information, the MAC Address of internal host included in access request message is changed, obtain IP address corresponding to described MAC Address.
Preferably, described according to IP address and described port mapping information, mapped port comprises:
Obtain behind IP address corresponding to the MAC Address of internal host, according to described port mapping information, trace session connects;
According to described connection trace session, by port translation module by the open port mapping in outside to the port of described internal host.
Preferably, described according to IP address and described port mapping information in execution, before mapped port, also comprise:
According to described port mapping information, judge whether to exist connection trace session;
If exist, according to described connection trace session, mapped port.
The present invention also provides a kind of port mapping device based on MAC Address, comprising:
Configuration module, for configuring the port mapping information of internal host;
Address acquisition module, for receiving after the access request message of the MAC Address that comprises internal host, according to described port mapping information, obtains IP address corresponding to described MAC Address;
The first port mapping block, for according to described IP address and described port mapping information, mapped port.
Preferably, described port mapping information at least comprises one of following: the MAC Address of internal host, protocol type, listening port, port type, destination host and destination interface.
Preferably, described address acquisition module is used for:
According to described port mapping information, the MAC Address of internal host included in access request message is changed, obtain IP address corresponding to described MAC Address.
Preferably, described the first port mapping block comprises:
Session establishment unit, for obtaining behind IP address corresponding to the MAC Address of internal host, according to described port mapping information, trace session connects;
Map unit, for according to described connection trace session, by port translation module by the open port mapping in outside to the port of described internal host.
Preferably, the port mapping device based on MAC Address also comprises:
Judge module, for according to described port mapping information, judges whether to exist connection trace session;
The second port mapping module, if for existing, according to described connection trace session, mapped port.
The present invention is configured by the configured port map information to internal host, and after receiving outside access request message, according to the MAC Address of wherein included internal host and port mapping information, obtain IP address corresponding to this MAC Address, finally according to IP address and port mapping information, completing port mapping function.Adopt in this way, only need to configure the port mapping information of the internal host in internal network, and according to the corresponding relation between the MAC Address YuIP address of internal host, can complete the port mapping function that this internal host is corresponding.Like this, simplify to a great extent the layoutprocedure of port mapping function, thereby made the realization of port mapping function comparatively simple, and can bring good experience for user.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet that the present invention is based on port mapping method one embodiment of MAC Address;
Fig. 2 is the schematic flow sheet that the present invention is based on mapped port one embodiment in the port mapping method of MAC Address;
Fig. 3 is the port mapping method schematic flow sheet of an embodiment again that the present invention is based on MAC Address;
Fig. 4 is the structural representation that the present invention is based on port mapping device one embodiment of MAC Address;
Fig. 5 is the structural representation that the present invention is based on the first port mapping block in the port mapping device of MAC Address;
Fig. 6 is the port mapping device structural representation of an embodiment again that the present invention is based on MAC Address.
The realization of the object of the invention, functional characteristics and advantage, in connection with embodiment, are described further with reference to accompanying drawing.
Embodiment
Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
With reference to Fig. 1, Fig. 1 is the schematic flow sheet that the present invention is based on port mapping method one embodiment of MAC Address.
The method comprises:
Step S10, the port mapping information of configuration internal host;
In the present embodiment, the port mapping method based on MAC Address providing, can be applied in IPV4 access network or IPV6 access network, also can be applied in the access network of IPV4/IPV6 dual stack, conventionally use it for the routing gateway equipment especially in home gateway with firewall functionality.In IPV4 access network, because wireless terminal accessing device has one for completing the public network address of communicating by letter with exterior I nternet, each main frame of internal network uses private net address; And in IPV6 access network, conventionally with fire compartment wall, forbid the access rights of external network to internal network.This just needs port mapping function, realizes the access of external network to internal network.
Because each main frame in wireless network has unique MAC Address, user can be configured the port mapping information of internal host according to certain MAC mapping policy, is about to port mapping information and configures into kernel.In the present embodiment, port mapping information can comprise conventionally: the MAC Address of internal host, protocol type, listening port, port type, destination host and destination interface etc.After configuration finishes, the port mapping information that user is configured is preserved, thereby in kernel, the MAC Address YuIP address of internal host is changed.In the present embodiment, the access network that the applied network environment of take is IPV4/IPV6 dual stack is example, like this, just need respectively in IPV4 protocol stack and IPV6 protocol stack, according to MAC mapping policy, the corresponding relation of the MAC Address YuIP address of study maintain internal main frame, and the corresponding relation of the MAC Address YuIP address of internal host is kept at respectively in address corresponding lists mac_ipv4_list and mac_ipv6_list.
Step S20, receives after the access request message of the MAC Address that comprises internal host, according to port mapping information, obtains IP address corresponding to MAC Address;
When a certain internal host of external host request access, can send an access request message, the MAC Address of the internal host that comprises required access in this access request message.After receiving this access request message, according to MAC Address wherein, and the port mapping information that configures of user, in kernel, obtain this internal host the corresponding IP of MAC Address address.In the present embodiment, in IPV4 protocol stack and IPV6 protocol stack, according to the MAC Address of the internal host in access request message, just can in address corresponding lists mac_ipv4_list and mac_ipv6_list, search respectively, obtain IP address corresponding to this MAC Address.
Step S30, according to IP address and port mapping information, mapped port.
When get its corresponding IP address according to the MAC Address in access request message after, according to this IP address, and the port mapping information that configures of user, according to the concrete destination host in the listening port of the protocol type in current access network environment, internal host and port type, internal host and the information such as destination interface on this destination host, completing port mapping.
The embodiment of the present invention, by the configured port map information to internal host, be configured, and after receiving outside access request message, according to the MAC Address of wherein included internal host and port mapping information, obtain IP address corresponding to this MAC Address, finally according to IP address and port mapping information, completing port mapping function.Adopt in this way, only need to configure the port mapping information of the internal host in internal network, and according to the corresponding relation between the MAC Address YuIP address of internal host, can complete the port mapping function that this internal host is corresponding.Like this, simplify to a great extent the layoutprocedure of port mapping function, thereby made the realization of port mapping function comparatively simple, and can bring good experience for user.
With reference to Fig. 2, Fig. 2 is the schematic flow sheet that the present invention is based on mapped port one embodiment in the port mapping method of MAC Address.
In the present embodiment, step S30 comprises:
Step S31, obtains behind IP address corresponding to the MAC Address of internal host, and according to port mapping information, trace session connects;
Step S32, according to connecting trace session, by port translation module by the open port mapping in outside to the port of internal host.
In the present embodiment, to describe respectively in IPV4 protocol stack and IPV6 protocol stack:
One, in IPV4 protocol stack, the source IP address of case of external main frame is 10.10.10.10, and source port is Z; The IP address of wireless terminal accessing device is 10.10.10.1, and the port of its opening is Y; And the target ip address of object internal host is 192.168.1.2, destination interface is X.
When receiving the access request message of external host transmission, and in mac_ipv4_list list, find behind IP address corresponding to this MAC Address according to MAC Address wherein, model conntrack(connects tracking) conversation recording, then utilize the existing NAT(Network Address of cpe device Translation, network address translation) functional module carries out the conversion between MAC Address YuIP address; Finally, according to the IP address of gained after NAT conversion, upgrade conntrack conversation recording, further complete the conversion between source port Z and destination interface X, thereby realize communicating by letter between external host and internal host.In the present embodiment, if search IP address failure corresponding to MAC Address in mac_ipv4_list list, directly exit, do not carry out the processing of port mapping.
In the present embodiment, the conntrack session of setting up, can receive after the outside access request message sending follow-up, without searching corresponding IP address according to MAC Address wherein, just can directly according to conntrack session, carry out the conversion of port mapping.And when user revises or deletes MAC mapping policy, need to delete the corresponding conntrack session of setting up; And, when mac_ipv6_list list changes, also need to delete the corresponding conntrack session of setting up.The transfer process of source port Z and destination interface X is as shown in the table:
Session before Mapping and Converting 10.10.10.10:[Z] → 10.10.10.1:[Y]
Session after Mapping and Converting 10.10.10.10:[Z] → 192.168.1.2:[X]
Two, in IPV6 protocol stack, the source IP address of case of external main frame is 2001:db8::b, and source port is Z; The port of wireless terminal accessing device opening is Y; And the target ip address of object internal host is 2001:db8::a, destination interface is X.
After receiving the access request message of external host transmission, according to MAC Address wherein, whether the corresponding relation of searching MAC Address YuIP address in mac_ipv6_list list exists, and finding while there is corresponding relation, carry out the conversion of port mapping function, and revise the destination interface information of access request message, destination interface information is forwarded to internal network main frame.Then, set up conntrack(and connect to follow the tracks of) session, according to conntrack session, complete the conversion between source port Z and destination interface X, can realize communicating by letter between external host and internal host.In the present embodiment, if do not find the corresponding relation of MAC Address YuIP address in mac_ipv6_list list, directly exit, do not carry out the processing of port mapping.
In the present embodiment, the conntrack session of setting up, can receive after the outside access request message sending follow-up, without searching corresponding IP address according to MAC Address wherein, just can directly according to conntrack session, carry out the conversion of port mapping.And when user revises or deletes MAC mapping policy, need to delete the corresponding conntrack session of setting up; And, when mac_ipv6_list list changes, also need to delete the corresponding conntrack session of setting up.The transfer process of source port Z and destination interface X is as shown in the table:
Session before Mapping and Converting 2001:db8::b [Z] → 2001:db8::a [Y]
Session after Mapping and Converting 2001:db8::b [Z] → 2001:db8::a [X]
In IPV4 protocol stack and IPV6 protocol stack, after the access request message receiving, in address corresponding lists mac_ipv4_list and mac_ipv6_list, find respectively behind IP address corresponding to the MAC Address of internal host, according to port mapping information, trace session connects, and according to connecting trace session, completing port mapping function.Like this, just further guaranteed only need to configure the MAC Address of the internal host in internal network, can complete the port mapping function that this internal host is corresponding.Thereby further, for simplifying the layoutprocedure of port mapping function, make the realization of port mapping function that assurance is comparatively simply provided.
With reference to Fig. 3, Fig. 3 is the port mapping method schematic flow sheet of an embodiment again that the present invention is based on MAC Address.
In the present embodiment, before execution step S30, also comprise:
Step S40, according to port mapping information, judges whether to exist connection trace session; When existing, enter step S41; If do not exist, perform step S30;
Step S41, mapped port.
The MAC Address of the internal host comprising in the access request message sending according to outside, in address corresponding lists mac_ipv4_list or mac_ipv6_list, get behind the corresponding IP of MAC Address address, first the port mapping information that comprises the information such as protocol type, listening port, port type, destination host and destination interface configuring according to user, judges that the current conntrack(that whether existed connects tracking) session.If judge and have conntrack session, directly according to conntrack session, completing port mapping function, and forwarding data is to internal host, just can realize communicating by letter between external host and internal host.
The MAC Address that comprises internal host in the access request message sending according to outside gets behind the corresponding IP of MAC Address address, first according to user institute configured port map information, judge the current conntrack session that whether existed, and judging while existing, directly according to conntrack session, completing port mapping function.Like this, just further guaranteed to make the realization of port mapping function comparatively simple, and further guaranteed to bring good experience for user.
With reference to Fig. 4, Fig. 4 is the structural representation that the present invention is based on port mapping device one embodiment of MAC Address.This device comprises:
Configuration module 10, for configuring the port mapping information of internal host;
Address acquisition module 20, for receiving after the access request message of the MAC Address that comprises internal host, according to port mapping information, obtains IP address corresponding to MAC Address;
The first port mapping block 30, for according to IP address and port mapping information, mapped port.
In the present embodiment, the port mapping device based on MAC Address providing, can be applied in IPV4 access network or IPV6 access network, also can be applied in the access network of IPV4/IPV6 dual stack, conventionally use it for the routing gateway equipment especially in home gateway with firewall functionality.In IPV4 access network, because wireless terminal accessing device has one for completing the public network address of communicating by letter with exterior I nternet, each main frame of internal network uses private net address; And in IPV6 access network, conventionally with fire compartment wall, forbid the access rights of external network to internal network.This just needs port mapping function, realizes the access of external network to internal network.
Because each main frame in wireless network has unique MAC Address, user can be according to certain MAC mapping policy, and the port mapping information by 10 pairs of internal hosts of configuration module is configured, and is about to port mapping information and configures into kernel.In the present embodiment, port mapping information can comprise conventionally: the MAC Address of internal host, protocol type, listening port, port type, destination host and destination interface etc.After configuration finishes, the port mapping information that user is configured is preserved, thereby in kernel, the MAC Address YuIP address of internal host is changed.In the present embodiment, the access network that the applied network environment of take is IPV4/IPV6 dual stack is example, like this, just need respectively in IPV4 protocol stack and IPV6 protocol stack, according to MAC mapping policy, the corresponding relation of the MAC Address YuIP address of study maintain internal main frame, and the corresponding relation of the MAC Address YuIP address of internal host is kept at respectively in address corresponding lists mac_ipv4_list and mac_ipv6_list.
When a certain internal host of external host request access, can send an access request message, the MAC Address of the internal host that comprises required access in this access request message.After receiving this access request message, address acquisition module 20 is according to MAC Address wherein, and the port mapping information that configures of user, in kernel, obtain this internal host the corresponding IP of MAC Address address.In the present embodiment, in IPV4 protocol stack and IPV6 protocol stack, according to the MAC Address of the internal host in access request message, just can in address corresponding lists mac_ipv4_list and mac_ipv6_list, search respectively, obtain IP address corresponding to this MAC Address.
When get its corresponding IP address according to the MAC Address in access request message after, the first port mapping block 30 is according to this IP address, and the port mapping information that configures of user, the first port mapping block 30 is according to the concrete destination host in the listening port of the protocol type in current access network environment, internal host and port type, internal host and the information such as destination interface on this destination host, completing port mapping.
The embodiment of the present invention, by the configured port map information to internal host, be configured, and after receiving outside access request message, according to the MAC Address of wherein included internal host and port mapping information, obtain IP address corresponding to this MAC Address, finally according to IP address and port mapping information, completing port mapping function.Adopt in this way, only need to configure the port mapping information of the internal host in internal network, and according to the corresponding relation between the MAC Address YuIP address of internal host, can complete the port mapping function that this internal host is corresponding.Like this, simplify to a great extent the layoutprocedure of port mapping function, thereby made the realization of port mapping function comparatively simple, and can bring good experience for user.
With reference to Fig. 5, Fig. 5 is the structural representation that the present invention is based on the first port mapping block in the port mapping device of MAC Address.
In the present embodiment, the first port mapping block 30 comprises:
Session establishment unit 31, for obtaining behind IP address corresponding to the MAC Address of internal host, according to port mapping information, trace session connects;
Map unit 32, for according to connecting trace session, by port translation module by the open port mapping in outside to the port of described internal host.
In the present embodiment, to describe respectively in IPV4 protocol stack and IPV6 protocol stack:
One, in IPV4 protocol stack, the source IP address of case of external main frame is 10.10.10.10, and source port is Z; The IP address of wireless terminal accessing device is 10.10.10.1, and the port of its opening is Y; And the target ip address of object internal host is 192.168.1.2, destination interface is X.
When receiving the access request message of external host transmission, and in mac_ipv4_list list, find behind IP address corresponding to this MAC Address according to MAC Address wherein, session establishment unit 31 model conntrack(connect tracking) conversation recording, then utilize the existing NAT(Network Address of cpe device Translation, network address translation) functional module carries out the conversion between MAC Address YuIP address; Finally, according to the IP address of gained after NAT conversion, upgrade conntrack conversation recording, map unit 32 further completes the conversion between source port Z and destination interface X, thereby realizes communicating by letter between external host and internal host.In the present embodiment, if search IP address failure corresponding to MAC Address in mac_ipv4_list list, directly exit, do not carry out the processing of port mapping.
In the present embodiment, the conntrack session of setting up, can receive after the outside access request message sending follow-up, without searching corresponding IP address according to MAC Address wherein, map unit 32 just can directly be carried out the conversion of port mapping according to conntrack session.And when user revises or deletes MAC mapping policy, need to delete the corresponding conntrack session of setting up; And, when mac_ipv6_list list changes, also need to delete the corresponding conntrack session of setting up.The transfer process of source port Z and destination interface X is as shown in the table:
Session before Mapping and Converting 10.10.10.10:[Z] → 10.10.10.1:[Y]
Session after Mapping and Converting 10.10.10.10:[Z] → 192.168.1.2:[X]
Two, in IPV6 protocol stack, the source IP address of case of external main frame is 2001:db8::b, and source port is Z; The port of wireless terminal accessing device opening is Y; And the target ip address of object internal host is 2001:db8::a, destination interface is X.
After receiving the access request message of external host transmission, according to MAC Address wherein, whether the corresponding relation of searching MAC Address YuIP address in mac_ipv6_list list exists, and finding while there is corresponding relation, carry out the conversion of port mapping function, and revise the destination interface information of access request message, destination interface information is forwarded to internal network main frame.Then, session establishment unit 31 is set up conntrack(and connect to be followed the tracks of) session, map unit 32, according to conntrack session, completes the conversion between source port Z and destination interface X, can realize communicating by letter between external host and internal host.In the present embodiment, if do not find the corresponding relation of MAC Address YuIP address in mac_ipv6_list list, directly exit, do not carry out the processing of port mapping.
In the present embodiment, the conntrack session of setting up, can receive after the outside access request message sending follow-up, without searching corresponding IP address according to MAC Address wherein, map unit 32 just can directly be carried out the conversion of port mapping according to conntrack session.And when user revises or deletes MAC mapping policy, need to delete the corresponding conntrack session of setting up; And, when mac_ipv6_list list changes, also need to delete the corresponding conntrack session of setting up.The transfer process of source port Z and destination interface X is as shown in the table:
Session before Mapping and Converting 2001:db8::b [Z] → 2001:db8::a [Y]
Session after Mapping and Converting 2001:db8::b [Z] → 2001:db8::a [X]
In IPV4 protocol stack and IPV6 protocol stack, after the access request message receiving, in address corresponding lists mac_ipv4_list and mac_ipv6_list, find respectively behind IP address corresponding to the MAC Address of internal host, according to port mapping information, trace session connects, and according to connecting trace session, completing port mapping function.Like this, just further guaranteed only need to configure the MAC Address of the internal host in internal network, can complete the port mapping function that this internal host is corresponding.Thereby further, for simplifying the layoutprocedure of port mapping function, make the realization of port mapping function that assurance is comparatively simply provided.
With reference to Fig. 6, Fig. 6 is the port mapping device structural representation of an embodiment again that the present invention is based on MAC Address.
In the present embodiment, this device also comprises:
Judge module 40, for according to port mapping information, judges whether to exist connection trace session;
The second port mapping module 50, if for existing, according to connecting trace session, mapped port.
The MAC Address of the internal host comprising in the access request message sending according to outside, in address corresponding lists mac_ipv4_list or mac_ipv6_list, get behind the corresponding IP of MAC Address address, the port mapping information that comprises the information such as protocol type, listening port, port type, destination host and destination interface that first judge module 40 configures according to user, judges that the current conntrack(that whether existed connects tracking) session.If judge and have conntrack session, the second port mapping module 50 is directly according to conntrack session, and completing port mapping function, and forwarding data is to internal host just can realize communicating by letter between external host and internal host.
The MAC Address that comprises internal host in the access request message sending according to outside gets behind the corresponding IP of MAC Address address, first according to user institute configured port map information, judge the current conntrack session that whether existed, and judging while existing, directly according to conntrack session, completing port mapping function.Like this, just further guaranteed to make the realization of port mapping function comparatively simple, and further guaranteed to bring good experience for user.
The foregoing is only the preferred embodiments of the present invention; not thereby limit the scope of the claims of the present invention; every equivalent structure or conversion of equivalent flow process that utilizes specification of the present invention and accompanying drawing content to do; or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.

Claims (10)

1. the port mapping method based on MAC Address, is characterized in that, comprising:
The port mapping information of configuration internal host;
Receive after the access request message of the MAC Address that comprises internal host, according to described port mapping information, obtain IP address corresponding to described MAC Address;
According to described IP address and described port mapping information, mapped port.
2. the method for claim 1, is characterized in that, it is one of following that described port mapping information at least comprises: the MAC Address of internal host, protocol type, listening port, port type, destination host and destination interface.
3. method as claimed in claim 2, is characterized in that, described according to port mapping information, obtains IP address corresponding to described MAC Address and comprises:
According to described port mapping information, the MAC Address of internal host included in access request message is changed, obtain IP address corresponding to described MAC Address.
4. method as claimed in claim 3, is characterized in that, described according to IP address and described port mapping information, mapped port comprises:
Obtain behind IP address corresponding to the MAC Address of internal host, according to described port mapping information, trace session connects;
According to described connection trace session, by port translation module by the open port mapping in outside to the port of described internal host.
5. the method for claim 1, is characterized in that, described according to IP address and described port mapping information in execution, before mapped port, also comprises:
According to described port mapping information, judge whether to exist connection trace session;
If exist, according to described connection trace session, mapped port.
6. the port mapping device based on MAC Address, is characterized in that, comprising:
Configuration module, for configuring the port mapping information of internal host;
Address acquisition module, for receiving after the access request message of the MAC Address that comprises internal host, according to described port mapping information, obtains IP address corresponding to described MAC Address;
The first port mapping block, for according to described IP address and described port mapping information, mapped port.
7. method as claimed in claim 6, is characterized in that, it is one of following that described port mapping information at least comprises: the MAC Address of internal host, protocol type, listening port, port type, destination host and destination interface.
8. device as claimed in claim 7, is characterized in that, described address acquisition module is used for:
According to described port mapping information, the MAC Address of internal host included in access request message is changed, obtain IP address corresponding to described MAC Address.
9. device as claimed in claim 8, is characterized in that, described the first port mapping block comprises:
Session establishment unit, for obtaining behind IP address corresponding to the MAC Address of internal host, according to described port mapping information, trace session connects;
Map unit, for according to described connection trace session, by port translation module by the open port mapping in outside to the port of described internal host.
10. device as claimed in claim 6, is characterized in that, also comprises:
Judge module, for according to described port mapping information, judges whether to exist connection trace session;
The second port mapping module, if for existing, according to described connection trace session, mapped port.
CN201210210327.2A 2012-06-25 2012-06-25 Port mapping method and device based on MAC Address Active CN103516820B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210210327.2A CN103516820B (en) 2012-06-25 2012-06-25 Port mapping method and device based on MAC Address

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210210327.2A CN103516820B (en) 2012-06-25 2012-06-25 Port mapping method and device based on MAC Address

Publications (2)

Publication Number Publication Date
CN103516820A true CN103516820A (en) 2014-01-15
CN103516820B CN103516820B (en) 2017-08-25

Family

ID=49898837

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210210327.2A Active CN103516820B (en) 2012-06-25 2012-06-25 Port mapping method and device based on MAC Address

Country Status (1)

Country Link
CN (1) CN103516820B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104243631A (en) * 2014-10-13 2014-12-24 北京太一星晨信息技术有限公司 Method and device for stateful conversion between IPv4 address and IPv6 address
CN110166450A (en) * 2019-05-17 2019-08-23 固高科技(深圳)有限公司 Data transmission method, device and communication equipment based on Industrial Ethernet
CN114697411A (en) * 2020-12-29 2022-07-01 北京达佳互联信息技术有限公司 Data processing method, device, server and storage medium
CN114978890A (en) * 2022-05-16 2022-08-30 南京信息职业技术学院 Port mapping system and mapping method thereof

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1737187A2 (en) * 2000-01-05 2006-12-27 Thomson Licensing, Inc. Bi-directional cable modem for directly connecting a LAN network to the internet
CN101043392A (en) * 2006-04-28 2007-09-26 华为技术有限公司 Apparatus and base station equipment for transmitting IP packet in WiMAX network
CN101442443A (en) * 2009-01-13 2009-05-27 武汉烽火网络有限责任公司 Network management system and implementing method for SNMP traversing NAT
CN101909010A (en) * 2010-08-06 2010-12-08 福建星网锐捷网络有限公司 Port configuration method and device as well as switcher equipment
CN102123050A (en) * 2011-03-09 2011-07-13 成都勤智数码科技有限公司 Network terminal management method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1737187A2 (en) * 2000-01-05 2006-12-27 Thomson Licensing, Inc. Bi-directional cable modem for directly connecting a LAN network to the internet
CN101043392A (en) * 2006-04-28 2007-09-26 华为技术有限公司 Apparatus and base station equipment for transmitting IP packet in WiMAX network
CN101442443A (en) * 2009-01-13 2009-05-27 武汉烽火网络有限责任公司 Network management system and implementing method for SNMP traversing NAT
CN101909010A (en) * 2010-08-06 2010-12-08 福建星网锐捷网络有限公司 Port configuration method and device as well as switcher equipment
CN102123050A (en) * 2011-03-09 2011-07-13 成都勤智数码科技有限公司 Network terminal management method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104243631A (en) * 2014-10-13 2014-12-24 北京太一星晨信息技术有限公司 Method and device for stateful conversion between IPv4 address and IPv6 address
CN110166450A (en) * 2019-05-17 2019-08-23 固高科技(深圳)有限公司 Data transmission method, device and communication equipment based on Industrial Ethernet
CN114697411A (en) * 2020-12-29 2022-07-01 北京达佳互联信息技术有限公司 Data processing method, device, server and storage medium
CN114978890A (en) * 2022-05-16 2022-08-30 南京信息职业技术学院 Port mapping system and mapping method thereof
CN114978890B (en) * 2022-05-16 2024-01-23 南京信息职业技术学院 Port mapping system and mapping method thereof

Also Published As

Publication number Publication date
CN103516820B (en) 2017-08-25

Similar Documents

Publication Publication Date Title
US8559448B2 (en) Method and apparatus for communication of data packets between local networks
KR101785760B1 (en) Method and network element for enhancing ds-lite with private ipv4 reachability
EP3472992B1 (en) Network path probing using available network connections
WO2020248963A1 (en) Method and apparatus for establishing end-to-end network connection, and network system
CN102215273B (en) Method and device for providing external network access for internal network user
US8699515B2 (en) Limiting of network device resources responsive to IPv6 originating entity identification
US20170237706A1 (en) Method and apparatus for setting network rule entry
US20110246663A1 (en) Broadband network access
US9516070B2 (en) Method for establishing channel for managing IPV4 terminal and network gateway
US8472420B2 (en) Gateway device
CN103763407A (en) Method for achieving address resolution protocol proxy through two-layer virtual local area network and local area network system
US20090175197A1 (en) Method and system for detection of nat devices in a network
CN107071079B (en) Method and system for private network terminal to acquire public network IP
CN106507414B (en) Message forwarding method and device
CN102970387A (en) Domain name resolution method, device and system
CN103516820A (en) Port forwarding method and apparatus based on MAC address
US11683275B2 (en) Device and method for interconnecting two subnetworks
CN110351772B (en) Mapping between wireless links and virtual local area networks
US20160080315A1 (en) Enhanced dynamic host configuration protocol (dhcp)
CN113014680A (en) Broadband access method, device, equipment and storage medium
CN101572729B (en) Processing method of node information of virtual private network, interrelated equipment and system
KR101690498B1 (en) Method for setting network configuration and switch and computer-readable recording medium using the same
CN108337331B (en) Network penetration method, device and system and network connectivity checking method
KR101996588B1 (en) Network bridge apparatus and control method thereof to support arp protocols
KR101303030B1 (en) Method for operating and searching host in internet protocol version 6 network

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant