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

H3C S5600系列以太网交换机 命令手册-Release 1702(V1.00)

20-Web认证命令

本章节下载  (215.11 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S5600/S5600/Command/Command_Manual/H3C_S5600_CM-Release_1702(V1.00)/201006/679956_30005_0.htm

20-Web认证命令


1 Web认证配置命令

l          新增“Web认证定制页面配置”,具体命令请参见1.1.3  web-authentication customize

l          新增“Web认证支持HTTPS访问方式”,具体命令请参见1.1.9  web-authentication protocol

l          新增“Web认证设置在线用户最长在线时间”,具体命令请参见1.1.12  web-authentication timer max-online

 

1.1  Web认证配置命令

1.1.1  display web-authentication configuration

【命令】

display web-authentication configuration

【视图】

任意视图

【参数】

【描述】

display web-authentication configuration 显示Web认证的所有配置,包括全局配置和端口下的配置。

【举例】

# 显示Web认证的配置信息。

<Sysname> display web-authentication configuration

 Status: enabled

 Protocol: HTTP

 Web Server: IP=30.1.1.2        Port=80

 Idle-cut time: 900 sec

 Max-online time: 1800 sec

 Max-connection of device is: 512

 Customized authentication-page information :

     Corp-Name: H3C Technologies

     Platform-Name: A leading global supplier of IP-based products and solutions

     Phone-Num: +86-571-86760000

     Email-address: service@h3c.com 

     File:                              

 Free IP:

           1) IP=10.1.1.0           Net Mask=255.255.255.0

 Free User:

           1) IP=192.168.0.108      MAC=000d-88f6-44c1

 Interface Configuration:

 Interface_number         method        max-connection

 GigabitEthernet1/0/1            shared        124

 GigabitEthernet1/0/14           shared        124

表1-1 display web-authentication configuration命令显示信息描述表

字段

描述

Status

WEB认证功能的全局状态

Protocol

Web认证的接入协议(HTTP、HTTPS)

Web Server

Web认证服务器的IP地址和端口号

Idle-cut time

闲置用户检测的时间间隔

Max-online time

限制用户在线最长时间

Max-connection of device

设备上Web认证用户最大个数

Customized authentication-page information

认证页面的各部分定制参数,例如:公司名称,主题介绍,联系电话,电子邮件信息或者定制的Web文件

Free IP

免认证IP地址段

Free User

免认证用户

Interface Configuration

选择WEB认证功能的端口配置信息

Interface_number

端口编号

method

端口上用户的接入方式(Shared、Designated)

max-connection

端口上允许连接用户的最大数

 

1.1.2  display web-authentication connection

【命令】

display web-authentication connection { all | interface interface-type interface-number | user-name user-name }

【视图】

任意视图

【参数】

all:显示所有的在线用户。

interface-type interface-number:端口编号。

user-name:用户名,长度为1~184的字符串。

【描述】

display web-authentication connection用于显示在线用户信息。

【举例】

# 显示Web认证在线用户信息。

<Sysname> display web-authentication connection all

Username: 1

MAC: 000d-88f6-44c1   Interface: GigabitEthernet1/0/1

VLAN: 2               Method: Shared

State: ONLINE         Online-Time(s): 8

 

Total 1 connection(s) matched

表1-2 display web-authentication connection命令显示信息描述表

字段

描述

Username

接入用户的用户名

MAC

接入用户的MAC地址

Interface

用户接入的端口

VLAN

用户所属VLAN

Method

用户接入方式(Shared、Designated)

State

用户状态

Online-Time(s)

用户在线时间

 

1.1.3  web-authentication customize

【命令】

web-authentication customize { corp-name corporation-text | email email-string | phone-num phonenum-string | platform-name platform-text | file web-file }

undo web-authentication customize { corp-name | email | phone-num | platform-name | file | all }

【视图】

系统视图

【参数】

corp-name:设置Web认证定制页面的公司名称。

corporation-text: 用户定制“公司名称”项的字符串,长度为1~64,可以包含空格。

email:设置Web认证定制页面的电子邮件。

email-string: 用户定制“电子邮件”项的字符串,长度为1~64,如果包含空格,需要使用双引号。

phone-num:设置Web认证定制页面的联系电话。

phonenum-string用户定制“联系电话”项的字符串,长度为1~32,如果包含空格,需要使用双引号。

platform-name:设置Web认证定制页面的主题介绍。

platform-text用户定制“主题介绍”项的字符串,长度为1~128,可以包含空格。

file:指定定制的Web文件。

web-file指定定制的Web文件名,长度为1~142的字符串。

all:应用undo命令恢复缺省情况时,选择此项,表示将所有定制项目恢复为缺省情况。

【描述】

web-authentication customize命令用于配置认证页面的定制参数:包括公司名称,主题介绍,联系电话,电子邮件信息,或定制的Web文件。设置这些定制参数后,在认证页面,认证成功页面等所有Web认证推出的页面上显示出相关定制信息。undo web-authentication customize用于恢复缺省情况。

【举例】

# 设置Web认证定制页面.

l              corp-name设置为:H3C Technologies

l              email设置为:service@h3c.com

l              phone-num设置为:+86-571-86760000

l              platform-name设置为:A leading global supplier of IP-based products and solutions

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] web-authentication customize corp-name H3C Technologies

[Sysname] web-authentication customize email service@h3c.com

[Sysname] web-authentication customize phone-num +86-571-86760000

[Sysname] web-authentication customize platform-name A leading global supplier of IP-based products and solutions

定制页面完成后,Web认证时的界面信息会包含如下内容,如下图所示。

图1-1 Web认证定制页面

 

1.1.4  web-authentication cut connection

【命令】

web-authentication cut connection { all | mac mac-address | user-name user-name | interface interface-type interface-number }

【视图】

系统视图

【参数】

all:强制所有的在线用户下线。

mac-address:强制此MAC地址对应的用户下线。

user-name:强制此用户名对应的用户下线,长度为1~184的字符串。

interface-type interface-number:指定接口类型和接口编号,强制此端口下的所有用户下线。

【描述】

web-authentication cut connection命令用来强制所有或者指定用户下线。

【举例】

# 强制GigabitEthernet 1/0/2端口下的所有用户下线。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] web-authentication cut connection interface gigabitethernet1/0/2

1.1.5  web-authentication enable

【命令】

web-authentication enable

undo web-authentication enable

【视图】

系统视图

【参数】

【描述】

web-authentication enable命令用于开启全局Web认证功能。undo web-authentication enable命令用于关闭全局Web认证功能。

如果启动了802.1x、MAC地址认证、端口安全、端口汇聚、IRF等特性,则不能开启Web认证功能。反之,如果开启Web认证功能,则禁止启用802.1x、MAC地址认证、端口安全、端口汇聚、IRF等特性。

 

【举例】

# 开启全局的Web认证特性。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] web-authentication web-server ip 192.168.0.56 port 80

[Sysname] web-authentication enable

1.1.6  web-authentication free-ip

【命令】

web-authentication free-ip ip-address { mask-length | mask }

undo web-authentication free-ip { ip-address { mask-length | mask } | all }

【视图】

系统视图

【参数】

ip-address:免认证IP地址。

mask-length:免认证IP的掩码长度。长度为1~32。

mask:免认证IP的掩码地址。

【描述】

web-authentication free-ip命令用来设置Web认证的免认证IP地址段,即不通过Web认证就可以访问的IP地址段。undo web-authentication free-ip命令用来取消Web认证的免认证IP地址。

缺省情况下,未配置Web认证的免认证IP地址段。

l          所配置免认证地址段中不能包括Web认证服务器地址。

l          最多可以配置四个免认证网段。

 

【举例】

# 设置Web认证时的免认证IP地址段为10.1.1.0,掩码为24位。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] web-authentication free-ip 10.1.1.0 24

1.1.7  web-authentication free-user

【命令】

web-authentication free-user ip ip-address mac mac-address

undo web-authentication free-user { ip ip-address mac mac-address | all }

【视图】

系统视图

【参数】

ip-address:免认证用户的IP地址。

mac-address:免认证用户的MAC地址,格式为含分隔符“-”的MAC地址,例如“000d-88f6-44c1”。

all:删除所有的免认证用户。

【描述】

web-authentication free-user命令用于配置Web认证的免认证用户。允许源MAC和源IP与免认证用户的MAC和IP地址都相同的用户不用通过Web认证就能正常访问网络。undo web-authentication free-user命令用于取消Web认证的免认证用户配置。

缺省情况下,未配置免认证用户。

对于共享接入方式(shared)上线的用户,如果配置的免认证用户的IP地址和MAC地址和在线用户的IP地址和MAC地址都相同时,对应的用户被强制下线。

 

【举例】

# 设置Web认证的免认证用户IP地址为192.168.0.108,MAC地址为0010-0020-0030。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] web-authentication free-user ip 192.168.0.108 mac 0010-0020-0030

1.1.8  web-authentication max-connection

【命令】

web-authentication max-connection number

undo web-authentication max-connection

【视图】

系统视图/端口视图

【参数】

number:最大上线用户个数。

【描述】

web-authentication max-connection命令用于限制设备或者一个端口上能通过Web认证的用户最大个数,当认证用户个数达到最大值时,此设备或者端口连接的其他用户就不能再通过Web认证。

此功能在端口视图下配置时,只能在共享接入方式端口上配置。

缺省情况下,端口上能通过Web认证的用户最大个数为124,设备上最大用户个数为512。

【举例】

# 配置端口GigabitEthernet1/0/1上Web认证用户最大个数为100。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] interface gigabitethernet 1/0/1

[Sysname-GigabitEthernet1/0/1] web-authentication select method shared

[Sysname-GigabitEthernet1/0/1] web-authentication max-connection 100

1.1.9  web-authentication protocol

【命令】

web-authentication protocol { http | https server-policy policy-name }

undo web-authentication protocol

【视图】

系统视图

【参数】

http:客户端通过HTTP方式访问认证页面,该方式下认证信息未加密。

https:客户端通过HTTPS方式访问认证页面,认证信息在传输过程中被加密。

policy-name:指定SSL服务器策略名,该策略必须已经存在,字符串,长度为1~16。

【描述】

web-authentication protocol命令用于配置Web认证的接入协议,缺省为HTTP方式,如果选择为HTTPS方式则客户端和设备间的认证信息可以通过密文方式传递。

web-authentication protocol命令用于恢复缺省情况。

缺省情况下客户端与交换机之间采用HTTP协议交互。

需要注意的是:

l              此配置需要在Web认证开启前完成,Web认证开启后不能改变接入协议。

l              配置HTTPS方式之前,需要先配置SSL服务器策略,并且保证SSL策略对应的PKI域已经获取到了证书。

l              SSL策略内容更改后,需要重新开启Web认证功能才可以使用更新后的SSL策略。

l              SSL只支持SSL 3.0和TLS 1.0,不支持SSL 2.0版本。

l              配置HTTPS方式后,客户端需要使用HTTP1.1版本登录,否则页面打开速度会很慢。

【举例】

# 配置Web认证接入方式为HTTPS方式,SSL服务器策略为pt_ssl

<Sysname> system-view

[Sysname] web-authentication protocol https server-policy pt_ssl

1.1.10  web-authentication select method

【命令】

web-authentication select method { shared | designated }

undo web-authentication select

【视图】

端口视图

【参数】

shared:设置端口Web认证采用共享接入方式。

designated:设置端口Web认证采用指定接入方式。

【描述】

web-authentication select命令用于在端口上开启Web认证,并设置端口的接入方式。undo web-authentication select命令用于在端口上关闭Web认证。

接入方式分为两种:共享方式和指定方式。

l              如果选择共享接入方式,则允许有多个用户在该端口上通过Web认证;

l              如果选择指定接入方式,则只允许一个用户在该端口上通过Web认证。

如果全局已开启Web认证,配置此命令后,在相应端口开启Web认证功能,即只有通过认证才能通过该端口正常访问网络;如果全局未开启Web认证,则只保存配置。

l          如果端口不是access类型端口,则禁止在该端口上开启Web认证。

l          如果端口已经加入到某个汇聚组中,则禁止在该端口上开启Web认证。

 

【举例】

# 开启以太网端口GigabitEthernet 1/0/1上的Web认证特性,采用端口共享接入方式。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] interface gigabitethernet 1/0/1

[Sysname-GigabitEthernet1/0/1] web-authentication select method shared

1.1.11  web-authentication timer idle-cut

【命令】

web-authentication timer idle-cut timer

undo web-authentication timer idle-cut

【视图】

系统视图

【参数】

timer:对在线用户是否为零流量进行检测的时间间隔,取值范围为10~86400,单位为秒。如果取值为0,则表示不会启用闲置用户检测功能。

【描述】

web-authentication timer idle-cut命令用来设置Web认证闲置用户检测的时间间隔。undo web-authentication timer idle-cut命令用来恢复缺省值。

缺省情况下,Web认证闲置用户检测的时间间隔为900秒。

闲置用户检测的时间间隔是系统定期检测用户是否闲置的时间间隔,如果检测到零流量时相应MAC地址表项未老化,则用户保持在线,如果MAC地址老化,则切断用户连接。建议将此时间设置为1/2 MAC地址老化时间到MAC地址老化时间之间的值。

 

【举例】

# 设置闲置用户检测时间为500s。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] web-authentication timer idle-cut 500

1.1.12  web-authentication timer max-online

【命令】

web-authentication timer max-online timer

undo web-authentication timer max-online

【视图】

系统视图

【参数】

timer:允许在线用户的最长在线时间,取值范围为10~86400,单位为秒。如果设置为0,则表示不限制用户最长在线时间。

【描述】

web-authentication timer max-online命令用来设置在线用户最长在线时间,如果用户在设定的最长在线时间内没有主动下线,交换机会将该用户强制下线。undo web-authentication timer max-online命令用来恢复缺省值。

缺省情况下,限制用户最长在线时间为1800秒。

【举例】

# 限制用户最长在线时间为36000秒。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] web-authentication timer max-online 36000

1.1.13  web-authentication web-server

【命令】

web-authentication web-server ip ip-address [ port port-number ]

undo web-authentication web-server

【视图】

系统视图

【参数】

ip-address:Web认证服务器的IP地址。必须为合法的单播地址。

port-number:Web认证服务器的端口号,取值范围为1~50000,缺省值为80。

【描述】

web-authentication web-server ip命令用于设置Web认证服务器的IP地址和端口号,客户端可以通过此服务器地址进行Web认证。undo web-authentication web-server命令用于恢复缺省设置。

缺省情况下,端口号为80,未配置Web认证服务器IP地址。

开启全局Web认证功能前,首先必须配置Web认证服务器的IP地址。

 

【举例】

# 设置Web认证服务器的IP地址为192.168.0.56、端口号为80。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] web-authentication web-server ip 192.168.0.56 port 80

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

新华三官网
联系我们