# 4.3 限制远程登录访问

当Telnet Server开启时，我们可以配置允许远程登录的IP地址，这样，可以限制用户只能从指定计算机远程登录交换机。

## 模式：

在全局配置模式中配置。

## 配置命令：

```java
Switch(config)#service telnet host host-ip
```

参数 host-ip 为允许远程登录的用户的IP地址。

## 说明：

你可以多次使用此命令设置多个允许远程登录的合法用户IP。如果不配置此项，默认是不限制使用者的IP地址。

## 删除配置的Telnet限制：

`Switch(config)#no service telnet host host-ip`

此命令只删除指定的IP。

`Switch(config)#no service telnet host`

此命令删除所有的IP。

## 配置举例：

只允许IP地址为192.168.1.10和192.168.1.30的用户用Telnet登录交换机。

```java
Switch>enable
Switch#configure terminal
Switch(config)#service telnet host 192.168.1.10
Switch(config)#service telnet host 192.168.1.30
```


---

# Agent Instructions: 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://kerwin.gitbook.io/ruijie/jiao-huan-chan-pin/path2/4.-yuan-cheng-deng-lu-telnet-de-pei-zhi/4.3-xian-zhi-yuan-cheng-deng-lu-fang-wen.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.
