© Microhard Systems Inc.
181
Appendix C: Port Forwarding Example (Page 2 of 2)
Step 2
Determine which external ports (WAN) are mapped to which internal IP Addresses and Ports (LAN). It is important to
understand which port, accessible on the outside, is connected or mapped to which devices on the inside. For this
example we are going to use the following ports, in this case it is purely arbitrary which ports are assigned, some
systems may be configurable, other systems may require specific ports to be used.
Description
WAN IP
External Port
Internal IP
Internal Port
IPn4G WebUI
74.198.186.193
80
192.168.168.1
80
PC2 Web Server
74.198.186.193
8080
192.168.168.20
80
PLC Web Server
74.198.186.193
8081
192.168.168.30
80
PLC Modbus
74.198.186.193
10502
192.168.168.30
502
Camera Web Server
74.198.186.193
8082
192.168.168.40
80
Notice that to the outside user, the IP Address for every device is the same, only the port number changes, but on the
LAN, each external port is mapped to an internal device and port number. Also notice that the port number used for the
configuration GUI for all the devices on the LAN is the same, this is fine because they are located on different IP
addresses, and the different external ports mapped by the IPn4G (80, 8080, 8081, 8082), will send the data to the
intended destination.
Step 3
Create a rule for each of the lines above. A rules does not need to
be created for the first line, as that was listed simply to show that
the external port 80 was already used, by default, by the IPn4G
itself. To create port forwarding rules, Navigate to the
Firewall >
Port Forwarding
menu. When creating rules, each rules requires
a unique name, this is only for reference and can be anything
desired by the user. Click on the
“Add Port Forwarding”
button
to add each rule to the IPn4G.
Once all rules have been added, the IPn4G configuration should
look something like what is illustrated in the screen shot to the
right. Be sure to
“Submit”
the Port Forwarding list to the IPn4G.
For best results, reboot the IPn4G.
Step 4
Configure the static addresses on all attached devices. Port forwarding required that all the attached devices have static
IP addresses, this ensure that the port forwarding rules are always correct, as changing IP addresses on the attached
devices would render the configured rules useless and the system will not work.
Step 5
Test the system. The devices connected to the IPn4G should be accessible remotely. To access the devices:
For the Web Server on the PC, use a browser to connect to 74.198.186:193:8080, in this case the same webserver is
running as in the IP-Passthrough example, so the result should be as follows:
To access the other devices/services: For the PLC Web Server: 74.198.186.193:8081, for the Camera
74.198.186.193:8082, and for the Modbus on the PLC telnet to 74.198.186.193:10502 etc.