How router port mapping to achieve external network access to a local server so that the external network to access your local Web services

How to make external network access to your local Web services

At present, many web developers and other installed IIS or Apache Web server, you can put your computer is configured to route a network server-centric.
Local intranet server test is more than enough, but some projects need to demonstrate to the customer acceptance of different places, but not enough time to put your website on top of the server, then we can use port mapping, so that customers can access our external network local server (for most web design Soho workers).
Network above has a lot of software can perform this function, but I want to talk today not rely on any software (I do not like to install the software), but their own set of port routing, reaching above their computers outside the network can be a local server access.
What is the port mapping, the following will be introduced in this port mapping out the premise is to have a route, the route did not trouble ... .. you buy a bar.
Our local Web server are generally Http: // localhost / or back with ports, LAN users are accessing the Web server through the network computer IP, for example, Web server computer's IP is 192.168.1.112, the other LAN users can access through https://192.168.1.112 to our Web server, but for extranet users, can not be accessed by visiting our Web server https://192.168.1.112 this IP, it would need a for extranet users your Web server is the unique IP address, a unique IP address from this role is your route.
Now I am on route to TP-Link as an example, describes how to operate the port mapping.
First, we enter
router
, IP addresses, check out our route WAN port.
Wan ports
The IP (27.40.127.248) is extranet users can uniquely identify your computer address routing IP, but at the same time a route is generally connected to several computers, which in turn how to make visitors find How about you, which need to port mapping.
Port mapping, also known as port forwarding. Port mapping process is like your home in a district where T Building, Room 112, your friends come to you, find the cell door, you do not know where to live layer which number? He asked the district security, the security of your home to tell him in detail the house number, so your friends easily find you home. The security is on the router, this process is extranet access network through port mapping metaphor.
Then we find the TP-Link route inside its port mapping function, this port mapping location is inside the "Transfer Rules" on "virtual server" (the route of each brand name is different, please look for their own detailed ) and then forwarding entry, as follows:
Virtual Service
80 Port Forwarding
In my TP-Link Below, I've added two entries, you are forwarding port 80 and port 8080 to the network 192.168.1.112 in the computer, and now as long as 80 or 8080 users through these two ports access routes IP, routing that will put users turn to 192.168.1.112 this computer where the local server.
Port Mapping
In addition to Web server can be set up to do so, FTP can also do a similar forwarding, FTP default port is 21.

Router port mapping to achieve external network to access the local server

Get a domain name and set up a local server environment

1 download peanut shell http://hsk.oray.com/download/ , get a free personal part of your secondary domain name, due to the use of a router, so your external IP network from time to time update, and peanut shells to achieve dynamic binding domain names and IP addresses;

 
Set 2 Tomcat, Tomcat download and installation will not repeat them, need their own Baidu tutorial after installation is complete, locate the installation location, like mine is C: \ Program Files \ Apache Software Foundation \ Tomcat 8.0, enter the conf file folder, find server.xml, opened with EditPlus or Notepad, found

  The port to 80, do not enter the port number so when you visit, find to and will defaultHost and name have changed your own domain name, so far, Tomcat setup is complete!

Note: The project here is the default page displayed Tomcat installation was successful, if you want to show your own website, increase child tag in server.xml under <Host> tag <Context path = "" docBase = "" reloadable = " true "/>, which, path is the virtual path, docBase project is the actual path, if you use MyEclipse New Web project is MyWebSite, you can set <Context path =" / MyWebSite " docBase =" C: \ Users \ Administrator \ workspace \ MyWebSite "reloadable =" true "/>

two router port mapping settings
I use TPLink-WR941N, other similar basic router settings, open 192.168.1.1, the default account passwords are admin, enter the router setup interface, click on the forwarding rules - virtual server - new new entry, set out as follows, where IP address is the address of your network, how to view your IP network? Please win key input cmd in the search box, open a command line enter ipconfig, to find the addresses under IPv4 local connections, ie IP network

 


Once set up, OK, save!
Then you will find on the website in the browser or open? Do not worry, because the default port router where the remote Web management is also set became 80, causing a port conflict, change the port and check it out on the line, the router management interface, click on the security features - Remote Web management, the Web management port 8080 or other free port

  Four open firewall ports

Well, everything is ready only a strong wind! To make other people outside the network visit your site, you have to give them an open port 80 ah, of course, you can completely turn off the firewall, but this is very dangerous,
under win7, desktop icons, right - -Windows Firewall Control Panel - Advanced Settings - inbound rule - New rules - port, provided by the following


 

 
Then all the way default, the name, fill in your name or other site, then click Done
 

 
Five test
Configuration is complete, test it, open your browser and enter your domain name, if nothing unexpected happens, should be able to successfully interviewed!

 

 



At present, many web developers and other installed IIS or Apache Web server, you can put your computer is configured to route a network server-centric.
Local intranet server test is more than enough, but some projects need to demonstrate to the customer acceptance of different places, but not enough time to put your website on top of the server, then we can use port mapping, so that customers can access our external network local server (for most web design Soho workers).
Network above has a lot of software can perform this function, but I want to talk today not rely on any software (I do not like to install the software), but their own set of port routing, reaching above their computers outside the network can be a local server access.
What is the port mapping, the following will be introduced in this port mapping out the premise is to have a route, the route did not trouble ... .. you buy a bar.
Our local Web server are generally Http: // localhost / or back with ports, LAN users are accessing the Web server through the network computer IP, for example, Web server computer's IP is 192.168.1.112, the other LAN users can access through https://192.168.1.112 to our Web server, but for extranet users, can not be accessed by visiting our Web server https://192.168.1.112 this IP, it would need a for extranet users your Web server is the unique IP address, a unique IP address from this role is your route.
Now I am on route to TP-Link as an example, describes how to operate the port mapping.
First, we enter
router
, IP addresses, check out our route WAN port.
Wan ports
The IP (27.40.127.248) is extranet users can uniquely identify your computer address routing IP, but at the same time a route is generally connected to several computers, which in turn how to make visitors find How about you, which need to port mapping.
Port mapping, also known as port forwarding. Port mapping process is like your home in a district where T Building, Room 112, your friends come to you, find the cell door, you do not know where to live layer which number? He asked the district security, the security of your home to tell him in detail the house number, so your friends easily find you home. The security is on the router, this process is extranet access network through port mapping metaphor.
Then we find the TP-Link route inside its port mapping function, this port mapping location is inside the "Transfer Rules" on "virtual server" (the route of each brand name is different, please look for their own detailed ) and then forwarding entry, as follows:
Virtual Service
80 Port Forwarding
In my TP-Link Below, I've added two entries, you are forwarding port 80 and port 8080 to the network 192.168.1.112 in the computer, and now as long as 80 or 8080 users through these two ports access routes IP, routing that will put users turn to 192.168.1.112 this computer where the local server.
Port Mapping
In addition to Web server can be set up to do so, FTP can also do a similar forwarding, FTP default port is 21.

Router port mapping to achieve external network to access the local server

Get a domain name and set up a local server environment

1 download peanut shell http://hsk.oray.com/download/ , get a free personal part of your secondary domain name, due to the use of a router, so your external IP network from time to time update, and peanut shells to achieve dynamic binding domain names and IP addresses;

 
Set 2 Tomcat, Tomcat download and installation will not repeat them, need their own Baidu tutorial after installation is complete, locate the installation location, like mine is C: \ Program Files \ Apache Software Foundation \ Tomcat 8.0, enter the conf file folder, find server.xml, opened with EditPlus or Notepad, found

  The port to 80, do not enter the port number so when you visit, find to and will defaultHost and name have changed your own domain name, so far, Tomcat setup is complete!

Note: The project here is the default page displayed Tomcat installation was successful, if you want to show your own website, increase child tag in server.xml under <Host> tag <Context path = "" docBase = "" reloadable = " true "/>, which, path is the virtual path, docBase project is the actual path, if you use MyEclipse New Web project is MyWebSite, you can set <Context path =" / MyWebSite " docBase =" C: \ Users \ Administrator \ workspace \ MyWebSite "reloadable =" true "/>

two router port mapping settings
I use TPLink-WR941N, other similar basic router settings, open 192.168.1.1, the default account passwords are admin, enter the router setup interface, click on the forwarding rules - virtual server - new new entry, set out as follows, where IP address is the address of your network, how to view your IP network? Please win key input cmd in the search box, open a command line enter ipconfig, to find the addresses under IPv4 local connections, ie IP network

 


Once set up, OK, save!
Then you will find on the website in the browser or open? Do not worry, because the default port router where the remote Web management is also set became 80, causing a port conflict, change the port and check it out on the line, the router management interface, click on the security features - Remote Web management, the Web management port 8080 or other free port

  Four open firewall ports

Well, everything is ready only a strong wind! To make other people outside the network visit your site, you have to give them an open port 80 ah, of course, you can completely turn off the firewall, but this is very dangerous,
under win7, desktop icons, right - -Windows Firewall Control Panel - Advanced Settings - inbound rule - New rules - port, provided by the following


 

 
Then all the way default, the name, fill in your name or other site, then click Done
 

 
Five test
Configuration is complete, test it, open your browser and enter your domain name, if nothing unexpected happens, should be able to successfully interviewed!

 

 



Guess you like

Origin www.cnblogs.com/kkxwze/p/12624779.html
Recommended