Use Open Port to access a LAN server from the Internet
- product_router, task_configuration, tech_nat, tech_open_ports, tech_access_control
Open Port is a feature that redirects a connection request on several ports of router's WAN to host on router's LAN. While traversing the NAT, Open Port will not change the destination port. This document introduces how to set up open port on Vigor Router and some troubleshooting tips if it's not working as expected. In this example, we would like to provide RDP (Remote Desktop Protocol) access to a computer on LAN for Internet clients.
Since firmware version 3.8.4, we can also specify Source IP to limit the access to authorized IP only.
1. Go to NAT >> Port Redirection, and click on an available index to add a new profile.
2. Edit the profile as follows:
- Check Enable Open Ports
- Enter Comment for identification
- Choose Interface from which the Internet connection is coming
- Enter Private IP as the LAN IP of the computer for RDP access
- Enter Protocol/strong> and Portas which the RDP service is listening
- Click OK to save the configuration
3. With the above settings, when the connection requests sent to the router on port 3389, the router will forward the request to private IP 192.168.1.10. Now, the clients from the Internet can access the server on router's LAN by router's WAN IP and the defined public port.
Open Ports for Limited Source IP
Since firmware version 3.8.4, the network administrator can specify the source IP in Port Redirection and Open Ports. This function can be used in the situation we only want to allow some of the IPs to access the server behind the router, and increase the level of security while allowing Internet access.
For example, if the network administrator only allows the IP 200.200.200.200 to use the RDP service on 192.168.1.10.
1. Go to Object Setting >> IP Object, select one of the profile indexes.
2. Edit the profiles as follows:
- Enter the Name for identification.
- Select "Any" for Interface
- Select "Single" for Address Type
- Enter the IP Address that is allowed to access RDP at Start IP Address
- Click OK to save.
3. Go back to NAT >> Port Redirection, select the profile set for the RDP, select Source IP, click OK to save. Now, the router will only open the ports for IP 200.200.200.200 and redirect it to the RDP server.
Trouble-Shooting
If the open port is not working as expected, please check:
- If the port used by the local service on the router itself.
The commonly used ports in Vigor router are TCP 80 (for web server), TCP 443 (for web server and SSL VPN), and TCP 21 (for FTP). To avoid port conflicts, please change the ports in Management page ( or access control setting page for Vigor3900/2960 ) or disable those local services for Internet access if not in use.
- To ensure the server on LAN is alive, we can check
- If there are firewall rules on the server itself blocking the access.
- If the LAN server is accessible to other PC on the same network, or we can dial-in VPN to the Vigor router's LAN and try connecting to the server.
- Try telnet to the server on the specific port to check the connectivity. For example, telnet to 192.168.100.10:21 for an FTP server using the default port 21.
- The server's gateway must point to the Vigor router.
- There are no static route or route policy rules on the router that will route the server to the wrong gateway.
- There are no firewall rules on the router that will block the connection between the Internet client and the server.
- Capture the router’s LAN/WAN packets to find out which host does not respond.
- Details
Adjust NAT Session Timeout Value by CLI
- product_router, task_configuration, tech_nat, tech_cli
When a session initiates, the router will add a dynamic entry for the address and port mapping. NAT session timeout is the length of time that the router will keep that connection even if it's inactive. After that, the router will remove the entry, and stop accepting the incoming traffic.
Check the Current Value
Vigor Router has a different default timeout value for each application. We can check and tweak the timeout value via CLI. By input command portmaptime-l, the router will list the current value for each application.
Adjust the timeout value
To change the NAT timeout value, enter command portmaptime -[protocol] [time], where [protocol] is a character represents the application (use command portmaptime ? to check the options available), and [time] is the time value in seconds. For example, if you'd like to set the timeout value of UDP session to 5 minutes (300 seconds), this can be done by entering the command portmaptime -u 300.
After that, you may use the command portmaptime -l to check if the current value has changed.
Vigor2962, Vigor3910 and Vigor3912 support the settings on WUI.
- Details
WAN Inbound Load Balancing by Vigor3900
- DrayOS 4, imported, port_redirection, inbound_load_balance, wan_weight, dns_server, cname_record, ns_record
The document introduces Inbound Load Balance, which is a feature that allows Vigor2960/300B/3900, when acting as a DNS Server, to distribute the traffic across multiple WAN interfaces. In this article, there will be five parts of configurations:
- Enable Web/FTP services on the router
- Set weight for the Web server
- Set weight for the FTP server (sub-domain)
- Setting CNAME for the FILE server
- Wetting NS Record (optional)
Enable Web/FTP services on the router
1. Go to NAT >> Port Redirection to set up Port Redirection rule for the Web server and FTP server.
2. Go to WAN >> Inbound Load Balance to enable the services
Set weight for the Web server
3. Add a profile for the domain name jos.com and www.jos.tw, then assign a weight of 1 to WAN 1 and 2 for WAN2. The configuration example below means that when receiving three DNS queries, DNS server will return WAN1's IP for the first time, and WAN'2 IP for the next two times.
4. Go to Detail tab to add Additional A Record for Host Name www.jos.com to corresponds with jos.com with same weight 1:2.
After finishing the settings, we do "nslookup" to query the domain name for three times, and the results are reflecting the Interface Weights.
The test for "jos.com"
First DNS query:
>jos.comServer: [77.77.77.77]Address: 77.77.77.77Name: jos.comAddress: 77.77.77.77
Second DNS query:
>jos.comServer: [77.77.77.77]Address: 77.77.77.77Name: jos.comAddress: 88.88.88.88
Third DNS query:
>jos.comServer: [77.77.77.77]Address: 77.77.77.77Name: jos.com
Address: 88.88.88.88
The test for "www.jos.com"
First DNS query:
>www.jos.comServer: [77.77.77.77]Address: 77.77.77.77Name: jos.comAddress: 77.77.77.77Aliases: www.jos.com
Second DNS query:
>www.jos.comServer: [77.77.77.77]Address: 77.77.77.77Name: jos.comAddress: 88.88.88.88Aliases: www.jos.com
Third DNS query:
>www.jos.comServer: [77.77.77.77]Address: 77.77.77.77Name: jos.comAddress: 88.88.88.88Aliases: www.jos.com
Set weight for the File server (Sub-domain)
Add a profile for Sub-domain fileserver.jos.com with Load Balance Mode, and assign a weight of 1 to WAN 1 and 2 for WAN2.
Note: "Use Domain Setting" Mode means the weight will be the same as the weight of Domain Name jos.com.
Setting CNAME for the File server (Sub-domain)
After creating a profile for Sub-domain fileserver.jos.com, we may add CNAME Record for Sub-domain fileserver.jos.com via Inbound Load Balance >> Detail page. Click Add then input host "ftp" and select "fileserver" for Reference.
Setting up NS Records (Optional)
NS Record is not necessary since the NS records should be already available in the upper DNS servers. However, if you would like to add an NS record, add the NS Record with name server field and end it with "." (a dot) if the NS server locates on a different domain and has a different domain name such as vivian.com.
And add the NS Record with name server field ns1 and ns2 if the NS server is located in the same domain and have the same domain name such as jos.com.
- Details
Differences among Port Redirection, Open Ports and DMZ
- product_router, tech_nat, tech_port_forwarding, tech_open_ports, tech_dmz_host, task_comparison
The Vigor router supports three methods of port mapping to forward the traffic on the router's WAN interface to a specific LAN host and make it accessible from the Internet. There are Port Redirection, Open Ports, and DMZ Host.
| Port Redirection | Open Ports | DMZ Host | |
| Specify WAN Interface | Yes | Yes | Yes |
| Specify Destination Port | Yes | Yes | - |
| No. of Port Per Rule | One | Multiple | Multiple |
| Destination Port Translation | Yes | - | - |
| Priority | Highest | Lowest |
Port Redirection - The packet with the specified port number.is forwarded onto a specific LAN host You can also translate the port to another local port.
Open Ports - It is the same as Port Redirection (described above) but allows you to define a range of ports.
DMZ Host - This opens up a single host to the Internet completely. All incoming packets will be forwarded to the DMZ host, Except packets received in response to outgoing requests from other LAN host or incoming packets which match the rules of Port Redirection and Open Ports.
When using combinations of these three methods, there is a priority structure Port Redirection >> Open Ports >> DMZ. For example, if an Open Ports rule conflicts with a Port Redirection rule, then Port Redirection will take effect.
- Details
Difference between DMZ Host and DMZ Subnet
- firewall, DrayOS 4, imported, vigor_router, port_redirection, inter_lan_routing, dmz, open_ports, dmz_host, dmz_subnet
DMZ, which stands for Demilitarized Zone, is an additional layer of security between the WAN and the LAN. A router with a DMZ subnet will allow access to the DMZ from the WAN while having the LAN still protected by the firewall. The most common application of DMZ is to allow servers such as mail servers, HTTP/HTTPS web servers and FTP servers, to provide service to the hosts on WAN.
On Vigor routers, there are two ways to set up DMZ: DMZ host and DMZ subnet. Setting up a DMZ host will open a single host completely to the WAN, and all packets will be forwarded to this single host, unless:
- The packets match port redirection or open ports rules
- The packets destined to ports that the router itself is actively listening. (For example, if WAN management is enabled on the router on telnet and HTTP ports, inbound packets to ports 23 and 80 will be intercepted by the router).
The DMZ host is easy to set up and convenient to use. However, because the DMZ host is on the same subnet as other LAN devices, if an attacker breaches the security of this host, he or she may be able to compromise the security of the entire LAN.
In the illustration above, the green arrow indicates normal usage of the DMZ host, where users on the Internet can access the DMZ host using the WAN IP address of the router. If an attacker breaches the security of the DMZ host, the attacker may gain unauthorized access to other hosts on the same subnet, indicated by the red arrows.
We can avoid this type of threats can by using the DMZ subnet instead. Since it's an independent subnet, the DMZ host and other LAN subnet are isolated. Therefore, if an attacker breaks into a host on the DMZ subnet, he or she cannot access the other LAN subnets.
To allow WAN hosts to access servers on the DMZ subnet, the network administrator must set up Port Redirection or Open Ports rules to those servers. Also, to allow users on LAN subnets to access servers on the DMZ subnet, inter-LAN routing must be enabled, and firewall rules must be set up, as shown below.
The router will then allow hosts on the LAN subnets to access the DMZ subnet but prevent hosts on DMZ subnet from initiating sessions to the LAN subnets. The rule protects both the router and the rest of the LAN from unauthorized access from the DMZ.
Even though the configuration of the DMZ subnet is a bit more complicated than that of the DMZ host, the result of having a more secure networking environment makes it worthwhile.
The dedicated DMZ port on Vigor3220
On most Vigor routers with multiple LAN ports, the router will set aside one of the LAN port as the DMZ port when the DMZ subnet is enabled. The Vigor3220 series of routers, however, are equipped with one LAN port, plus a dedicated DMZ port that is always enabled.
- Details
