A Simple Lan Connected To The Internet; Port Forwarding - ControlByWeb WebRelay X-WR-1R12-1I5-5 User Manual

Single relay and input module
Table of Contents

Advertisement

WebRelay Users Manual

A Simple LAN connected to the Internet

The LAN in the example above can be connected to the Internet by adding a router and an Internet
connection. The router has two network connections. It has an Ethernet network connection to the LAN
and another connection to the Internet. Often the Internet connection is called a Wide Area Network
(WAN) connection. Each network connection on the router has an IP address. In our example, the IP
address on the LAN side of the router has an address of 192.168.1.1. The IP address on the WAN side
of the router has an IP address that has been assigned by the Internet Service Provider, such as
266.70.164.97. (This is not a valid IP address because each number cannot be larger than 255. It is
used in this example for illustration purposes only.)
In the example, when a user on the computer needs to access a server on the Internet, the computer
sends the request to the router at 192.168.1.1. The router sends the request to the ISP server on the
Internet. The ISP server does not send the response directly to the computer on the LAN, but to the
router at the IP address of 266.70.164.97. The router then forwards the response to the computer. This
way, all devices on the LAN share a single public IP address. This is called Network Address Translation
(NAT).

Port Forwarding

The router can be configured to allow outside access to the X-310S and the WebRelay. All requests
from the Internet to any device on the local network must use the public IP address (266.70.164.97).
With only a single IP address, TCP ports are used to identify the intended device for the incoming
message.
Using the mailing address analogy, the port is similar to a post office box. The IP address specifies the
location, and the port specifies the specific recipient. Port numbers can be set to any number between 1
and 65235. However, many port numbers are reserved for specific applications and should be avoided.
As a general rule, numbers above 8000 are safe to use. All of the ControlByWeb products come from
the factory with the HTTP port set to 80, which is the standard port for HTTP. In this example, the X-
310S HTTP port will be changed to port 8000 and WebRelay port will be changed to 8001. Once the
ports are changed in the two ControlByWeb™ devices, the router must be set up for port forwarding.
Port forwarding associates the IP address of each local device with an assigned port. In this example,
the address 192.168.1.25 for the X-310S would be associated with port 8000. The address 192.168.1.26
for WebRelay would be associated with port 8001. The X-310S would be accessed from the Internet by
entering the public IP address of the router, plus the port number assigned to the X-310S in the URL
window of the browser, http://266.70.164.97:8000. All Internet requests to the router for port 8000 would
be forwarded to the X-310S. Similarly, all request for port 8001 would be forwarded to WebRelay.
Note: When an HTTP request comes in to the router without the specific port specified
(http://266.70.164.97), the router will handle this as a port 80 request (default HTTP port). In other
words, http://266.70.164.97 is exactly the same as http://266.70.164.97:80.
Router configuration can vary widely. Some routers have the capability of translating the addresses and
the ports, which would require no port configuration change on the WebRelay. For example, the router
would be configured so that messages sent to http://266.70.164.97:8000 would be forwarded to
http://266.70.164.97:80, which is the default HTTP port.
An example screen shot of a router configuration is given below. This setup allows the two
ControlByWeb products in the above example to be accessed remotely from the Internet.
Xytronix Research & Design, Inc.
Page 73

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the WebRelay X-WR-1R12-1I5-5 and is the answer not in the manual?

Table of Contents