> For the complete documentation index, see [llms.txt](https://docs.lala.gg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lala.gg/ieplnat.md).

# IEPL NAT使用教程

## 第一步：安装系统

```
不使用密钥安装系统，安装好后，系统root密码会通过邮件发送给您。
```

<figure><img src="/files/lkxem25SmmemfEVijHKT" alt=""><figcaption></figcaption></figure>

## 第二步：进VNC

```
安装好系统后，默认是无法连接的，需要进VNC配置路由。
在【选项】里面启用VNC，并点击网页VNC（由于某种原因，网页vnc可能无法使用，则需要使用vnc客户端连接）
```

<figure><img src="/files/yTePP17a3OmBzTDGziwm" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
如果面板上网页VNC无法访问（连接失败），则只能使用境内客户端进行vnc连接。推荐使用vnc viewer进行连接，vnc的连接信息可以在【选项】页面里找到。

如果面板上网页VNC无法访问（连接失败），则只能使用境内客户端进行vnc连接。推荐使用vnc viewer进行连接，vnc的连接信息可以在【选项】页面里找到。

如果面板上网页VNC无法访问（连接失败），则只能使用境内客户端进行vnc连接。推荐使用vnc viewer进行连接，vnc的连接信息可以在【选项】页面里找到。
{% endhint %}

<figure><img src="/files/svfVB7Wqs2QGGvvsFHmj" alt=""><figcaption></figcaption></figure>

## 第三步：登录系统，配置路由

輸入root账号密码登录系统（注意密码是邮件里面的登录密码，不是网页上显示的vnc登录密码），然后依次运行下面三条命令：(3线入口的nat机器，只需要配置一个内网ip的路由即可)

```
echo "101 CT" >> /etc/iproute2/rt_tables
ip route add default via 192.168.XX.1 dev eth0 table CT
ip rule add from 192.168.XX.XX table CT
```

{% hint style="danger" %}
第二条命令中的网卡名字 eth0 可能需要相应修改（本教程为debian11下写成，debian系应该可以直接使用，其他系统请使用ip a 命令查看具体的网卡名字，找192.168开头的ip所在的网卡名字）
{% endhint %}

{% hint style="danger" %}
注意将第二、三条命令中的ip需要替换为你机器的ip。（可以在网络中最后下面找到192.168开头的ip。特别注意只有需要修改命令中XX的部分，不是XX的请不要修改！不要修改！不要修改！）
{% endhint %}

```
例如：您的内网ip为 192.168.201.10，那么路由配置命令就是：
echo "101 CT" >> /etc/iproute2/rt_tables
ip route add default via 192.168.201.1 dev eth0 table CT
ip rule add from 192.168.201.10 table CT
（根据机器情况修改，切勿照搬）
```

{% hint style="danger" %}
每次重启后，若未配置第四步，则需要再次运行第二、第三两个命令。（第一条命令无需再运行）
{% endhint %}

<figure><img src="/files/Cls0Xu2hVQEnzaIpCae6" alt=""><figcaption></figcaption></figure>

配置好以后就可以正常使用了。

## 第四步（可选）：永久化路由

{% hint style="info" %}
配置此步后，每次重启无需再配置路由
{% endhint %}

### （一）新建脚本

```
#!/bin/bash

sleep 10
ip route add default via 192.168.XX.1 dev eth0 table CT
sleep 5
ip rule add from 192.168.XX.XX table CT
```

脚本内容如上,将上面XX同理进行替换,其他内容不变。（sleep时间可以调整，但不能太小，要保证脚本运行时候网卡已经正常启动起来，否则会失效）

脚本名字和路径可以自定义,这里我取名为rt.sh，路径为root根目录/root/

<figure><img src="/files/J5tHDs24HqAPavGEbtix" alt=""><figcaption></figcaption></figure>

### （二）赋予脚本可执行权限

```
chmod +x /root/rt.sh
```

### （三）配置crontab

在crontab中新增一条记录：（crontab -e进行编辑）

```sh
@reboot /root/rt.sh
```

<figure><img src="/files/2SLuOnQUsc6tWcff9LF6" alt=""><figcaption></figcaption></figure>

保存即可。

***

## Trouble Shooting

### 流量统计为单向，为什么面板上显示双向？

专线机器为双网卡，我们只统计单网卡流量，虽然显示入向+出向，实际等于单向流量。

### 配置crontab时，运行crontab -e提示：“bash：crontab command not found”。

{% hint style="info" %}
表示系统中未安装cron服务，安装即可。

apt install cron

或

yum install cron
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lala.gg/ieplnat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
