User Profile配置举例

User Profile配置举例

关键词:User Profile802.1xPortalPPPoEQoSCAR

  要:User Profile是一种用来保存预设配置的方式,只有用户通过认证,成功上线后,这些配置才会生效。用户成功上线后,设备通过这些配置来限制用户的访问行为,当用户下线时,设备再取消相应的配置,以便动态控制用户可以使用的网络资源。本文介绍了在802.1xPortalPPPoE三种认证组网环境下,如何通过User Profile来限制用户使用网络资源。

缩略语:

缩略语

英文全名

中文解释

CAR

Committed Access Rate

承诺访问速率

PPPoE

Point-to-Point Protocol over Ethernet

点对点以太网承载协议

QoS

Quality of Service

服务质量

 



特性简介

User Profile(用户配置文件)是一个配置模板,它是一系列配置的集合,能够保存、统一管理用户的预设配置。根据不同的应用场景设备管理员可以为User Profile配置不同的内容,并且在认证服务器上将用户名和User Profile绑定起来。当用户认证时,对于合法用户,认证服务器会将用户对应的User Profile名称发送给设备,设备接着执行User Profile下的预设配置。用户成功上线后,设备通过这些配置来限制用户的访问行为,当用户下线时,设备再取消相应的配置,以便动态控制用户可以使用的网络资源。

应用场合

l              用户使用802.1x方式接入网络,需要进行用户级的访问行为控制。

l              用户使用Portal方式接入网络,需要进行用户级的访问行为控制。

l              用户使用PPPoE方式接入网络,需要进行用户级的访问行为控制。

注意事项

l              目前User Profile下支持配置CAR策略、QoS策略以及在WLAN组网环境中对用户接入进行限制。以后,User Profile支持配置的具体内容还将扩展。

l              User Profile下应用QoS策略时,策略中目前只支持配置remarkcarfilter三种流行为。

l              User Profile QoS和普通QoS同时存在时,优先执行User Profile QoS

802.1x认证方式的User Profile配置举例

4.1  组网需求

UserA(对应组网图中的Host A)是公司财务部职员,UserB(对应组网图中的Host B)是公司行政部职员,公司员工采用移动办公方式,为了保证网络资源的安全,公司所有PC均采用802.1x方式接入网络并需要到RADIUS服务器进行认证和授权。现要求实现,在公司内,不管UserAUserB的办公地点在哪里:

l              上班时间不允许UserA通过代理服务器(IP地址为1.1.2.220)访问外部网站;

l              任何时间都不允许UserB访问财务部FTP服务器(IP地址为1.1.2.221)。

图1  802.1x认证方式的User Profile配置举例组网图

4.2  配置思路

l              在用户主机上安装802.1x客户端,使得用户可以通过802.1x接入认证方式上网;

l              Device上创建两个User profile,名称分别为FinanceOffice。在Finance下配置QoS策略test1用来限制用户上班时间不能访问外部网站,在Office下配置QoS策略test2用来限制用户不能访问财务部FTP服务器;

l              Device上配置AAA802.1x相关参数,以实现对用户的接入认证;

l              使用CAMS作为RADIUS服务器,在RADIUS服务器上配置两个用户UserAUserB,然后分别与User profile FinanceOffice相关联。

4.3  配置步骤

&  说明:

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

本文档不严格与具体软、硬件版本对应。

 

4.3.1  Host A的配置

# PC机上安装H3C iNode智能管理客户端

# iNode上创建一个新连接,选择接入认证协议类型为802.1x,选择连接类型为普通连接,用户名为UserA,密码为aaaa,如2 所示。

图2  新建连接向导

# PCIP地址设定为1.1.1.1(也可以通过DHCP server动态分配,只要是1.1.1.10/24网段即可),子网掩码设定为255.255.255.0,缺省网关的IP地址为1.1.1.10/24

4.3.2  Host B的配置

# PC机上安装H3C iNode智能管理客户端

# iNode上创建一个新连接,选择接入认证协议类型为802.1x,选择连接类型为普通连接,用户名为UserB,密码为bbbb

# PCIP地址设定为1.1.1.2(也可以通过DHCP server动态分配,只要是1.1.1.10/24网段即可),子网掩码设定为255.255.255.0,缺省网关的IP地址为1.1.1.10/24

4.3.3  L2 Switch的配置

L2 Switch是一台二层交换机,它作为一台普通的接入层设备,在此组网中使用出厂配置即可。

4.3.4  Device的配置

1. 配置步骤

(1)        Ethernet1/1完成用户的接入,属于VLAN 1Ethernet1/2Ethernet1/3用于应用服务器的接入,属于VLAN 2Ethernet1/4用于认证服务器的接入,属于VLAN 4。创建Vlan-interface1Vlan-interface2Vlan-interface4,并分别配置IP地址(如1 所示),用于实现不同VLAN之间报文的三层互通。

<Device> system-view

[Device] vlan 2

[Device-vlan2] port ethernet 1/2

[Device-vlan2] port ethernet 1/3

[Device-vlan2] vlan 4

[Device-vlan4] port ethernet 1/4

[Device-vlan4] interface vlan-interface 1

[Device-Vlan-interface1] ip address 1.1.1.10 24

[Device-Vlan-interface1] interface vlan-interface 2

[Device-Vlan-interface2] ip address 1.1.2.10 24

[Device-Vlan-interface2] interface vlan-interface 4

[Device-Vlan-interface4] ip address 3.3.3.1 24

[Device-Vlan-interface4] quit

(2)        配置AAA认证、授权。

# 创建RADIUS认证方案newScheme,指定认证和计费服务器的IP地址均为3.3.3.3,密钥均为expert(该参数需要和CAMS服务器上的配置保持一致),认证时不需要携带域名。

[Device] radius scheme newScheme

New Radius scheme

[Device-radius-newscheme] server-type extended

[Device-radius-newscheme] primary authentication 3.3.3.3

[Device-radius-newscheme] primary accounting 3.3.3.3

[Device-radius-newscheme] key authentication expert

[Device-radius-newscheme] key accounting expert

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

[Device-radius-newscheme] quit

# 配置域参数。

[Device] domain newDomain

New Domain added.

[Device-isp-newdomian] authentication lan-access radius-scheme newScheme

[Device-isp-newdomian] authorization lan-access radius-scheme newScheme

[Device-isp-newdomian] accounting lan-access radius-scheme newScheme

[Device-isp-newdomian] quit

# newDomain设置为缺省域名。

[Device] domain default enable newDomain

(3)        配置802.1x功能。

# 全局使能802.1x

[Device] dot1x

 802.1x is enabled globally.

# 在接口Ethernet1/1上使能802.1x

[Device] interface ethernet 1/1

[Device-Ethernet1/1] dot1x

 802.1x is enabled on port Ethernet1/1.

[Device-Ethernet1/1] quit

(4)        配置QoS策略

# 配置QoS策略test1test2test1限制上班时间不能通过代理服务器(IP地址为1.1.2.220)访问外部网站,test2用来限制用户不能访问财务部FTP服务器(IP地址为1.1.2.221)。

[Device] time-range time 08:00 to 18:00 working-day

[Device] acl number 3001

[Device-acl-adv-3001] rule permit ip destination 1.1.2.220 0 time-range time

[Device-acl-adv-3001] quit

[Device] traffic classifier tc1

[Device-classifier-tc1] if-match acl 3001

[Device-classifier-tc1] quit

[Device] traffic behavior tb1

[Device-behavior-tb1] filter deny

[Device-behavior-tb1] quit

[Device] qos policy test1

[Device-qospolicy-test1] classifier tc1 behavior tb1

[Device-qospolicy-test1] quit

[Device] acl number 3002

[Device-acl-adv-3002] rule permit ip destination 1.1.1.221 0

[Device-acl-adv-3002] quit

[Device] traffic classifier tc2

[Device-classifier-tc2] if-match acl 3002

[Device-classifier-tc2] quit

[Device] traffic behavior tb2

[Device-behavior-tb2] filter deny

[Device-behavior-tb2] quit

[Device] qos policy test2

[Device-qospolicy-test2] classifier tc2 behavior tb2

[Device-qospolicy-test2] quit

(5)        配置User Profile

# 创建User profile,名称为FinanceOffice,并在该User Profile视图下应用策略test1test2

[Device] user-profile Finance dot1x

[Device-user-profile-DOT1X-Finance] qos apply policy test1 inbound

[Device-user-profile-DOT1X-Finance] quit

[Device] user-profile Office dot1x

[Device-user-profile-DOT1X-Office] qos apply policy test2 inbound

[Device-user-profile-DOT1X-Office] quit

# 激活User Profile

[Device] user-profile Finance enable

Info: This user profile is enabled, its configuration will not be modified.

[Device] user-profile Office enable

Info: This user profile is enabled, its configuration will not be modified.

2. 配置文件

[Device] display current-configuration

#

 sysname Device

#

 domain default enable newdomain

#

 dot1x

#

 time-range time 08:00 to 18:00 working-day

#

acl number 3001

 rule 0 permit ip destination 1.1.2.220 0 time-range time

acl number 3002

 rule 0 permit ip destination 1.1.1.221 0

#

vlan 1

#

vlan 2

#

vlan 4

#

radius scheme newscheme

 server-type extended

 primary authentication 3.3.3.3

 primary accounting 3.3.3.3

 key authentication expert

 key accounting expert

 user-name-format without-domain

#

domain newdomain

 authentication lan-access radius-scheme newscheme

 authorization lan-access radius-scheme newscheme

 accounting lan-access radius-scheme newscheme

 access-limit disable

 state active

 idle-cut disable

 self-service-url disable

domain system

 access-limit disable

 state active

 idle-cut disable

 self-service-url disable

#

traffic classifier tc2 operator and

 if-match acl 3002

traffic classifier tc1 operator and

 if-match acl 3001

#

traffic behavior tb1

 filter deny

traffic behavior tb2

 filter deny

#

qos policy test1

 classifier tc1 behavior tb1

qos policy test2

 classifier tc2 behavior tb2

#

user-profile Finance DOT1X

 qos apply policy test1 inbound

user-profile Office DOT1X

 qos apply policy test2 inbound

#

interface Vlan-interface1

 ip address 1.1.1.10 255.255.255.0

#

interface Vlan-interface2

 ip address 1.1.2.10 255.255.255.0

#

interface Vlan-interface4

 ip address 3.3.3.1 255.255.255.0

#

interface Ethernet1/1

 port link-mode bridge

 dot1x

#

interface Ethernet1/2

 port link-mode bridge

 port access vlan 2

#

interface Ethernet1/3

 port link-mode bridge

 port access vlan 2

#

interface Ethernet1/4

 port link-mode bridge

 port access vlan 4

#

 user-profile Finance enable

 user-profile Office enable

#

user-interface con 0

user-interface vty 0 4

#

return

4.3.5  RADIUS server的配置

1. 配置步骤

(1)        创建服务serverA

l              单击CAMS平台导航树中的“服务管理 > 服务配置”菜单项,进入服务配置页面。

l              单击<增加>按钮,进入增加服务页面。设置服务名为serverA,(为了方便记忆,可以将“服务描述”设置为for user profile Finance),选中“访问权限控制”前的复选框,并将外部组设置为Finance(即User profile的名称),如3 所示,单击<确定>按钮完成增加服务操作。

图3  增加服务

(2)        创建服务serverB

配置步骤与创建服务serverA类似,需要将服务名设置为serverB,外部组填写为Office

(3)        创建用户UserA

l              单击CAMS平台导航树中的“用户管理 > 帐户用户”菜单项,进入帐户管理页面。

l              单击<增加>按钮,进入用户开户页面。设置帐号名为UserA,用户密码为aaaa,用户姓名为hmr,在服务信息中选中刚增加的服务serverA,如4 所示。单击<确认>按钮完成用户开户操作。

图4  用户开户

(4)        创建用户UserB

配置步骤与创建用户UserA类似,需要将用户名设置为UserB,用户密码设置为bbbb,服务信息选择serviceB

(5)        接入设备配置

l              单击CAMS平台导航树中的“系统管理 > 系统配置”菜单项,进入系统配置页面。

图5  系统配置

l              单击“接入设备配置”配置项对应的“修改”链接,进入接入设备配置页面。

l              单击<增加>按钮,进入增加配置项页面。将初始IP地址、结束IP地址设置为设备与服务器相连口的IP地址(本例中为3.3.3.1);共享密钥为设备上配置RADIUS方案中的认证密钥和计费密钥(本例中为expert);端口列表为CAMS服务器上用于监听认证和计费报文的端口,需要与设备上配置的一致(本例中没有配置,则默认为18121813),协议类型和RADIUS报文类型需要和设备上RADIUS方案中配置的一致,如6 所示。单击<确定>按钮,在确认操作成功后,返回到接入设备配置页面,再单击<返回>按钮,返回到系统配置页面。

图6  增加配置项

l              在系统配置页面中,单击<立即生效>按钮,使这些信息生效。

4.3.6  验证结果

可通过以下方式验证上述配置:

(1)        CAMS的“在线用户管理”中查看是否有刚认证上网的用户。
(2)        UserA用户上线后,上班时间(8:0018:00)无法访问外部网站。
(3)        UserB用户上线后,无法访问财务FTP服务器。

Portal认证方式的User Profile配置举例

5.1  组网需求

在校园网络中,因为老师要上传/下载课件、网上视频教学和答疑,所以需要优先保证老师的可用带宽资源。现要求实现:

l              为了防止非本校人员盗用本校网络资源,所有用户接入校园网时,均需要进行Portal认证;

l              在园区内,不管老师的办公地点在哪里,只要使用teacher用户名登录都能获得1Mbps的带宽,学生使用student用户名登录后才能接入校园网,但是能够使用的最大带宽不能超过200kbps

图7  Portal认证方式的User Profile配置举例组网图

5.2  配置思路

l              在学生和老师的主机上安装Portal客户端,使得用户可以通过Portal接入认证方式上网;

l              Device上创建两个User profile,名称分别为TeacherStudentTeacher配置QoS策略test1用来限速为1MbpsStudent配置QoS策略test2用来限速为200kbps

l              使用CAMS作为RADIUS服务器,在RADIUS服务器上配置两个用户TeacherStudent,然后分别关联两个User profile TeacherStudent

5.3  配置步骤

&  说明:

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

本文档不严格与具体软、硬件版本对应。

 

5.3.1  Host A的配置

# PC机上安装H3C iNode智能管理客户端

# iNode上创建一个新连接,选择接入认证协议类型为Portal,用户名为Teacher,密码为1234,如8 所示。

图8  新建连接向导

# PCIP地址设定为1.1.1.1,子网掩码设定为255.255.255.0,缺省网关的IP地址为1.1.1.10/24

5.3.2  Host B的配置

# PC机上安装H3C iNode智能管理客户端

# iNode上创建一个新连接,选择接入认证协议类型为Portal,用户名为Student,密码为5678

# PCIP地址设定为1.1.1.2,子网掩码设定为255.255.255.0,缺省网关的IP地址为1.1.1.10/24

5.3.3  L2 Switch的配置

L2 Switch是一台二层交换机,它作为一台普通的接入层设备,在此组网中使用出厂配置即可。

5.3.4  Device的配置

1. 配置步骤

(1)        Ethernet1/1完成用户的接入,属于VLAN 1Ethernet1/4用于认证服务器的接入,属于VLAN 4。创建Vlan-interface1Vlan-interface4,并分别配置IP地址(如7 所示),用于实现不同VLAN之间报文的三层互通。

<Device> system-view

[Device] vlan 4

[Device-vlan4] port ethernet 1/4

[Device-vlan4] interface vlan-interface 1

[Device-Vlan-interface1] ip address 1.1.1.10 24

[Device-Vlan-interface2] interface vlan-interface 4

[Device-Vlan-interface4] ip address 3.3.3.1 24

[Device-Vlan-interface4] quit

(2)        配置AAA认证参数

# 创建RADIUS认证方案newScheme,指定认证和计费服务器的IP地址均为3.3.3.3,密钥均为expert(该参数需要和CAMS服务器上的配置保持一致),认证时不需要携带域名。

[Device] radius scheme newScheme

New Radius scheme

[Device-radius-newscheme] server-type extended

[Device-radius-newscheme] primary authentication 3.3.3.3

[Device-radius-newscheme] primary accounting 3.3.3.3

[Device-radius-newscheme] key authentication expert

[Device-radius-newscheme] key accounting expert

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

[Device-radius-newscheme] quit

# 配置域参数。

[Device] domain newDomain

New Domain added.

[Device-isp-newdomian] authentication portal radius-scheme newScheme

[Device-isp-newdomian] authorization portal radius-scheme newScheme

[Device-isp-newdomian] accounting portal radius-scheme newScheme

[Device-isp-newdomian] quit

# newDomain设置为缺省域名。

[Device] domain default enable newDomain

(3)        配置Portal认证参数

# 配置Portal认证。

[Device] portal server newpt ip 3.3.3.3 key expert url http://3.3.3.3/portal

# 在接口Vlan-interface1上使能Portal认证。

[Device] interface vlan-interface 1

[Device-Vlan-interface1] ip address 1.1.1.10

[Device-Vlan-interface1] portal server newpt method direct

[Device-Vlan-interface1] quit

(4)        配置QoS策略

# 配置QoS策略test1test2test1限速1Mbpstest2限速200kbps

[Device] traffic classifier tc1

[Device-classifier-tc1] if-match any

[Device-classifier-tc1] quit

[Device] traffic behavior tb1

[Device-behavior-tb1] car cir 1000

[Device-behavior-tb1] quit

[Device] qos policy test1

[Device-qospolicy-test1] classifier tc1 behavior tb1

[Device-qospolicy-test1] quit

[Device] traffic classifier tc2

[Device-classifier-tc2] if-match any

[Device-classifier-tc2] quit

[Device] traffic behavior tb2

[Device-behavior-tb2] car cir 200

[Device-behavior-tb2] quit

[Device] qos policy test2

[Device-qospolicy-test2] classifier tc2 behavior tb2

[Device-qospolicy-test2] quit

(5)        配置User profile

# 创建User profile,名称为TeacherStudent,并在该User Profile视图下应用策略test1test2

[Device] user-profile Teacher portal

[Device-user-profile-PORTAL-Teacher] qos apply policy test1 inbound

[Device-user-profile-PORTAL-Teacher] quit

[Device] user-profile Student portal

[Device-user-profile-PORTAL-Student] qos apply policy test2 inbound

[Device-user-profile-PORTAL-Student] quit

# 激活User Profile

[Device] user-profile Teacher enable

Info: This user profile is enabled, its configuration will not be modified.

[Device] user-profile Student enable

Info: This user profile is enabled, its configuration will not be modified.

2. 配置文件

[Device] display current-configuration

#

 sysname Device

#

 domain default enable newdomain

#

 portal server newpt ip 3.3.3.3 key expert url http://3.3.3.3/portal

#

vlan 1

#

vlan 4

#

radius scheme newscheme

 server-type extended

 primary authentication 3.3.3.3

 primary accounting 3.3.3.3

 key authentication expert

 key accounting expert

 user-name-format without-domain

#

domain newdomain

 authentication portal radius-scheme newscheme

 authorization portal radius-scheme newscheme

 accounting portal radius-scheme newscheme

 access-limit disable

 state active

 idle-cut disable

 self-service-url disable

domain system

 access-limit disable

 state active

 idle-cut disable

 self-service-url disable

#

traffic classifier tc2 operator and

 if-match any

traffic classifier tc1 operator and

 if-match any

#

traffic behavior tb1

 car cir 1000 cbs 62500 ebs 0 green pass red discard

traffic behavior tb2

 car cir 200 cbs 12500 ebs 0 green pass red discard

#

qos policy test1

 classifier tc1 behavior tb1

qos policy test2

 classifier tc2 behavior tb2

#

user-profile Teacher PORTAL

 qos apply policy test1 inbound

user-profile Student PORTAL

 qos apply policy test2 inbound

#

interface Vlan-interface1

 ip address 1.1.1.10 255.255.255.0

 portal server newpt method direct

#

interface Vlan-interface4

 ip address 3.3.3.1 255.255.255.0

#

interface Ethernet1/4

 port link-mode bridge

 port access vlan 4

#

 user-profile Student enable

 user-profile Teacher enable

#

return

5.3.5  RADIUS server的配置

1. 配置步骤

(1)        创建服务forTeacher,具体配置步骤请参见4.3.5  1. (1),将关联的User Profile设置为Teacher
(2)        创建服务forStudent,具体配置步骤请参见4.3.5  1. (1),将关联的User Profile设置为Student
(3)        创建用户Teacher,具体配置步骤请参见4.3.5  1. (3),将用户名设置为Teacher,密码设置为1234,相关联的服务信息选择forTeacher
(4)        创建用户Student,具体配置步骤请参见4.3.5  1. (3),将用户名设置为Student,密码设置为5678,相关联的服务信息选择forStudent
(5)        接入设备配置,具体配置步骤请参见4.3.5  1. (5),将“初始IP地址”、“结束IP地址”设置为3.3.3.1
(6)        Portal组件配置。

l              单击CAMS平台导航树中的“组件管理 > PORTAL组件 > 服务器信息”菜单项,进入PORTAL服务器信息维护页面。在页面填入PORTAL Server的相关参数,如9 所示。单击<确定>按钮进行确认。

图9  PORTAL服务器信息维护

l              单击CAMS平台导航树中的“组件管理 > PORTAL组件 > 设备信息”菜单项,进入设备信息管理页面。

l              单击<增加>按钮,进入增加设备信息页面。将IP地址配置为DeviceRADIUS server相连接口的IP地址(本例中为3.3.3.1),版本号选择Portal 2.0(与Device上运行的Portal版本一致),密码设置为expert(与在Device上配置的portal server命令中的key参数保持一致),如10 所示。单击<增加>按钮,在确认操作成功后,返回到设备信息管理页面。

图10  增加设备信息

l              单击CAMS平台导航树中的“组件管理 > PORTAL组件 > IP地址组”菜单项,进入IP地址组管理页面。

l              单击<增加>按钮,进入增加IP地址组页面。将起始地址和终止地址填用户终端的IP地址,本举例中为1.1.1.11.1.1.2,单击<增加>按钮,在确认操作成功后,返回到IP地址组管理页面。

图11  增加IP地址组

l              单击CAMS平台导航树中的“组件管理 > PORTAL组件 > 设备信息”菜单项,进入设备信息管理页面。

l              单击Device对应的“端口信息管理”链接,如12 所示,进入增加设备端口组页面。将IP地址组设置为刚创建的HostAandHostB,如13 所示。单击<增加>按钮,在确认操作成功后,返回到设备信息管理页面。

图12  设备信息管理

图13  增加设备端口组

l              最后单击CAMS平台导航树中的“组件管理 > PORTAL组件 > 配置生效”菜单项,使以上配置生效。

5.3.6  验证结果

可通过以下方式验证上述配置:

(1)        任何需要接入校园网的用户都需要通过Portal认证。
(2)        用户使用Teacher用户名上线后,可使用的最大带宽为1Mbps
(3)        用户使用Student用户名上线后,可使用的最大带宽为200kbps

PPPoE认证方式的User Profile配置举例

6.1  组网需求

接入网络使用PPPoE认证方式,网络中同时存在UserAUserB,其中UserAVIP用户,UserB为普通用户。现需要为他们提供区分服务,当网络出现拥塞时,

l              UserAUserB同时访问数据库(DB),优先为UserA传输数据,以减少UserA的等待时间。

l              UserA同时访问DB和访问WEB网站,因为传输数据占用的带宽较大而且时间较长,所以,要求优先处理与WEB网站之间的报文。

图14  Portal认证方式的User Profile配置举例组网图

6.2  配置思路

l              CAMS服务器上配置两个用户UserAUserB,然后分别关联两个User profile VIPnormal

l              VIP配置QoS策略test1使得UserA访问WEB网站报文的本地优先级最高为6UserA访问DB的响应报文的本地优先级次高为5normal配置QoS策略test2使得UserB访问DB的响应报文的本地优先级为4

l              通过SP队列来保证当网络拥塞时,最先处理UserAWEB网站间的交互报文,再处理UserADB间的交互报文,最后处理UserBDB间的交互报文。

l              Device的接口Ethernet1/1上使能PPPoE认证,之后Host A使用用户名UserA认证上线,Host B使用用户名UserB认证上线。

6.3  配置步骤

&  说明:

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

本文档不严格与具体软、硬件版本对应。

 

6.3.1  Host A的配置

# 使用Windows系统的网络连接功能新建一个PPPoE连接。

l              使用<开始>菜单打开<控制面板>,双击<网络连接>服务,使用“创建一个新的连接功能”新建一个PPPoE连接。

l              打开新建连接向导,单击<下一步>按钮。

l              网络连接类型窗口选择为“连接到InternetC)”,单击<下一步>按钮。

l              准备好窗口选择“手动设置我的连接(M)”,单击<下一步>按钮。

l              Internet连接窗口选择“用要求用户名和密码的宽带连接来连接(U)”,单击<下一步>按钮。

l              在连接名窗口输入ISP名称,单击<下一步>按钮。

l              在可用连接窗口选择“只是我使用”,单击<下一步>按钮。

l              Internet帐户信息窗口,输入用户名UserA,密码为123,单击<下一步>按钮。

图15  新建连接向导

l              最后单击<完成>按钮,完成连接创建操作。

之后用户通过下面的窗口就可以连接上网了。

图16  连接

# PCIP地址设定为1.1.1.1,子网掩码设定为255.255.255.0,缺省网关的IP地址为1.1.1.10/24

6.3.2  Host B的配置

# 配置步骤请参见6.3.1  ,只需在用户名处输入UserB,密码处输入456PCIP地址设定为1.1.1.2,子网掩码设定为255.255.255.0,缺省网关的IP地址为1.1.1.10/24

6.3.3  L2 Switch的配置

L2 Switch是一台二层交换机,它作为一台普通的接入层设备,在此组网中使用出厂配置即可。

6.3.4  Device的配置

1. 配置步骤

(1)        Ethernet1/1完成用户的接入,属于VLAN 1Ethernet1/5用于数据库(DB)的接入,属于VLAN 2Ethernet1/4用于认证服务器的接入,属于VLAN 4。创建Vlan-interface1Vlan-interface2Vlan-interface4,并分别配置IP地址(如14 所示),用于实现不同VLAN之间报文的三层互通。

<Device> system-view

[Device] vlan 2

[Device-vlan2] port ethernet 1/5

[Device] vlan 4

[Device-vlan4] port ethernet 1/4

[Device-vlan4] interface vlan-interface 1

[Device-Vlan-interface1] ip address 1.1.1.10 24

[Device-Vlan-interface1] interface vlan-interface 2

[Device-Vlan-interface2] ip address 1.1.2.10 24

[Device-Vlan-interface2] interface vlan-interface 4

[Device-Vlan-interface4] ip address 3.3.3.1 24

[Device-Vlan-interface4] quit

(2)        配置AAA认证参数

# 配置RADIUS认证方案参数,指定认证和计费服务器的IP地址均为3.3.3.3,密钥均为expert(该参数需要和CAMS服务器上的配置保持一致),认证时不需要挟带域名。

[Device] radius scheme newScheme

New Radius scheme

[Device-radius-newscheme] server-type extended

[Device-radius-newscheme] primary authentication 3.3.3.3

[Device-radius-newscheme] primary accounting 3.3.3.3

[Device-radius-newscheme] key authentication expert

[Device-radius-newscheme] key accounting expert

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

[Device-radius-newscheme] quit

# 配置域参数。

[Device] domain newDomain

New Domain added.

[Device-isp-newdomian] authentication ppp radius-scheme newscheme

[Device-isp-newdomian] authorization ppp radius-scheme newscheme

[Device-isp-newdomian] accounting ppp radius-scheme newscheme

[Device-isp-newdomian] quit

[Device] domain default enable newDomain

(3)        配置PPPoE功能

# 创建一个VT口,配置它的认证方式为CHAPIP地址为1.1.1.10

[Device] interface virtual-template 1

[Device-Virtual-Template1] ppp authentication-mode chap

[Device-Virtual-Template1] quit

# 在接口Vlan-interface1上使能PPPoE server功能,并绑定VT口。

[Device] interface vlan-interface 1

[Device-Vlan-interface1] pppoe-server bind virtual-template 1

[Device-Vlan-interface1] quit

(4)        配置QoS策略

# 配置QoS策略test0test1test2,使得VIP访问WEB服务器报文的本地优先级设为6,访问DB报文的本地优先级设为5normal访问DB报文的本地优先级设为4

[Device] acl number 3000

[Device-acl-adv-3000] rule permit tcp destination-port eq 80

[Device-acl-adv-3000] quit

[Device] traffic classifier tc0

[Device-classifier-tc0] if-match acl 3000

[Device-classifier-tc0] quit

[Device] traffic behavior tb0

[Device-behavior-tb0] remark local-precedence 6

[Device-behavior-tb0] quit

[Device] acl number 3001

[Device-acl-adv-3001] rule permit ip source 1.1.2.222 0

[Device-acl-adv-3001] quit

[Device] traffic classifier tc1

[Device-classifier-tc1] if-match acl 3001

[Device-classifier-tc1] quit

[Device] traffic behavior tb1

[Device-behavior-tb1] remark local-precedence 5

[Device-behavior-tb1] quit

[Device] qos policy test1

[Device-qospolicy-test1] classifier tc0 behavior tb0

[Device-qospolicy-test1] classifier tc1 behavior tb1

[Device-qospolicy-test1] quit

[Device] traffic behavior tb2

[Device-behavior-tb2] remark local-precedence 4

[Device-behavior-tb2] quit

[Device] qos policy test2

[Device-qospolicy-test2] classifier tc1 behavior tb2

[Device-qospolicy-test2] quit

(5)        QoS策略test1test2应用于User profile

# 创建User profile,名称为VIPnormal,并在该User Profile视图下应用策略test1test2

[Device] user-profile VIP PPP

[Device-user-profile-PPP-VIP] qos apply policy test1 inbound

[Device-user-profile-PPP-VIP] quit

[Device] user-profile normal PPP

[Device-user-profile-PPP-normal] qos apply policy test2 inbound

[Device-user-profile-PPP-normal] quit

# 激活User Profile

[Device] user-profile VIP enable

Info: This user profile is enabled, its configuration will not be modified.

[Device] user-profile normal enable

Info: This user profile is enabled, its configuration will not be modified.

(6)        配置绝对优先队列

# 通过报文优先级来保证当网络拥塞时,优先处理UserAHTTP流量,再处理UserADB之间的流量,最后处理UserBDB之间的流量。

[Device] interface ethernet 1/1

[Device-Ethernet1/1] qos sp

2. 配置文件

[Device-Ethernet1/1] display current-configuration

#

 sysname Device

#

 domain default enable newdomain

#

acl number 3000

 rule 0 permit tcp destination-port eq www

acl number 3001

 rule 0 permit ip source 1.1.2.222 0

#

vlan 1

#

vlan 2

#

vlan 4

#

radius scheme newscheme

 server-type extended

 primary authentication 3.3.3.3

 primary accounting 3.3.3.3

 key authentication expert

 key accounting expert

 user-name-format without-domain

#

domain newdomain

 authentication ppp radius-scheme newscheme

 authorization ppp radius-scheme newscheme

 accounting ppp radius-scheme newscheme

 access-limit disable

 state active

 idle-cut disable

 self-service-url disable

domain system

 access-limit disable

 state active

 idle-cut disable

 self-service-url disable

#

traffic classifier tc0 operator and

 if-match acl 3000

traffic classifier tc1 operator and

 if-match acl 3001

#

traffic behavior tb1

 remark local-precedence 5

traffic behavior tb0

 remark local-precedence 6

traffic behavior tb2

 remark local-precedence 4

#

qos policy test1

 classifier tc0 behavior tb0

 classifier tc1 behavior tb1

qos policy test2

 classifier tc1 behavior tb2

#

user-profile VIP PPP

user-profile normal PPP

#

interface Virtual-Template1

 ppp authentication-mode chap

#

interface Vlan-interface1

 pppoe-server bind Virtual-Template 1

 ip address 1.1.1.10 255.255.255.0

#

interface Vlan-interface2

 ip address 1.1.2.10 255.255.255.0

#

interface Vlan-interface4

 ip address 3.3.3.1 255.255.255.0

#

interface Ethernet1/1

 port link-mode bridge

 qos sp

#

interface Ethernet1/4

 port link-mode bridge

 port access vlan 4

#

interface Ethernet1/5

 port link-mode bridge

 port access vlan 2

#

 user-profile VIP enable

 user-profile normal enable

#

return

6.3.5  RADIUS server的配置

1. 配置步骤

(1)        创建服务forVIP,具体配置步骤请参见4.3.5  1. (1),将关联的User Profile设置为VIP
(2)        创建服务fornormal,具体配置步骤请参见4.3.5  1. (1),将关联的User Profile设置为normal
(3)        创建用户UserA,具体配置步骤请参见4.3.5  1. (3),将用户名设置为UserA,密码设置为123,相关联的服务信息选择forVIP
(4)        创建用户UserB,具体配置步骤请参见4.3.5  1. (3),将用户名设置为UserB,密码设置为456,相关联的服务信息选择fornormal
(5)        接入设备配置,具体配置步骤请参见4.3.5  1. (5),将“初始IP地址”、“结束IP地址”设置为3.3.3.1

6.3.6  验证结果

可通过以下方式验证上述配置:

(1)        UserAUserB必须通过PPPoE认证之后才能使用网络资源。
(2)        在网络拥塞时,UserAUserB同时访问DB的话,UserA会先获取到想要的数据。
(3)        UserA在访问DB时,即便网络发生拥塞,UserAWEB网站的访问也不会受到大数据量文件传输的影响。

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright ©2008 杭州华三通信技术有限公司 版权所有,保留一切权利。

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

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

附件下载

联系我们