stelnet huawei что это

stelnet

Function

The stelnet command enables you to use the STelnet protocol to log in to another device from the current device.

Format

stelnet [ -a source-address ] host-ip [ port-number ] [ [ prefer_kex prefer_key-exchange ] | [ prefer_ctos_cipher prefer_ctos_cipher ] | [ prefer_stoc_cipher prefer_stoc_cipher ] | [ prefer_ctos_hmac prefer_ctos_hmac ] | [ prefer_stoc_hmac prefer_stoc_hmac ] ] * [ -ki aliveinterval [ -kc alivecountmax ] ]

stelnet ipv6 [ -a source-address ] host-ipv6 [ -oi interface-type interface-number ] [ port-number ] [ [ prefer_kex prefer_key-exchange ] | [ prefer_ctos_cipher prefer_ctos_cipher ] | [ prefer_stoc_cipher prefer_stoc_cipher ] | [ prefer_ctos_hmac prefer_ctos_hmac ] | [ prefer_stoc_hmac prefer_stoc_hmac ] ] * [ -ki aliveinterval [ -kc alivecountmax ] ]

Parameters

-a source-address

Specifies the STelnet source IP address.

IPv4: The value is in dotted decimal notation.

IPv6: The value is a 32-digit hexadecimal number, in the X:X:X:X:X:X:X:X format.

Specifies the IPv4 address or host name of the remote IPv4 STelnet server.

The value is a string of 1 to 255 case-insensitive characters without spaces.

Specifies the IPv6 address or host name of the remote IPv6 STelnet server.

The value is a string of 1 to 255 case-insensitive characters without spaces.

-oi interface-type interface-number

Specifies the outbound interface on the local device.

If the IPv6 address of a remote host is a link-local address, you must specify the outbound interface on the local device.

Specifies the port number that the SSH server is listening on.

The value is an integer that ranges from 1 to 65535. The default value 22 is the standard port number.

identity-key

Specifies the public key for server authentication.

The public key algorithm includes rsa and ecc.

To improve security, it is not recommended that you use RSA as the authentication algorithm.

user-identity-key

Specifies the public key algorithm for the client authentication.

The public key algorithm includes rsa and ecc.

To improve security, it is not recommended that you use RSA as the authentication algorithm.

prefer_kex prefer_key-exchange

Indicates the preferred key exchange algorithm.

Preferred key exchange algorithms supported depend on the ssh client key-exchange command settings.

prefer_ctos_cipher prefer_ctos_cipher

Indicates the preferred encryption algorithm for packets sent from the client to the server.

Preferred encryption algorithms supported depend on the ssh client secure-algorithms cipher command settings.

prefer_stoc_cipher prefer_stoc_cipher

Indicates the preferred encryption algorithm for packets sent from the server to the client.

Preferred encryption algorithms supported depend on the ssh client secure-algorithms cipher command settings.

prefer_ctos_hmac prefer_ctos_hmac

Indicates the preferred HMAC algorithm for packets sent from the client to the server.

Preferred HMAC algorithms supported depend on the ssh client secure-algorithms hmac command settings.

prefer_stoc_hmac prefer_stoc_hmac

Indicates the preferred HMAC algorithm for packets sent from the server to the client.

Preferred HMAC algorithms supported depend on the ssh client secure-algorithms hmac command settings.

-ki aliveinterval

Specifies the interval for sending keepalive packets when no packet is received.

The value is an integer that ranges from 1 to 3600, in seconds.

-kc alivecountmax

Specifies the number of times for no reply of keepalive packets.

The value is an integer that ranges from 3 to 10. The default value is 5.

Views

Default Level

Usage Guidelines

Usage Scenario

Logins through Telnet bring security risks because Telnet does not provide any authentication mechanism and data is transmitted using TCP in plain text. Compared with Telnet, SSH guarantees secure file transfer on a traditional insecure network by authenticating clients and encrypting data in bidirectional mode. The SSH protocol supports STelnet. You can run this command to use STelnet to log in to another device from the current device.

STelnet is a secure Telnet service. SSH users can use the STelnet service in the same way as the Telnet service.

When a fault occurs in the connection between the client and server, the client needs to detect the fault in real time and proactively release the connection. You need to set the interval for sending keepalive packets and the maximum number of times on the client that logs in to the server through STelnet.

Precautions

The SSH client can log in to the SSH server with no port specified only when the server is listening on port 22. If the server is listening on another port, the port number must be specified upon login.

Example

# Set keepalive parameters when the client logs in to the server through STelnet.

Источник

Настройка основных параметров у коммутаторов Huawei CloudEngine (на примере 6865)

Мы уже длительное время используем оборудование Huawei в продуктиве публичного облака. Недавно мы добавили в эксплуатацию модель CloudEngine 6865 и при добавлении новых устройств, появилась идея поделиться неким чек-листом или сборником базовых настроек с примерами.

В сети есть множество аналогичных инструкций для пользователей оборудования Cisco. Однако, для Huawei таких статей мало и иногда приходится искать информацию в документации или собрать из нескольких статей. Надеемся, будет полезно, поехали!

В статье опишем следующие пункты:

Первое подключение

По умолчанию коммутаторы Huawei поставляются без предварительных настроек. Без конфигурационного файла в памяти коммутатора, при включении запускается протокол ZTP (Zero Touch Provisioning). Не будем подробно описывать данный механизм, отметим лишь, что он удобен при работе с большим числом устройств или для осуществления настройки удалённо. Обзор ZTP можно посмотреть на сайте производителя.

Для первичной настройки без использования ZTP необходимо консольное подключение.

Параметры подключения (вполне стандартные)

Читайте также:  какие художественные средства использует автор при описании петуха назовите их приведите примеры

Transmission rate: 9600
Data bit (B): 8
Parity bit: None
Stop bit (S): 1
Flow control mode: None

После подключения Вы увидите просьбу задать пароль для консольного подключения.

Задаем пароль для консольного подключения

An initial password is required for the first login via the console.
Continue to set it? [Y/N]:
y
Set a password and keep it safe!
Otherwise you will not be able to login via the console.
Please configure the login password (8-16)
Enter Password:
Confirm Password:

Просто задайте пароль, подтвердите его и готово! Изменить пароль и прочие параметры аутентификации на консольном порту далее можно с помощью следующих команд:

Пример смены пароля

HUAWEI] user-interface console 0
[

HUAWEI-ui-console0] authentication-mode password
[

HUAWEI-ui-console0] set authentication password cipher
[*HUAWEI-ui-console0]
commit

Настройка стекирования (iStack)

Желательно при стекировании задействовать аплинки, скорость которых обычно выше, чем у портов для подключения конечных устройств. Таким образом, можно получить большую пропускную способность при помощи меньшего количества портов. Также, для большинства моделей есть ограничения по использованию гигабитных портов для стекирования. Рекомендуется использовать минимум 10G порты.

Есть два варианта настройки, которые немного отличаются в последовательности шагов:

Предварительная настройка коммутаторов с последующим их физическим соединением.

Сначала установка и подключение коммутаторов между собой, потом их настройка для работы в стеке.

Последовательность действий для этих вариантов выглядит следующим образом:

Последовательность действий для двух вариантов стекирования коммутаторов

Рассмотрим второй (более длительный) вариант настройки стека. Для этого нужно выполнить следующие действия:

Планируем работы с учётом вероятного простоя. Составляем последовательность действий.

Осуществляем монтаж и кабельное подключение коммутаторов.

Настраиваем базовые параметры стека для master-коммутатора:

3.1. Настраиваем нужные нам параметры

Пример:
system-view
[

HUAWEI] sysname SwitchA
[HUAWEI] commit
[

SwitchA-stack] stack member 1 priority 150
[SwitchA-stack] stack member 1 domain 10
[SwitchA-stack] quit
[SwitchA] commit

SwitchA] interface stack-port 1/1

[SwitchA-Stack-Port1/1] port member-group interface 10ge 1/0/1 to 1/0/4

Warning: After the configuration is complete,

1.The interface(s) (10GE1/0/1-1/0/4) will be converted to stack mode and be configured with the
port crc-statistics trigger error-down command if the configuration does not exist.

2.The interface(s) may go Error-Down (crc-statistics) because there is no shutdown configuration on the interfaces.Continue? [Y/N]: y

[SwitchA-Stack-Port1/1] commit
[

SwitchA-Stack-Port1/1] return

Далее, нужно сохранить конфигурацию и перезагрузить коммутатор:

save
Warning: The current configuration will be written to the device. Continue? [Y/N]: y
reboot
Warning: The system will reboot. Continue? [Y/N]: y

4. Выключаем порты для стекирования на master-коммутаторе (пример)

SwitchA] interface stack-port 1/1
[*SwitchA-Stack-Port1/1]
shutdown
[*SwitchA-Stack-Port1/1]
commit

HUAWEI] sysname SwitchB
[*HUAWEI]
commit
[

SwitchB-stack] stack member 1 priority 120
[*SwitchB-stack]
stack member 1 domain 10
[*SwitchB-stack]
stack member 1 renumber 2 inherit-config
Warning: The stack configuration of member ID 1 will be inherited to member ID 2
after the device resets. Continue? [Y/N]:
y
[*SwitchB-stack]
quit
[*SwitchB]
commit

Настраиваем порты для стекирования. Обратите внимание, что несмотря на то, что была введена команда “stack member 1 renumber 2 inherit-config”, member-id в конфигурации используется со значением “1” для SwitchB.

Так происходит, потому что member-id коммутатора будет изменён только после перезагрузки и до неё коммутатор по-прежнему имеет member-id, равный 1. Параметр “inherit-config” как раз нужен для того, чтобы после перезагрузки коммутатора все настройки стека сохранились для member 2, которым и будет коммутатор, т.к. его member ID был изменён со значения 1 на значение 2.

SwitchB] interface stack-port 1/1
[*SwitchB-Stack-Port1/1]
port member-group interface 10ge 1/0/1 to 1/0/4
Warning: After the configuration is complete,
1.The interface(s) (10GE1/0/1-1/0/4) will be converted to stack
mode and be configured with the port crc-statistics trigger error-down command if the configuration does
not exist.
2.The interface(s) may go Error-Down (crc-statistics) because there is no shutdown configuration on the
interfaces.
Continue? [Y/N]:
y
[*SwitchB-Stack-Port1/1]
commit
[

SwitchB-Stack-Port1/1] return

save
Warning: The current configuration will be written to the device. Continue? [Y/N]:
y
reboot
Warning: The system will reboot. Continue? [Y/N]:
y

6. Включаем порты стекирования на master-коммутаторе. Важно успеть включить порты до завершения перезагрузки коммутатора B, т.к. если включить их после, коммутатор B снова уйдёт в перезагрузку.

SwitchA] interface stack-port 1/1
[

SwitchA-Stack-Port1/1] undo shutdown
[*SwitchA-Stack-Port1/1]
commit
[

SwitchA-Stack-Port1/1] return

7. Проверяем работу стека командой “display stack

Пример вывода команды после правильной настройки

display stack

MemberID Role MAC Priority DeviceType Description

+1 Master 0004-9f31-d520 150 CE6850-48T4Q-EI

2 Standby 0004-9f62-1f40 120 CE6850-48T4Q-EI

+ indicates the device where the activated management interface resides.

8. Сохраняем конфигурацию стека командой “save”. Настройка завершена.

Настройка доступа

Выше мы работали через консольное подключение. Теперь к нашему коммутатору (стеку) нужно как-то подключаться по сети. Для этого ему нужен интерфейс (один или несколько ) с IP-адресом. Обычно для коммутатора адрес назначается на интерфейс в VLAN сети управления или на выделенный порт управления. Но тут, конечно же, всё зависит от топологии подключения и функционального назначения коммутатора.

Пример настройки адреса для интерфейса VLAN 1:

HUAWEI] interface vlan 1
[

HUAWEI-Vlanif1] ip address 10.10.10.1 255.255.255.0
[

HUAWEI-Vlanif1] commit

Предварительно можно явно создать Vlan и назначить ему имя, например:

Есть маленький лайфхак в плане именования — писать имена логических структур заглавными буквами (ACL, Route-map, иногда имена VLAN), чтобы было легче находить их в конфигурационном файле. Можете взять “на вооружение” 😉

Итак, у нас есть VLAN, теперь “приземляем” его на какой-нибудь порт. Для описанного в примере варианта делать это не обязательно, т.к. все порты коммутатора по умолчанию находятся в VLAN 1. Если хотим настроить порт в другой VLAN, пользуемся соответствующими командами:

Настройка порта в режиме access:

Switch] interface 25GE 1/0/20
[

Switch-25GE1/0/20] port link-type access
[

Switch-25GE1/0/20] port access vlan 10
[

Switch-25GE1/0/20] commit

Switch] interface 25GE 1/0/20
[

Switch-25GE1/0/20] port link-type trunk
[

Switch-25GE1/0/20] commit

С настройкой интерфейсов разобрались. Перейдём к конфигурации SSH.
Приведем только необходимый набор команд:

Назначаем имя коммутатору

HUAWEI] sysname SSH Server
[*HUAWEI] commit

SSH Server] rsa local-key-pair create //Generate the local RSA host and server key pairs.
The key name will be: SSH Server_Host
The range of public key size is (512

2048).
NOTE: Key pair generation will take a short while.
Input the bits in the modulus [default = 2048] :
2048
[*SSH Server]
commit

SSH Server] user-interface vty 0 4
[

SSH Server-ui-vty0-4] authentication-mode aaa
[SSH Server-ui-vty0-4]
user privilege level 3
[SSH Server-ui-vty0-4] protocol inbound ssh
[*SSH Server-ui-vty0-4] quit

[SSH Server] aaa
[SSH Server-aaa] local-user client001 password irreversible-cipher

[SSH Server-aaa] local-user client001 level 3
[SSH Server-aaa] local-user client001 service-type ssh
[SSH Server-aaa] quit
[SSH Server] ssh user client001 authentication-type password

SSH Server] stelnet server enable
[*SSH Server] commit

SSH Server] ssh user client001 service-type stelnet
[*SSH Server] commit

Настройка завершена. Если вы все сделали верно, то можно подключиться к коммутатору по локальной сети и продолжить работу.

Больше подробностей по настройке SSH можно найти в документации Huawei — первая и вторая статья.

Настройка базовых параметров системы

В этом блоке рассмотрим небольшое количество различных блоков команд для настройки наиболее популярных возможностей.

1. Настройка системного времени и его синхронизация по NTP.

Для настройки времени локально на коммутаторе можно использовать следующие команды:

clock timezone
clock datetime [ utc ] HH:MM:SS YYYY-MM-DD

Пример настройки времени локально

clock timezone MSK add 03:00:00
clock datetime 10:10:00 2020-10-08

Для синхронизации времени по NTP с сервером вводим следующую команду:

ntp unicast-server [ version number | authentication-keyid key-id | source-interface interface-type

Пример команды для синхронищации времени по NTP

ntp unicast-server 88.212.196.95
commit

ip route-static ip-address

Пример команды для создания маршрутов:

system-view
ip route-static
0.0.0.0 0.0.0.0 192.168.0.1
commit

3. Настройка режима работы протокола Spanning-Tree.

Для корректного использования нового коммутатора в существующей сети важно уделить внимание выбору режима работы STP. Также, неплохо бы сразу настроить его. Надолго останавливаться здесь не будем, т.к. тема достаточно обширная. Опишем лишь режимы работы протокола:

stp mode < stp | rstp | mstp | vbst > — в этой команде выбираем нужный нам режим. Режим по умолчанию: MSTP. Он же является рекомендуемым режимом для работы на коммутаторах Huawei. Обратная совместимость с RSTP имеется.

system-view
stp mode mstp
commit

4. Пример настройки порта коммутатора для подключения конечного устройства.

Рассмотрим пример настройки acess-порта для обработки траффика в VLAN10

[SW] interface 10ge 1/0/3
[SW-10GE1/0/3] port link-type access
[SW-10GE1/0/3] port default vlan 10
[SW-10GE1/0/3] stp edged-port enable
[*SW-10GE1/0/3] quit

Также, может быть полезна команда “stp bpdu-filter enable”.

5. Пример настройки Port-Channel в режиме LACP для подключения к другим коммутаторам или серверам.

[SW] interface eth-trunk 1
[SW-Eth-Trunk1] port link-type trunk
[SW-Eth-Trunk1] port trunk allow-pass vlan 10
[SW-Eth-Trunk1] mode lacp-static (или можно использовать lacp-dynamic)
[SW-Eth-Trunk1] quit
[SW] interface 10ge 1/0/1
[SW-10GE1/0/1] eth-Trunk 1
[SW-10GE1/0/1] quit
[SW] interface 10ge 1/0/2
[SW-10GE1/0/2] eth-Trunk 1
[*SW-10GE1/0/2] quit

Не забываем про “commit” и далее уже работаем с интерфейсом eth-trunk 1.
Проверить состояние агрегированного линка можно командой “display eth-trunk”.

Мы описали основные моменты настройки коммутаторов Huawei. Конечно, в тему можно погрузиться еще глубже и ряд моментов не описан, но мы старались показать основные, наиболее востребованные команды для первичной настройки.

Надеемся что этот “мануал” поможет вам настроить коммутаторы немного быстрее.
Также будет здорово, если вы в комментариях напишите команды, которых, по вашему мнению, не хватает в статье, но они также могут упростить настройку коммутаторов. Ну и, как обычно, будем рады ответить на ваши вопросы.

Источник

Connect to Telnet&STelnet

How Can I Connect to Telnet

Telnet is the standard protocol and main mode for the Internet remote login service. By default, port 23 is used. There are two types of Telnet login roles: client and server. You can run the Telnet client on the local host and remotely log in to the Telnet server to configure and manage the remote server. This method allows you to maintain multiple servers using a single user terminal, greatly facilitating operations.

When using Telnet to log in to the server, you must know the IP address and port number of the remote Telnet server (the default telnet port number is 23, which can be changed as required), user name, and password.

How Can I Use Telnet Commands

This section uses Huawei NE40E as an example to describe how to configure the Telnet server, change the Telnet port number, and log in to another device using Telnet.

For details, see Configuring a User to Log In Through Telnet in Huawei NE40E Product Documentation.

By default, port 23 is used to set up a connection. If this port is occupied, the connection fails to be set up. In this case, you can change the port number of the TCP connection on the Telnet server and run the following command to change the Telnet port number:

If the Telnet port number has been changed on the Telnet server, you must use the same port number to log in to the server through a client.

When a Huawei device functions as a Telnet client, you can run the following commands to log in to the Telnet server:

The following table describes the parameters in this command.

-i interface-type interface-number

Specifies the source interface type and number on the local device.

Specifies the name of a VPN instance to which the device belongs.

Specifies the IP address of the local device. Users can use the specified IP address to communicate with the Telnet server to ensure security.

If no source address is specified, the system will use the IP address of the outbound interface on the local device to initiate a Telnet connection.

Specifies the IP address of the remote device.

Specifies the TCP port number used by the remote device that functions as the Telnet server.

The value is an integer that ranges from 1 to 65535, and the default value is 23. If the Telnet port number has been changed on the Telnet server, you must use the same port number to log in to the server through a client.

Specifies the IPv6 address of the remote device when the remote Telnet server is of the IPv6 type.

-oi interface-type interface-number

Specifies the source IPv6 interface type and number on the local device.

For details, see Configuring a User to Log In Through Telnet in Huawei NE40E Product Documentation.

What Is an Example of Telnet

The user remotely logs in to the server through the terminal emulation program or the Telnet client program on the PC, as shown in Figure 1-1.

# Configure the Telnet server.

# Configure the Telnet client.

Huawei NE40E and NE20E-S can use Telnet redirection to log in to the Telnet server. On the network shown in Figure 1-4, there is a reachable route between the PC and Device A but no IP network connection between the PC and Device B. To remotely manage Device B, connect Device A’s AUX port to Device B’s console port, enable Telnet redirection on Device A, and use a specified port on the PC to remotely log in to and manage Device B.

For details, see Configuring Device Login Through Telnet Redirection in Huawei NE40E Product Documentation.

Security Risks

Although Telnet is easy to use and convenient, data is transmitted in plain text. Telnet transmits all user contents, including user names and passwords, in plain text on the Internet, which has security risks. Therefore, the Telnet service is disabled on many servers. STelnet is recommended for networks that have high security requirements.

The STelnet protocol uses port 22 by default. For details, see How Can I Connect to STelnet.

Troubleshooting

How do I use Telnet to test a port?

To check the Telnet port, run the telnet ip address port command.

For example, run the telnet 127.0.0.1 23 and telnet 127.0.0.1 80 command. The result shows that port 23 is unavailable and port 80 is available. See Figure 1-5.

2. Telnet is a plaintext transmission protocol. For security concerns, many firewalls disable Telnet. If remote login is required, you can configure firewalls to allow Telnet login.

Related Documents

For details about the Telnet application of Huawei switches, see Example for Logging In to the Device Through Telnet in Switches Product Documentation.

How Can I Connect to STelnet

STelnet is a secure Telnet service. Based on the SSH protocol, STelnet uses port 22 to establish a connection by default. SSH provides encryption and authentication functions to protect devices against attacks, such as IP address spoofing and simple password interception.

Similar to Telnet, STelnet has two roles: STelnet client and STelnet server. For convenience, Huawei NE40E and other devices can be either STelnet servers or clients to access other STelnet servers. The following uses Huawei NE40E as an STelnet server as an example to describe how to log in to a device using STelnet. See Figure 1-6

Configuration Roadmap

The PC functions as the STelnet client and needs to be configured with the STelnet client software. The following uses PuTTY as an example (assume that the putty.exe software has been installed on the client).

An Example of STelnet

# Configure the STelnet server.

# Configure the STelnet client.

Click Open. If the connection is normal, the system prompts you to enter the user name and password, as shown in Figure 1-8.

This section uses password authentication as an example. To learn how to use key authentication, see Configuring STelnet Login in Huawei NE40E Product Documentation.

Related Ducuments

For details about the Telnet application of Huawei switches, see Example for Logging In to the Device Through Telnet in Switches Product Documentation.

Источник

Информ портал о технике и не только