Project

General

Profile

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

Morgan Beeby, 02/22/2015 10:26 AM

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