|
| 1 | +[](){#ref-guides-internet-access} |
| 2 | +# Internet Access on Alps |
| 3 | + |
| 4 | +The [Alps network][ref-alps-hsn] is mostly configured with private IP addresses (`172.28.0.0/16`). |
| 5 | +Login nodes have public IP addresses which means that they can directly access the internet, while a proxy server provides internet access for compute nodes. |
| 6 | + |
| 7 | +??? info "Compute node proxy configuration" |
| 8 | + |
| 9 | + Compute nodes are configured with the following environment variables to use the proxy server: |
| 10 | + |
| 11 | + ```bash |
| 12 | + https_proxy=http://proxy.cscs.ch:8080 |
| 13 | + http_proxy=http://proxy.cscs.ch:8080 |
| 14 | + no_proxy=.local, .cscs.ch, localhost, 148.187.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 |
| 15 | + HTTPS_PROXY=http://proxy.cscs.ch:8080 |
| 16 | + HTTP_PROXY=http://proxy.cscs.ch:8080 |
| 17 | + NO_PROXY=.local, .cscs.ch, localhost, 148.187.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 |
| 18 | + ``` |
| 19 | + |
| 20 | +## Using SSH through the proxy server |
| 21 | + |
| 22 | +While use of the proxy server is transparent for most use cases, e.g. cloning git repositories from GitHub over SSH requires additional configuration for compute nodes. |
| 23 | +Cloning over https works without additional configuration. |
| 24 | +To make SSH use the proxy server, add the following to your `~/.ssh/config` file: |
| 25 | + |
| 26 | +```bash |
| 27 | +Match Host *,!148.187.0.0/16,!192.168.0.0/16,!172.16.0.0/12,!10.0.0.0/8 exec "hostname -I | grep -vqF 148.187." |
| 28 | + ProxyCommand nc -X connect -x proxy.cscs.ch:8080 %h %p |
| 29 | +``` |
| 30 | + |
| 31 | +This configuration takes into account that login and compute nodes require a different setup. |
| 32 | + |
| 33 | +!!! info "Error message when cloning without the proxy set up for SSH" |
| 34 | + When cloning a git repository without the correct SSH configuration, cloning will time out as follows: |
| 35 | + ```bash |
| 36 | + [daint ][<user>@daint-ln001 ~]$ git clone [email protected]:open-mpi/ompi.git |
| 37 | + Cloning into 'ompi'... |
| 38 | + ssh: connect to host github.com port 22: Connection timed out |
| 39 | + fatal: Could not read from remote repository. |
| 40 | + |
| 41 | + Please make sure you have the correct access rights |
| 42 | + and the repository exists. |
| 43 | + ``` |
| 44 | + |
| 45 | +## Accessing the public IP of a node |
| 46 | + |
| 47 | +When on a login node configured with a public IP address, you can retrieve the public IP address for example as follows: |
| 48 | + |
| 49 | +```bash |
| 50 | +[daint][<user>@daint-ln001 ~]$ curl api.ipify.org |
| 51 | +148.187.6.19 |
| 52 | +``` |
0 commit comments