Project

General

Profile

An example of working port-forwarding configuration » History » Version 15

Anchi Cheng, 11/04/2020 03:13 PM

1 15 Anchi Cheng
h1. Examples of working port-forwarding configuration
2
3
h2. Recent configuration using linux workstation to do the forwarding.
4
5
See Feature Issue #7491 for documentation and scripts provided by Bill Rice.
6 1 Anchi Cheng
7 11 Anchi Cheng
h2. (Paraphrased from description by Brian J. Gibbens) and tested at NRAMM
8 1 Anchi Cheng
9
Local network (192.168.xxx.xxx in this example) can not be accessed directly through
10 5 Anchi Cheng
institute network that has internet access before port forwarding.
11 1 Anchi Cheng
12 11 Anchi Cheng
h2. The computer hosts involved in this port-forwarding configuration listed by hostname and operation system in ( ):
13 1 Anchi Cheng
14 10 Anchi Cheng
# *ScopePC* (Windows) - The computer controlling the microscope
15
** connected only to local network
16 1 Anchi Cheng
** Static local IP addresses (192.168.200.99 in this example) is set to this host.
17 10 Anchi Cheng
# *SupportPC* (Windows) - The computer provided by FEI to protect *ScopePC* while allow RAPID system support from them through internet.
18 1 Anchi Cheng
** Two network cards are on this computer.
19 10 Anchi Cheng
** Local network Static IP address (192.168.200.100 in this example)
20
** Outbound institute network Static IP address (137.131.204.250 in this example)
21 11 Anchi Cheng
# *ProcessingLinux* (Linux) - The computer that runs Leginon processing.
22 10 Anchi Cheng
** Institute network Static IP address (137.131.204.500 in this example)
23 11 Anchi Cheng
# *DatabaseLInux* (Linux) - The computer that runs Leginon database server.  In a simpler setup this might be the same computer as the ProcessingLinux as illustrated in the figure below.
24
** Institute network Static IP address (137.131.204.700 in this example)
25 10 Anchi Cheng
26 14 Sargis Dallakyan
!PortForward.png!
27 1 Anchi Cheng
28 10 Anchi Cheng
*Ethernet cables should be connected like in the figure above.*
29 1 Anchi Cheng
30 10 Anchi Cheng
h2. TCP/IP Gateway Settings on *ScopePC*
31
This should be set to the local IP address of the *SupportPC* like this:
32
!gateway.png!
33
34
h2. Firewall settings on *SupportPC*
35 11 Anchi Cheng
** allow communication to *ScopePC* and *ProcessLinux* and *DatabaseLinux*.
36 1 Anchi Cheng
37 10 Anchi Cheng
h2. Hosts file addition if needed
38 1 Anchi Cheng
39
--Appropriate IP addresses and hostnames added to the hosts files
40 10 Anchi Cheng
(C:/WINDOWS/System32/drivers/etc/hosts.txt on Windows PC's and
41 1 Anchi Cheng
/etc/hosts on Linux).
42 10 Anchi Cheng
43 11 Anchi Cheng
* On *ScopePC* - list hostnames of *SupportPC*, *DatabaseLinux* and *ProcessingLinux*
44
* On *SupportPC* - list both hostnames of *ScopePC* and *DatabaseLinux* and *ProcessingLinux*
45
* On *ProcessingLinux* and *DatabaseLinux* - list hostname of *SupportPC* in additional to other linux hosts  but not *ScopePC* since all communication from *ScopePC* to these through *SupportPC* will appear to come from *SupportPC*
46 8 Jim Pulokas
47 10 Anchi Cheng
h2. Install port forwarding program AUTAPF which allows needed host/port specification on *SupportPC*
48
49 11 Anchi Cheng
The screen shot below shows that case where:
50
* Port 55555 is opened by legion/laumcher.py (often called Leginon Client") on *ScopePC*, intended to serve data to *ProcessingLinux*. (Fixed port)
51
* Ports 49152 and 49153 are opened by two processes to send/receive data to *ScopePC". (You may need to add more ports in case of blockage.  See [[Ports used by Leginon]])
52
* Port 3306 is dedicated for database connection. (Fixed port)
53 2 Anchi Cheng
54 10 Anchi Cheng
!autapf.PNG!
55 2 Anchi Cheng
56 12 Morgan Beeby
h1. Another account of setting up port forwarding
57
58
Based on the experiences of Morgan Beeby at Imperial College London, late 2014 / early 2015.
59
60
In my experience, setting up Leginon on a microscope hidden behind a support PC is relatively straightforwards as long as you are fairly painstaking at each step. Here is my experience distilled from a couple of installations.
61
62
Essentially the support PC is bridging between two networks, both of which it is connected to: the Microscope subnetwork and the wider LAN.
63
64
* Install Leginon server on the CentOS 6.5 server PC
65
* Install Leginon on the microscope PC using a memory stick to transfer files
66
* Work out the following information, and write it down precisely:
67
** Microscope PC parameters:
68
*** Hostname: run python, and type:
69
**** import socket
70
**** socket.gethostname()
71
*** IP address on the Microscope subnetwork: at C: prompt, type:
72
**** ipconfig/all
73
** Support PC parameters:
74
*** IP address for the support PC on both the Microscope subnetwork, and wider LAN: at C: prompt, type:
75
**** ipconfig/all
76
** Leginon server machine parameters:
77
*** Hostname:
78
**** import socket
79
**** socket.gethostname()
80
*** IP address on the wider LAN:
81
**** Type ifconfig in terminal
82
* Install the commercial version of AUTAPF on the support PC 
83
* Configure the Microscope PC
84
** c:/WINDOWS/system32/drivers/etc/hosts
85
*** Add a line with the Support PC's IP address and the Leginon server's hostname, separated by spaces. For example:
86
**** 192.168.1.1 leginon
87
*** Edit c:\Program Files\myami\sinedon.cfg so that 'host' reflects the Leginon server hostname
88 13 Morgan Beeby
* Configure support PC
89
** Edit c:/WINDOWS/system32/drivers/etc/hosts and add lines listing:
90
*** The leginon server IP address on the wider LAN against its hostname,
91
*** The microscope PC's IP address on the microscope subnetwork against its hostname
92
** Configure AUTAPF on the Support PC
93 12 Morgan Beeby
 
94 1 Anchi Cheng
95 13 Morgan Beeby
|_.Local IP	|_.Local port	|_.Forward to host	|_.Forward to port|
96
| Support PC IP (wider network)|	55555|	Microscope hostname| 55555|
97
|Support PC IP (microscope network)|	49153|	Leginon hostname|	49153|
98
|Support PC IP (microscope network)|	49154|	Leginon hostname|	49154|
99
|Support PC IP (microscope network)|	49155|	Leginon hostname|	49155|
100
|Support PC IP (microscope network)|	49156|	Leginon hostname|	49156|
101
|Support PC IP (microscope network)|	49157|	Leginon hostname|	49157|
102
|Support PC IP (microscope network)|	49158|	Leginon hostname|	49158|
103
|Support PC IP (microscope network)|	49159|	Leginon hostname|	49159|
104
|Support PC IP (microscope network)|	49160|	Leginon hostname|	49160|
105
|Support PC IP (microscope network)|	49161|	Leginon hostname|	49161|
106
|Support PC IP (microscope network)|	49162|	Leginon hostname|	49162|
107
|Support PC IP (wider network)|	49153|	Microscope hostname|	49153|
108
|Support PC IP (wider network)|	49154|	Microscope hostname|	49154|
109
|Support PC IP (wider network)|	49155|	Microscope hostname|	49155|
110
|Support PC IP (wider network)|	49156|	Microscope hostname|	49156|
111
|Support PC IP (wider network)|	49157|	Microscope hostname|	49157|
112
|Support PC IP (wider network)|	49158|	Microscope hostname|	49158|
113
|Support PC IP (wider network)|	49159|	Microscope hostname|	49159|
114
|Support PC IP (wider network)|	49160|	Microscope hostname|	49160|
115
|Support PC IP (wider network)|	49161|	Microscope hostname|	49161|
116
|Support PC IP (wider network)|	        49162|	Microscope hostname|	49162|
117
|Support PC IP (microscope network)|	3306|	Leginon hostname|	3306|
118 12 Morgan Beeby
119 13 Morgan Beeby
*** In AUTAPF, click PFO > Enable All.
120 12 Morgan Beeby
121
122
* Configure the Leginon server PC
123 13 Morgan Beeby
** Edit /etc/hosts files: Add Support PC IP address on the wider LAN and the microscope PC's hostname, e.g.:
124
*** 12.69.34.123 Tecnai-12345678
125
126 1 Anchi Cheng
127
128
______
129
130
[[Network Configuration| Go up]]
131
132
______