<a id="private-ip"></a>

# Private IP Address

> * [Basic Information](#private-ip-basics)
> * [Useage](#private-ip-usage)
>   * [Department Network (Laboratories, Departments, Graduate Schools, Centers, etc.)](#id3)
>   * [On-campus Shared Network (UEC Wireless, etc.)](#uec-wireless)
>   * [Semi-automated configuration of SSH access via `sol.edu.cc.uec.ac.jp`](#sol-edu-cc-uec-ac-jp-ssh)
> * [NTP server for campus (time synchronization)](#ntp)
>   * [Windows 11](#windows-11)
> * [FAQ](#faq)

<a id="private-ip-basics"></a>

## Basic Information

A **private IP address** is an IP address required to connect to a **private network** whose access range is limited to within the university. The private network is isolated from off-campus networks, with the exception of some routes. This reduces the risk of being attacked from outside the university, and the risk of unintended communications outside the university due to incorrect settings or malware infection. **As a general rule, when using the campus network, we ask that you use a private IP address.**

<!-- プライベートネットワークに接続している機器からは， **学外サービスを直接ご利用いただくことはできません** が -->
<!-- :doc:`プロキシ サーバ </network/proxy/index>`, -->
<!-- :doc:`SOCSKサーバ </network/socks/index>`, -->
<!-- :doc:`sol.edu.cc.uec.ac.jp を経由した学外への SSH </remote/ssh/index>` -->
<!-- をご利用いただくことで， **ほとんどの学外サービスがご利用可能** です． -->

<a id="private-ip-usage"></a>

## Useage

### Department Network (Laboratories, Departments, Graduate Schools, Centers, etc.)

When using a private network managed by each department such as a laboratory, department, graduate school, center, etc., the **IP address administrator** who manages the IP address blocks assigned to units such as buildings, floors, organizations, etc. You need to receive an assignment. Please ask your IP address administrator for details on assignment procedures.

Please refer to the [on-campus IP address management table](/in/IPaddr_new/IPAddr.php) 学内 for the contact information of the IP address administrator and the IP address block in charge.

If you wish to wire a new private network, please follow the instructions for [Campus Network Wiring](../wiring/index.md).

### On-campus Shared Network (UEC Wireless, etc.)

As a general rule, a private IP address will be assigned when connecting to [UEC Wireless](../uec_wireless/index.md), UEC wired authentication LAN, [VPN service](../../remote/vpn/index.md), and [Open Lab Network managed by the Information Infrastructure Center](../openlab/index.md), which are commonly used within the university.

<!-- これらの学内共用ネットワークから学外サービスへのアクセスは -->
<!-- :doc:`プロキシ サーバ </network/proxy/index>` や -->
<!-- :doc:`SOCSKサーバ </network/socks/index>` の設定が必要です． -->
<!-- .. _private_ip_outside_web: -->
<!-- 学外ウェブ，メールサービスの利用方法 -->
<!-- ==================================== -->
<!-- プライベートネットワークから学外のウェブやメールサービスを利用するためには，お使いのシステムやブラウザ等で -->
<!-- :doc:`プロキシ サーバ </network/proxy/index>` や -->
<!-- :doc:`SOCSKサーバ </network/socks/index>` を設定してください． -->
<!-- .. hint:: -->
<!-- ``yum``, ``apt``, ``dnf``, ``ports``, ``brew``, ``ports`` など，UNIX, macOS で利用されているパッケージマネージャも
各パッケージマネージャにプロキシの設定をすることで，プライベートネットワークから利用できます．
設定方法は各パッケージマネージャのマニュアルをご参照ください． -->
<!-- .. _private_ip_outside_ssh: -->
<!-- 学外サーバへ SSH によるのログイン方法 -->
<!-- ===================================== -->
<!-- 学外サーバへ SSH によるログインを行う場合は，一度 ``sol.edu.cc.uec.ac.jp`` を経由する必要があります． -->
<!-- ``sol.edu.cc.uec.ac.jp`` に SSH でログインし，そこからさらに目的の外部のサーバへ SSH 接続を行って下さい． -->
<!-- 詳細について :doc:`sol.edu.cc.uec.ac.jp を経由した学外への SSH </remote/ssh/index>` をご確認下さい． -->
<!-- また，次の方法で， ``sol.edu.cc.uec.ac.jp`` を経由した SSH を半自動的に行うことができます． -->

<a id="private-ip-outside-ssh-auto"></a>

### Semi-automated configuration of SSH access via `sol.edu.cc.uec.ac.jp`

<a id="private-ip-outside-ssh-auto-unix"></a>

#### UNIX，macOS

If you are using OpenSSH on UNIX or macOS, you can automatically perform SSH via `sol.edu.cc.uec.ac.jp` by making the following settings in `~/.ssh/config`. For details, please refer to the OpenSSH manual.

```bash
Host sol.edu.cc.uec.ac.jp
  User  [UEC アカウント名]
```

<!-- Host [最終的にSSHでログインする学外サーバ名]
User  [最終的にSSHでログインする学外サーバ上でのユーザ名]
ProxyCommand ssh -w %h:%p sol.edu.cc.uec.ac.jp -->

#### HINT
With this setting, off-campus services that use SSH, such as GitHub and BitBucket, can also be used from a private network.

<!-- .. _private_ip_outside_ssh_auto_tera:

Windows (Tera Term)
^^^^^^^^^^^^^^^^^^^

Tera Term の SSH ポート転送機能を利用して，``sol.edu.cc.uec.ac.jp`` を経由した SSH を行います．

SSH ポートフォワードを設定します．

1. Tera Termを起動し, :guilabel:`設定` |r_arrow| :guilabel:`SSH転送` の順に選択し，以下のウインドウから
 :guilabel:`追加` をクリックしてください．

.. figure:: ./imgs/ssh_portforwarding_teraterm01.png
  :width: 400pt
  :align: center

1. 下の画像のように, :guilabel:`ローカルのポート` には任意のポート番号 (今回は `12345`) を
 :guilabel:`リモート側ホスト` には接続したい外部サーバ名 (今回は `gakugai.server` ) を,
 ポート番号には `22` を入力して :guilabel:`OK` ボタンを押してください．

.. figure:: ./imgs/ssh_portforwarding_teraterm02.png
  :width: 400pt
  :align: center

1. 下記のように設定が追加されているのを確認し, :guilabel:`OK` ボタンを押して下さい．

.. figure:: ./imgs/ssh_portforwarding_teraterm03.png
  :width: 400pt
  :align: center -->
<!-- 2. SSH ポートフォワード経由で，学外サーバに接続します．

2-1. :guilabel:`ファイル` |r_arrow| :guilabel:`新しい接続` から，
     :guilabel:`ホスト` に ``sol.edu.cc.uec.ac.jp`` を入力し, :guilabel:`OK` を押して接続します.
     SSH ポートフォワードは接続中のみ維持されます． **SSH ポートフォワードを使用している間は，このウィンドウを閉じないでください．**

  .. figure:: ./imgs/ssh_portforwarding_teraterm04.png
    :width: 400pt
    :align: center

2-2. **2-1.で接続したウインドウを開いたまま**， :guilabel:`ファイル` |r_arrow| :guilabel:`新しい接続` から
     :guilabel:`ホスト` を ``127.0.0.1``, :guilabel:`TCP ポート` に
     1-2. で設定したポート番号 (今回は `12345`) を入力し，接続を行うと，
     1-2. で設定した外部サーバ (今回は `gakugai.server`) に接続が出来ます．

  .. figure:: ./imgs/ssh_portforwarding_teraterm05.png
    :width: 400pt
    :align: center -->
<!-- .. _private_ip_outside_ssh_auto_putty:

Windows (PuTTY)
^^^^^^^^^^^^^^^

PuTTY の ProxyCommand 機能を利用して， ``sol.edu.cc.uec.ac.jp`` を経由した SSH を行います。

1. PuTTY を起動して、以下のように設定し、 :guilabel:`Save` でセッションの設定に名前を付け(今回は `uecLocal` )を保存します。

.. figure:: ./imgs/ssh_portforwarding_putty01.png
  :width: 400pt
  :align: center -->
<!-- 2. 次に、 :guilabel:`Connection` |r_arrow| :guilabel:`Proxy` を選び下記のように入力してください。
 また、セッションの設定名を変更している場合は適宜 uecLocalの部分を変更してください。

::

  plink.exe -load uecLocal -nc %host:%port"

.. figure:: ./imgs/ssh_portforwarding_putty02.png
  :width: 400pt
  :align: center -->
<!-- 3. また、同様に下記のように接続したい学外のサーバ（今回は `gakugai.server` )を入力し、設定を保存します。
 今後同じサーバに接続する場合には、 :guilabel:`Saved Sessions` から外部への接続の設定(今回は `gakugaiserver` )を選択し、
 :guilabel:`Load` ボタンを押すことでこの設定で接続する事が出来るようになります。

.. figure:: ./imgs/ssh_portforwarding_putty03.png
  :width: 400pt
  :align: center -->

## NTP server for campus (time synchronization)

Off-campus time synchronization servers (NTP servers) cannot be used from the private network. We operate `ntp-east.cc.uec.ac.jp` (or `ntp.cc.uec.ac.jp`) as an on-campus NTP server. This NTP server cannot be used from outside the university.

The setting method for each OS is as follows.

> * [Windows 11](#windows-11)

### Windows 11

1. Open the control panel.
2. Click “Clock and Region”.

> ![image](network/private_ip/photo/2.png)
1. Click “Set date and time”.

> ![image](network/private_ip/photo/3.png)
1. On the screen that appears, select the “Internet Time” tab and click “Change Settings.”

> ![image](network/private_ip/photo/4.png)
1. In the displayed “Internet Time Settings” screen, enter `ntp-east.cc.uec.ac.jp` (or `ntp.cc.uec.ac.jp`) and click the “OK” button.

> ```bash
> ntp-east.cc.uec.ac.jp
> ```

> ![image](network/private_ip/photo/5.png)
<!-- macOS -->
<!-- ----- -->

## FAQ

* [Can I use off-campus services from my on-campus private IP address?](faq.md)
