• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

H3C S6850&S9850&S9820-64H 典型配置举例-Release 655x系列-6W100

目录

37-AAA典型配置举例

本章节下载 37-AAA典型配置举例  (1.34 MB)

docurl=/cn/Service/Document_Software/Document_Center/Home/Switches/00-Public/Configure/Typical_Configuration_Example/H3C_S6850_S9850_S9820-64H_CE-6W100/202008/1323933_30005_0.htm

37-AAA典型配置举例

H3C S6850&S9850&S9820-64H AAA配置举例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright © 2020 新华三技术有限公司 版权所有,保留一切权利。

非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部,并不得以任何形式传播。

除新华三技术有限公司的商标外,本手册中出现的其它公司的商标、产品标识及商品名称,由各自权利人拥有。

本文档中的信息可能变动,恕不另行通知。



1  简介

本文档介绍了Telnet、SSH用户通过AAA服务器进行登录认证和授权的配置举例。

2  配置前提

本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。

本文假设您已了解AAA特性。

3  Telnet用户的HWTACACS认证和授权配置举例(ACS server)

3.1  组网需求

图1所示,通过在作为NAS的Device上配置远程HWTACACS认证、授权功能,实现Telnet用户的安全登录。要求在Device上配置实现:

·            HWTACACS服务器对登录Device的Telnet用户进行认证和授权,登录用户名为user@bbb,密码为aabbcc;

·            用户通过认证后可执行系统所有功能和资源的相关display命令。

图1 Telnet用户的远端HWTACACS认证和授权配置组网图

 

3.2  配置思路

·            为了使HWTACACS服务器能够识别合法的用户,在HWTACACS服务器上添加合法的Telnet用户名和密码。

·            为了使用户通过认证后可执行系统所有功能和资源的相关display命令,在HWTACACS服务器上设置用户角色为network-operator。

·            由于本例中用户登录Device要通过AAA处理,因此Telnet用户登录的用户界面认证方式配置为scheme。

·            为了实现通过HWTACACS来进行认证和授权,需要在Device上配置HWTACACS方案并指定相应的认证和授权服务器,并将其应用于Telnet用户所属的ISP域。

·            为了在Device和HWTACACS服务器之间安全地传输用户密码,并且能在Device上验证服务器响应报文未被篡改,在Device和HWTACACS服务器上都要设置交互报文时所使用的共享密钥。

3.3  适用产品及版本

表1 适用产品及版本

产品

软件版本

S6850系列

S9850系列

Release 6555P01

S9820-64H

Release 6555P01

 

3.4  配置步骤

3.4.1  配置HWTACACS

说明

本文以HWTACACS服务器ACS 4.0为例,说明该例中HWTACACS的基本配置。

 

1. 增加设备管理用户

# 登录进入HWTACACS管理平台,点击左侧导航栏“User-Setup”增加设备管理用户。

·            在界面上输入用户名“user@bbb”;

·            点击按钮“Add/Edit”进入用户编辑页面。

图2 用户创建界面

 

2. 配置设备管理用户

# 在用户编辑页面上配置设备管理用户。

·            配置用户密码“aabbcc”;

·            为用户选择组“Group 1”;

·            单击“Submit”完成操作。

图3 用户密码配置界面

 

3. 配置网络

# 点击左侧导航栏“Network Configuration”,在“AAA Client Hostname”处任意命名(本例为“Device”)后开始配置网络。

·            “AAA Client IP Address”一栏填写Device与HWTACACS服务器相连的接口的IP地址“10.1.1.2”。

·            “Key”一栏填写HWTACACS服务器和设备通信时的共享密钥“expert”,必须和Device上HWTACACS方案里配置的认证、授权和计费共享密钥相同。

·            在“Authenticate Using”的下拉框里选择“TACACS+ (Cisco IOS)”。

·            单击“Submit+Apply”按钮完成配置。

图4 网络配置界面

 

4. 设置组

# 单击左侧导航栏“Group Setup”,选取“Group 1”(与配置设备管理用户时为用户选择的组一致),单击“Edit Settings”进入编辑区。

·            在多选框中选择“Shell”(用户可以执行命令);

·            在多选框中选择“Custom attributes”,并在文本框中输入:roles=\”network-operator\”;

·            单击“Submit”后完成操作。

图5 选择组界面

 

图6 组配置界面

 

3.4.2  配置Device

# 创建VLAN 2,并将HundredGigE1/0/2加入VLAN 2。

<Device> system-view

[Device] vlan 2

[Device-vlan2] port hundredgige 1/0/2

[Device-vlan2] quit

# 配置VLAN接口2的IP地址。

[Device] interface vlan-interface 2

[Device-Vlan-interface2] ip address 192.168.57.12 255.255.255.0

[Device-Vlan-interface2] quit

# 创建VLAN 3,并将HundredGigE1/0/1加入VLAN 3。

[Device] vlan 3

[Device-vlan3] port hundredgige 1/0/1

[Device-vlan3] quit

# 配置VLAN接口3的IP地址。

[Device] interface vlan-interface 3

[Device-Vlan-interface3] ip address 10.1.1.2 255.255.255.0

[Device-Vlan-interface3] quit

# 开启Device的Telnet服务器功能。

[Device] telnet server enable

# 配置Telnet用户登录的用户界面采用scheme方式。

[Device] line vty 0 63

[Device-line-vty0-63] authentication-mode scheme

[Device-line-vty0-63] quit

# 配置HWTACACS方案hwtac。

[Device] hwtacacs scheme hwtac

# 配置主认证、授权和计费服务器的IP地址为10.1.1.1,认证、授权和计费的端口号为49(HWTACACS服务器的认证、授权和计费端口为TCP端口49)。

[Device-hwtacacs-hwtac] primary authentication 10.1.1.1 49

[Device-hwtacacs-hwtac] primary authorization 10.1.1.1 49

[Device-hwtacacs-hwtac] primary accounting 10.1.1.1 49

# 配置与认证、授权和计费服务器交互报文时的共享密钥均为明文expert。

[Device-hwtacacs-hwtac] key authentication simple expert

[Device-hwtacacs-hwtac] key authorization simple expert

[Device-hwtacacs-hwtac] key accounting simple expert

[Device-hwtacacs-hwtac] quit

# 配置ISP域的AAA方案,为login用户配置AAA认证方法为HWTACACS认证、授权和计费。

[Device] domain bbb

[Device-isp-bbb] authentication login hwtacacs-scheme hwtac

[Device-isp-bbb] authorization login hwtacacs-scheme hwtac

[Device-isp-bbb] accounting login hwtacacs-scheme hwtac

[Device-isp-bbb] quit

3.5  验证配置

Telnet用户可以使用用户名user@bbb和密码aabbcc通过认证,并且获得用户角色network-operator(用户通过认证后可执行系统所有功能和资源的相关display命令)。

3.6  配置文件

#

 telnet server enable

#

vlan 2 to 3

#

interface Vlan-interface2

 ip address 192.168.57.12 255.255.255.0

#

interface Vlan-interface3

 ip address 10.1.1.2 255.255.255.0

#

interface HundredGigE1/0/2

 port link-mode bridge

 port access vlan 2

#

interface HundredGigE1/0/1

 port link-mode bridge

 port access vlan 3

#

line vty 0 63

 authentication-mode scheme

 user-role network-operator

#

hwtacacs scheme hwtac

 primary authentication 10.1.1.1

 primary authorization 10.1.1.1

 primary accounting 10.1.1.1

 key authentication cipher $c$3$X3oR/wjLFjDqIyjdAmvjwAhiuqewGABglQ==

 key authorization cipher $c$3$5pmuq0RJ9UWMWDkRNNERX6HFM0aRv5txFg==

 key accounting cipher $c$3$FSdSiBY1u+ZNkAYYlPw9YkGxJA4iR8MDjw==

#

 domain bbb

  authentication login hwtacacs-scheme hwtac

  authorization login hwtacacs-scheme hwtac

  accounting login hwtacacs-scheme hwtac

#

4  SSH用户的RADIUS认证和授权配置举例(iMC server)

4.1  组网需求

图7所示,通过在作为NAS的Device上配置远程RADIUS认证、授权功能,实现SSH用户的安全登录。在网络架构上采用主从RADIUS服务器的方式来提高用户认证的稳定性。要求在Device上配置实现:

·            使用RADIUS服务器对登录Device的SSH用户进行认证和授权,登录用户名为hello@bbb,密码为aabbcc;

·            Device向RADIUS服务器发送的用户名带域名,服务器根据用户名携带的域名来区分提供给用户的服务。

·            用户通过认证后可执行系统所有功能和资源的相关display命令。

图7 SSH用户的远端RADIUS认证和授权配置组网图

 

4.2  配置思路

·            为了使主/从RADIUS服务器能够识别合法的用户,在主/从RADIUS服务器上添加合法的用户名和密码。

·            为了使用户通过认证后可执行系统所有功能和资源的相关display命令,在主/从RADIUS服务器上设置用户角色为network-operator。

·            因为SSH用户登录Device要通过AAA处理,因此SSH用户登录的用户界面认证方式配置为scheme。

·            为了实现通过RADIUS来进行认证和授权,需要在Device上配置RADIUS方案并指定相应的主/从认证和授权服务器,并将其应用于SSH用户所属的ISP域。

·            为了在Device和主/从RADIUS服务器之间安全地传输用户密码,并且能在Device上验证主/从RADIUS服务器响应报文未被篡改,在Device和主/从RADIUS服务器上都要设置交互报文时所使用的共享密钥。

4.3  适用产品及版本

表2 适用产品及版本

产品

软件版本

S6850系列

S9850系列

Release 6555P01

S9820-64H

Release 6555P01

 

4.4  配置注意事项

SSH服务器支持的ECDSA密钥对的类型为secp256r1和secp384r1。

SSH服务器仅支持默认名称的本地密钥对,不支持指定名称的本地密钥对。

4.5  配置步骤

4.5.1  配置RADIUS服务器

说明

·         本节以iMC为例(使用iMC版本为:iMC PLAT 7.0(E0102)、iMC EIA 7.0(E0201)),说明该例中RADIUS服务器的基本配置。

·         主从RADIUS服务器设置相同,本节以主RADIUS服务器设置为例。

 

1. 增加接入设备

# 登录进入iMC管理平台,选择“用户”页签,单击导航树中的[接入策略管理/接入设备管理/接入设备配置]菜单项,进入接入设备配置页面,在该页面中单击“增加”按钮,进入增加接入设备页面。

·            设置与Device交互报文时使用的认证和授权共享密钥为“expert”;

·            设置认证及计费的端口号分别为“1812”(RADIUS服务器的认证端口为UDP端口1812)和“1813”(RADIUS服务器的计费端口为UDP端口1813);

·            选择业务类型为“设备管理业务”;

·            选择接入设备类型为“H3C(General)”;

·            选择或手工增加接入设备,添加IP地址为10.1.1.2的接入设备;

·            其它参数采用缺省值,并单击<确定>按钮完成操作。

图8 增加接入设备

2014-03-26_140058.png

 

2. 增加设备管理用户

# 选择“用户”页签,单击导航树中的[接入用户管理视图/设备管理用户]菜单项,进入设备管理用户列表页面,在该页面中单击<增加>按钮,进入增加设备管理用户页面。

·            输入用户名“hello@bbb”和密码。

·            选择服务类型为“SSH”。

·            输入用户角色名“network-operator”

·            添加所管理设备的IP地址,IP地址范围为“10.1.1.0~10.1.1.255”。

·            单击<确定>按钮完成操作。

说明

添加的所管理设备的IP地址范围要包含添加的接入设备的IP地址。

 

图9 增加设备管理用户

 

4.5.2  配置Device

# 创建VLAN 2,并将HundredGigE1/0/2加入VLAN 2。

<Device> system-view

[Device] vlan 2

[Device-vlan2] port hundredgige 1/0/2

[Device-vlan2] quit

# 配置VLAN接口2的IP地址。

[Device] interface vlan-interface 2

[Device-Vlan-interface2] ip address 192.168.1.70 255.255.255.0

[Device-Vlan-interface2] quit

# 创建VLAN 3,并将HundredGigE1/0/1加入VLAN 3。

[Device] vlan 3

[Device-vlan3] port hundredgige 1/0/1

[Device-vlan3] quit

# 配置VLAN接口3的IP地址。

[Device] interface vlan-interface 3

[Device-Vlan-interface3] ip address 10.1.1.2 255.255.255.0

[Device-Vlan-interface3] quit

# 生成RSA密钥对。

[Device] public-key local create rsa

The range of public key modulus is (512 ~ 4096).

If the key modulus is greater than 512, it will take a few minutes.

Press CTRL+C to abort.

Input the modulus length [default = 1024]:

Generating Keys...

...........

Create the key pair successfully.

# 生成DSA密钥对。

[Device] public-key local create dsa

The range of public key modulus is (512 ~ 2048).

If the key modulus is greater than 512, it will take a few minutes.

Press CTRL+C to abort.

Input the modulus length [default = 1024]:

Generating Keys...

.......

Create the key pair successfully.

# 生成secp256r1类型的ECDSA密钥对。

[Device] public-key local create ecdsa secp256r1

Generating Keys...

Create the key pair successfully.

# 生成secp384r1类型的ECDSA密钥对。

[Device] public-key local create ecdsa secp384r1

Generating Keys...

.

Create the key pair successfully.

# 使能SSH服务器功能。

[Device] ssh server enable

# 配置SSH用户登录采用AAA认证方式。

[Device] line vty 0 63

[Device-line-vty0-63] authentication-mode scheme

[Device-line-vty0-63] quit

# 创建RADIUS方案rad。

[Device] radius scheme rad

# 配置主认证服务器的IP地址为10.1.1.1,认证端口号为1812。

[Device-radius-rad] primary authentication 10.1.1.1 1812

# 配置从认证服务器的IP地址为10.1.1.11,认证端口号为1812。

[Device-radius-rad] secondary authentication 10.1.1.11 1812

# 配置主计费服务器的IP地址为10.1.1.1,计费端口号为1813。

[Device-radius-rad] primary accounting 10.1.1.1 1813

# 配置从计费服务器的IP地址为10.1.1.11,计费端口号为1813。

[Device-radius-rad] secondary accounting 10.1.1.11 1813

 # 配置与认证和计费服务器交互报文时的共享密钥为明文expert。

[Device-radius-rad] key authentication simple expert

[Device-radius-rad] key accounting simple expert

# 配置向RADIUS服务器发送的用户名要携带域名。

[Device-radius-rad] user-name-format with-domain

[Device-radius-rad] quit

# 创建ISP域bbb,为login用户配置AAA认证方法为RADIUS认证、授权和计费。

[Device] domain bbb

[Device-isp-bbb] authentication login radius-scheme rad

[Device-isp-bbb] authorization login radius-scheme rad

[Device-isp-bbb] accounting login radius-scheme rad

[Device-isp-bbb] quit

4.6  验证配置

用户向Device发起SSH连接,在SSH客户端按照提示输入用户名hello@bbb和密码aabbcc通过认证,并且获得用户角色network-operator(用户通过认证后可执行系统所有功能和资源的相关display命令)。

主服务器可达时,设备与主RADIUS服务器进行交互。

# 显示主服务器可达时的RADIUS方案的配置信息。

<Sysname> display radius scheme

Total 1 RADIUS schemes

 

------------------------------------------------------------------

RADIUS scheme name: rad

  Index: 0

  Primary authentication server:

    Host name: Not Configured

    IP   : 10.1.1.1                                 Port: 1812

    VPN  : Not configured

    State: Active

    Test profile: Not configured

    Weight: 0

  Primary accounting server:

    Host name: Not Configured

    IP   : 10.1.1.1                                 Port: 1813

    VPN  : Not configured

    State: Active

    Weight: 0

  Second authentication server:

    Host name: Not Configured

    IP   : 10.1.1.11                                Port: 1812

    VPN  : Not configured

    State: Active

    Test profile: Not configured

    Weight: 0

  Second accounting server:

    Host name: Not Configured

    IP   : 10.1.1.11                                Port: 1813

    VPN  : Not configured

    State: Active

    Weight: 0

  Accounting-On function                     : Disabled

    extended function                        : Disabled

    retransmission times                     : 50

    retransmission interval(seconds)         : 3

  Timeout Interval(seconds)                  : 3

  Retransmission Times                       : 3

  Retransmission Times for Accounting Update : 5

  Server Quiet Period(minutes)               : 5

  Realtime Accounting Interval(seconds)      : 720

  Stop-accounting packets buffering          : Enabled

    Retransmission times                     : 500

  NAS IP Address                             : Not configured

  VPN                                        : Not configured

  User Name Format                           : with-domain

  Data flow unit                             : Byte

  Packet unit                                : One

  Attribute 15 check-mode                    : Strict

  Attribute 25                               : Standard

  Attribute Remanent-Volume unit             : Kilo

  server-load-sharing                        : Disabled

  Attribute 31 MAC format                    : HH-HH-HH-HH-HH-HH

  Stop-accounting packets send-force         : Disabled

  Reauthentication server selection          : Inherit

主服务器不可达时,再查看RADIUS方案的配置信息,会发现主服务器的状态从Active变为Block。此时,设备变成与从RADIUS服务器进行交互。

4.7  配置文件

#

vlan 2 to 3

#

interface Vlan-interface2

 ip address 192.168.1.70 255.255.255.0

#

interface Vlan-interface3

 ip address 10.1.1.2 255.255.255.0

#

interface HundredGigE1/0/2

 port link-mode bridge

 port access vlan 2

#

interface HundredGigE1/0/1

 port link-mode bridge

 port access vlan 3

#

line vty 0 63

 authentication-mode scheme

 user-role network-operator

#

 ssh server enable

#

radius scheme rad

 primary authentication 10.1.1.1

 primary accounting 10.1.1.1

 secondary authentication 10.1.1.11

 secondary accounting 10.1.1.11

 key authentication cipher $c$3$GBZ1jhslcGwSOpSejsESMnOr8Gb8SIT5ew==

 key accounting cipher $c$3$nGb/DWK8pxbHaLXQVc+xsmbUr1etIZVd7Q==

#

domain bbb

 authentication login radius-scheme rad

 authorization login radius-scheme rad

 accounting login radius-scheme rad

#

5  SSH用户的RADIUS认证和授权配置举例(ACS server)

5.1  组网需求

图10所示,网络管理员需要远程登录到网关设备Device上进行系统配置和维护。为了提高远程访问的安全性,需要在Device和管理员主机之间建立SSH连接,具体要求如下:

·            Device使用Cisco ACS server作为RADIUS服务器对Stelnet客户端进行认证和授权;

·            管理员在主机上运行Stelnet客户端,并采用用户名manager@bbb和密码1234ab##登录Device,且登录后享有最高配置权限。

图10 SSH用户的RADIUS认证和授权配置举例

 

5.2  配置思路

·            为了保证Device可以使用ACS server,需要在ACS server上完成添加AAA client以及用户的相关配置。

·            为了要求用户通过用户线登录Device时输入用户名和密码,需要在Device上配置登录用户线的认证方式为scheme方式。

·            为了保证Device能够对登录用户进行认证和授权,需要在Device上完成AAA配置,包括配置ISP域,以及与RADIUS服务器交互的RADIUS方案。

·            为了保证管理员可以运行采用了不同公钥算法的Stelnet客户端与Device建立SSH连接,需要在Device上生成RSA、DSA、ECDSA密钥对。

·            为了使Stelnet用户登录设备后能享有最高配置权限,指定缺省用户角色为network-admin。

1.1  适用产品及版本

表3 适用产品及版本

产品

软件版本

S6850系列

S9850系列

Release 6555P01

S9820-64H

Release 6555P01

 

5.3  配置注意事项

SSH服务器支持的ECDSA密钥对的类型为secp256r1和secp384r1。

SSH服务器仅支持默认名称的本地密钥对,不支持指定名称的本地密钥对。

5.4  配置步骤

5.4.1  配置RADIUS服务器

说明

·         本文以ACSv4.2为例,说明RADIUS服务器的基本配置。

·         在进行下面的配置之前,请保证设备管理员的主机与ACS服务器之间路由可达。

 

(1)       登录ACS server

# 如图11所示的Web登录页面中,输入Web登录用户名和密码,单击“Login”按钮,即可登录ACS server。

图11 登录ACS服务器

 

(2)       添加接入设备

# 在左侧导航栏中选择[Network Configuration],打开网络配置界面,单击<Add Entry>,进入AAA Client的编辑页面。

图12 添加接入设备

 

# 在AAA Client的编辑页面中进行如下配置:

·            输入接入设备名称、接入设备IP地址、交互RADIUS报文的共享密钥;

·            选择认证协议类型为“RADIUS (IETF)”;

·            单击“Submit + Apply”按钮完成操作。

图13 配置接入设备

 

(3)       添加登录用户

# 在左侧导航栏中选择[User Setup],打开用户配置界面,在文本框中输入用户名“manager”,单击“Add/Edit”后,进入该用户的编辑页面。

图14 添加登录用户

 

# 填写用户的相关信息,配置用户登录密码,选择用户所属组(本例中使用缺省组)。

图15 配置登录用户信息

 

5.4.2  配置Device

# 创建VLAN 2,并将HundredGigE1/0/2加入VLAN 2。

<Device> system-view

[Device] vlan 2

[Device-vlan2] port hundredgige 1/0/2

[Device-vlan2] quit

# 配置VLAN接口2的IP地址。

[Device] interface vlan-interface 2

[Device-Vlan-interface2] ip address 192.168.1.65 255.255.255.0

[Device-Vlan-interface2] quit

# 创建VLAN 3,并将HundredGigE1/0/1加入VLAN 3。

[Device] vlan 3

[Device-vlan3] port hundredgige 1/0/1

[Device-vlan3] quit

# 配置VLAN接口3的IP地址。

[Device] interface vlan-interface 3

[Device-Vlan-interface3] ip address 10.1.1.2 255.255.255.0

[Device-Vlan-interface3] quit

# 生成RSA密钥对。

[Device] public-key local create rsa

The range of public key modulus is (512 ~ 4096).

If the key modulus is greater than 512, it will take a few minutes.

Press CTRL+C to abort.

Input the modulus length [default = 1024]:

Generating Keys...

...

Create the key pair successfully.

# 生成DSA密钥对。

[Device] public-key local create dsa

The range of public key modulus is (512 ~ 2048).

If the key modulus is greater than 512, it will take a few minutes.

Press CTRL+C to abort.

Input the modulus length [default = 1024]:

Generating Keys...

........

Create the key pair successfully.

# 生成secp256r1类型的ECDSA密钥对。

[Device] public-key local create ecdsa secp256r1

Generating Keys...

Create the key pair successfully.

# 生成secp384r1类型的ECDSA密钥对。

[Device] public-key local create ecdsa secp384r1

Generating Keys...

.

Create the key pair successfully.

# 使能SSH服务器功能。

[Device] ssh server enable

# 设置Stelnet客户端登录用户界面的认证方式为scheme。

[Device] line vty 0 63

[Device-line-vty0-63] authentication-mode scheme

[Device-line-vty0-63] quit

# 使能缺省用户角色授权功能,使得认证通过后的用户具有缺省的用户角色network-admin。

[Device] role default-role enable network-admin

# 创建RADIUS方案rad。

[Device] radius scheme rad

# 配置主认证服务器的IP地址为10.1.1.1,认证端口号为1812。

[Device-radius-rad] primary authentication 10.1.1.1 1812

# 配置与认证服务器交互报文时的共享密钥为明文expert。

[Device-radius-rad] key authentication simple expert

# 配置向RADIUS服务器发送的用户名不携带域名。

[Device-radius-rad] user-name-format without-domain

[Device-radius-rad] quit

# 创建ISP域bbb,为login用户配置AAA认证方法为RADIUS认证/授权、不计费。由于RADIUS服务器的授权信息是随认证应答报文发给RADIUS客户端的,所以必须保证认证和授权方案相同。

[Device] domain bbb

[Device-isp-bbb] authentication login radius-scheme rad

[Device-isp-bbb] authorization login radius-scheme rad

[Device-isp-bbb] accounting login none

[Device-isp-bbb] quit

5.5  验证配置

说明

Stelnet客户端软件有很多,例如PuTTY、OpenSSH等。本文中仅以客户端软件PuTTY0.58为例,说明Stelnet客户端的配置方法。

 

# 安装PuTTY 0.58软件。

# 打开PuTTY.exe程序,点击“Session”功能区,在图16所示的配置界面中进行如下配置:

·            在“Host Name(or IP address)”文本框中输入Stelnet服务器的IP地址为192.168.1.65。

·            在“Port”文本框中输入SSH协议端口号22。

·            在“Connection type”区域选择SSH协议。

# 单击<Open>按钮。

图16 Stelnet客户端配置界面

 

# 如果弹出图17所示“PuTTY Security Alert”对话框,请根据实际情况做出选择。本例中选择信任该服务器,则单击“Yes”按钮。

图17 Stelnet客户端登录界面(一)

 

# 如果弹出图18所示“PuTTY Security Alert”对话框,请根据实际情况做出选择。本例中选择信任该主机密钥,则单击“Yes”按钮。

图18 Stelnet客户端登录界面(二)

 

# 在如下登录界面中输入用户名“manager@bbb”和密码“1234ab##”,即可成功登录设备使用所有命令。

login as: manager@bbb

manager@bbb@192.168.1.65's password:

 

******************************************************************************

* Copyright (c) 2004-2019 New H3C Technologies Co., Ltd. All rights reserved.*

* Without the owner's prior written consent,                                 *

* no decompiling or reverse-engineering shall be allowed.                    *

******************************************************************************

 

<Device>

5.6  配置文件

#

vlan 2 to 3

#

interface Vlan-interface2

 ip address 192.168.1.65 255.255.255.0

#

interface Vlan-interface3

 ip address 10.1.1.2 255.255.255.0

#

interface HundredGigE1/0/2

 port link-mode bridge

 port access vlan 2

#

interface HundredGigE1/0/1

 port link-mode bridge

 port access vlan 3

#

line vty 0 63

 authentication-mode scheme

 user-role network-operator

#

ssh server enable

#

radius scheme rad

 primary authentication 10.1.1.1

 key authentication cipher $c$3$+zkawxNT2KQ1IhixdPDszSvNAH5b+yFMIQ==

 user-name-format without-domain

#

domain bbb

 authentication login radius-scheme rad

 authorization login radius-scheme rad

 accounting login none

#

role default-role enable network-admin

#

6  SSH用户的HWTACACS认证和授权配置举例(ACS server)

6.1  组网需求

图19所示,网络管理员需要远程登录到网关设备Device上进行系统配置和维护。为了提高远程访问的安全性,需要在Device和管理员主机之间建立SSH连接,具体要求如下:

·            Device使用Cisco ACS server作为HWTACACS服务器对Stelnet客户端进行认证和授权;

·            管理员在主机上运行Stelnet客户端,并采用用户名manager@bbb和密码1234ab##登录Device,且登录后享有最高配置权限。

图19 SSH用户的HWTACACS认证和授权配置举例

 

6.2  配置思路

·            为了保证Device可以使用ACS server认证用户,需要在ACS server上完成添加AAA client以及用户的相关配置。

·            为了要求用户通过用户线登录Device时输入用户名和密码,需要在Device上配置登录用户线的认证方式为scheme方式。

·            未了保证Device能够对登录用户进行认证和授权,需要在Device上完成AAA配置,包括配置ISP域,以及与HWTACACS服务器交互的TACACS方案。

·            为了保证管理员可以运行采用了不同公钥算法的Stelnet客户端与Device建立SSH连接,需要在Device上生成RSA、DSA、ECDSA密钥对。

·            为了使Stelnet用户登录设备后能享有最高配置权限,指定缺省用户角色为network-admin。

6.3  适用产品及版本

表4 适用产品及版本

产品

软件版本

S6850系列

S9850系列

Release 6555P01

S9820-64H

Release 6555P01

 

6.4  配置注意事项

SSH服务器支持的ECDSA密钥对的类型为secp256r1和secp384r1。

SSH服务器仅支持默认名称的本地密钥对,不支持指定名称的本地密钥对。

6.5  配置步骤

6.5.1  配置HWTACACS服务器

说明

·         本文以ACSv4.2为例,说明TACACS server的基本配置。

·         在进行下面的配置之前,请保证设备管理员的主机与ACS服务器之间路由可达。

 

(1)       登录ACS server

# 如图20所示的Web登录页面中,输入Web登录用户名和密码,单击“Login”按钮,即可登录ACS server。

图20 登录ACS server

 

(2)       添加接入设备

# 在左侧导航栏中选择[Network Configuration],打开网络配置界面,单击<Add Entry>,进入AAA Client的编辑页面。

图21 添加接入设备

 

# 在AAA Client的编辑页面中进行如下配置:

·            输入接入设备名称、接入设备IP地址、交互TACACS报文的共享密钥;

·            选择认证协议类型为“TACACS+ (Cisco IOS)”;

·            单击“Submit + Apply”按钮完成操作。

图22 配置接入设备

 

(3)       添加登录用户

# 在左侧导航栏中选择[User Setup],打开用户配置界面,在文本框中输入用户名“manager”,单击“Add/Edit”后,进入该用户的编辑页面。

图23 添加登录用户

 

# 填写用户的相关信息,配置用户登录密码,选择用户所属组(本例中使用缺省组)。

图24 配置登录用户信息

 

6.5.2  配置Device

# 创建VLAN 2,并将HundredGigE1/0/2加入VLAN 2。

<Device> system-view

[Device] vlan 2

[Device-vlan2] port hundredgige 1/0/2

[Device-vlan2] quit

# 配置VLAN接口2的IP地址。

[Device] interface vlan-interface 2

[Device-Vlan-interface2] ip address 192.168.1.65 255.255.255.0

[Device-Vlan-interface2] quit

# 创建VLAN 3,并将HundredGigE1/0/1加入VLAN 3。

[Device] vlan 3

[Device-vlan3] port hundredgige 1/0/1

[Device-vlan3] quit

# 配置VLAN接口3的IP地址。

[Device] interface vlan-interface 3

[Device-Vlan-interface3] ip address 10.1.1.2 255.255.255.0

[Device-Vlan-interface3] quit

# 生成RSA密钥对。

[Device] public-key local create rsa

The range of public key modulus is (512 ~ 4096).

If the key modulus is greater than 512, it will take a few minutes.

Press CTRL+C to abort.

Input the modulus length [default = 1024]:

Generating Keys...

...

Create the key pair successfully.

# 生成DSA密钥对。

[Device] public-key local create dsa

The range of public key modulus is (512 ~ 2048).

If the key modulus is greater than 512, it will take a few minutes.

Press CTRL+C to abort.

Input the modulus length [default = 1024]:

Generating Keys...

........

Create the key pair successfully.

# 生成secp256r1类型的ECDSA密钥对。

[Device] public-key local create ecdsa secp256r1

Generating Keys...

Create the key pair successfully.

# 生成secp384r1类型的ECDSA密钥对。

[Device] public-key local create ecdsa secp384r1

Generating Keys...

.

Create the key pair successfully.

# 使能SSH服务器功能。

[Device] ssh server enable

# 设置Stelnet客户端登录用户界面的认证方式为scheme。

[Device] line vty 0 63

[Device-line-vty0-63] authentication-mode scheme

[Device-line-vty0-63] quit

# 使能缺省用户角色授权功能,使得认证通过后的用户具有缺省的用户角色network-admin。

[Device] role default-role enable network-admin

# 创建TACACS方案rad。

[Device] hwtacacs scheme tac

# 配置主认证服务器的IP地址为10.1.1.1,认证端口号为49。

[Device-hwtacacs-tac] primary authentication 10.1.1.1 49

# 配置与认证服务器交互报文时的共享密钥为明文expert。

[Device-hwtacacs-tac] key authentication simple expert

# 配置主授权服务器的IP地址为10.1.1.1,授权端口号为49。

[Device-hwtacacs-tac] primary authorization 10.1.1.1 49

# 配置与授权服务器交互报文时的共享密钥为明文expert。

[Device-hwtacacs-tac] key authorization simple expert

# 配置向TACACS服务器发送的用户名不携带域名。

[Device-hwtacacs-tac] user-name-format without-domain

[Device-hwtacacs-tac] quit

# 创建ISP域bbb,为login用户配置AAA认证方法为TACACS认证/授权、不计费。

[Device] domain bbb

[Device-isp-bbb] authentication login hwtacacs-scheme tac

[Device-isp-bbb] authorization login hwtacacs-scheme tac

[Device-isp-bbb] accounting login none

[Device-isp-bbb] quit

6.6  验证配置

说明

Stelnet客户端软件有很多,例如PuTTY、OpenSSH等。本文中仅以客户端软件PuTTY0.58为例,说明Stelnet客户端的配置方法。

 

# 安装PuTTY 0.58软件。

# 打开PuTTY.exe程序,点击“Session”功能区,在图25所示的配置界面中进行如下配置:

·            在“Host Name(or IP address)”文本框中输入Stelnet服务器的IP地址为192.168.1.65。

·            在“Port”文本框中输入SSH协议端口号22。

·            在“Connection type”区域选择SSH协议。

# 单击<Open>按钮。

图25 Stelnet客户端配置界面

 

# 如果弹出图26所示“PuTTY Security Alert”对话框,请根据实际情况做出选择。本例中选择信任该服务器,则单击“Yes”按钮。

图26 Stelnet客户端登录界面(一)

 

# 如果弹出图27所示“PuTTY Security Alert”对话框,请根据实际情况做出选择。本例中选择信任该主机密钥,则单击“Yes”按钮。

图27 Stelnet客户端登录界面(二)

 

# 在如下登录界面中输入用户名manager@bbb和密码1234ab##,即可成功登录设备使用所有命令。

login as: manager@bbb

manager@bbb@192.168.1.65's password:

 

******************************************************************************

* Copyright (c) 2004-2019 New H3C Technologies Co., Ltd. All rights reserved.*

* Without the owner's prior written consent,                                 *

* no decompiling or reverse-engineering shall be allowed.                    *

******************************************************************************

 

<Device>

6.7  配置文件

#

vlan 2 to 3

#

interface Vlan-interface2

 ip address 192.168.1.65 255.255.255.0

#

interface Vlan-interface3

 ip address 10.1.1.2 255.255.255.0

#

interface HundredGigE1/0/2

 port link-mode bridge

 port access vlan 2

#

interface HundredGigE1/0/1

 port link-mode bridge

 port access vlan 3

#

line vty 0 63

 authentication-mode scheme

 user-role network-operator

#

ssh server enable

#

hwtacacs scheme tac

 primary authentication 10.1.1.1

 primary authorization 10.1.1.1

 key authentication cipher $c$3$/9bCuPjMxjOtUvBx8NjtN+AnAsuLT2SrNA==

 key authorization cipher $c$3$QF/fFJNv9IyKyFlsNOpeBYnDXArNhOvOdQ==

 user-name-format without-domain

#

domain bbb

 authentication login hwtacacs-scheme tac

 authorization login hwtacacs-scheme tac

 accounting login none

#

role default-role enable network-admin

#

7  相关资料

·            H3C S6850 & S9850系列以太网交换机 安全配置指导-Release 655x系列

·            H3C S6850 & S9850系列以太网交换机 安全命令参考-Release 655x系列

·            H3C S9820-64H交换机 安全配置指导-Release 655x系列

·            H3C S9820-64H交换机 安全命令参考-Release 655x系列

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们