學校路由器場景配置案例:配置啞終端接入示例(MAC)

配置啞終端接入示例(MAC)

介紹一個啞終端根據MAC地址接入示例,結合配置組網圖來理解業務的配置過程。配置示例包括組網需求、配置思路、操作步驟和配置文件。

適用產品和版本

適用於V800R010C00及以後版本的NE40E/ME60系列產品。

組網需求

啞終端指的是園區內的打印機、門禁卡設備,一般不配置IP地址,以靜態用戶的方式接入,根據MAC進行認證。

如圖1-23所示,打印機從路由器的GE0/1/2接口下接入。

圖1-23 啞終端根據MAC接入組網圖

  • 說明:本例中Interface1、Interface2分別代表接口GE0/1/2,GE 0/1/1。
學校路由器場景配置案例:配置啞終端接入示例(MAC)

配置思路

啞終端以靜態用戶方式接入的配置思路如下:

  1. 配置認證方案,本地認證。
  2. 配置地址池,預留IP地址172.30.0.8給打印機1。
  3. 配置認證域printer。
  4. 配置BAS接口,用戶的接入方式為二層普通用戶接入,認證缺省域為printer。
  5. 配置靜態用戶。

數據準備

完成此配置舉例,需要準備以下數據:

  • 認證模板的名稱和認證方式
  • 地址池名稱、網關地址、DNS服務器地址
  • 域的名稱
  • BAS接口參數

操作步驟

  1. 配置認證方案
[~HUAWEI] aaa
[*HUAWEI-aaa] authentication-scheme local
[*HUAWEI-aaa-authen-local] authentication-mode local
[*HUAWEI-aaa-authen-local] commit
[~HUAWEI-aaa-authen-local] quit
  1. 配置用戶名生成方式和密碼
[*HUAWEI-aaa] default-user-name include ip-address
[*HUAWEI-aaa] default-password cipher Root@123
[*HUAWEI-aaa] commit
[~HUAWEI-aaa] quit
  1. 配置本地帳號
[~HUAWEI] local-aaa-server
[*HUAWEI-local-aaa-server] user 172.30.0.8@printer password cipher Root@123 authentication-type b
[*HUAWEI-local-aaa-server] commit
[~HUAWEI-local-aaa-server] quit
  1. 配置地址池
[~HUAWEI] ip pool pool1 bas local
[*HUAWEI-ip-pool-pool1] gateway 172.30.0.1 255.255.255.0
[*HUAWEI-ip-pool-pool1] section 0 172.30.0.2 172.30.0.200
[*HUAWEI-ip-pool-pool1] excluded-ip-address 172.30.0.8
[*HUAWEI-ip-pool-pool1] commit
[~HUAWEI-ip-pool-pool1] quit
  1. 配置域
[~HUAWEI] aaa
[*HUAWEI-aaa] domain printer
[*HUAWEI-aaa-domain-isp1] authentication-scheme local
[*HUAWEI-aaa-domain-isp1] accounting-scheme default0
[*HUAWEI-aaa-domain-isp1] ip-pool pool1
[*HUAWEI-aaa-domain-isp1] commit
[~HUAWEI-aaa-domain-isp1] quit
[~HUAWEI-aaa] quit
  1. 配置BAS接口
[~HUAWEI] license
[*HUAWEI-license]active bas slot 1
[*HUAWEI-license] commit
[~HUAWEI-license]quit
[~HUAWEI] interface GigabitEthernet 0/1/2
[*HUAWEI-GigabitEthernet0/1/2] bas
[*HUAWEI-GigabitEthernet0/1/2-bas] access-type layer2-subscriber
[*HUAWEI-GigabitEthernet0/1/2-bas] default-domain authentication printer
[*HUAWEI-GigabitEthernet0/1/2-bas] authentication-method bind 
[*HUAWEI-GigabitEthernet0/1/2-bas] ip-trigger
[*HUAWEI-GigabitEthernet0/1/2-bas] arp-trigger
[*HUAWEI-GigabitEthernet0/1/2-bas] commit
[~HUAWEI-GigabitEthernet0/1/2-bas] quit
[~HUAWEI-GigabitEthernet0/1/2] quit
  • 說明:這裡配置的是綁定認證,將自動生成認證的用戶名和密碼,由於採用本地認證,應和創建的本地用戶名和密碼保持一致。本地自動生成的用戶名、密碼,本例中採用的是AAA視圖下default-user-namedefault-password命令實現,具體可參見配置文件。
  1. 配置靜態用戶。如果網絡上有多臺打印機,則每臺打印機都需要如下配置。
[*HUAWEI] static-user 172.30.0.8 gateway 172.30.0.1 interface GigabitEthernet 0/1/2 mac-address 00e0-fc12-3456 domain-name printer detect
[*HUAWEI] static-user detect interval 1
[*HUAWEI] commit
  1. 驗證配置結果。

完成上述配置後,使用命令

display access-user domain查看域下用戶在線情況,用戶能夠正常上線。

[~HUAWEI] display access-user domain printer
------------------------------------------------------------------------------
UserID Username Interface IP address MAC IPv6 address
------------------------------------------------------------------------------
20 172.30.0.8@printer GE0/1/2.1 172.30.0.8 00e0-fc12-3456 -
------------------------------------------------------------------------------
Total users : 1

配置文件

#
 sysname HUAWEI
#
license
active bas slot 1
#
interface GigabitEthernet0/1/2
 bas
 access-type layer2-subscriber default-domain authentication printer
 ip-trigger
 arp-trigger
 authentication-method bind
#
ip pool pool1 bas local
 gateway 172.30.0.1 255.255.255.0
 section 0 172.30.0.2 172.30.0.200
 excluded-ip-address 172.30.0.8
#
aaa
 default-user-name include ip-address
 default-password cipher Root@123 
authentication-scheme local
 authentication-mode local
domain printer
 authentication-scheme local
 accounting-scheme default0
 ip-pool pool1
#
local-aaa-server
 user 172.30.0.8@printer password cipher Root@123 authentication-type B
#
 static-user 172.30.0.8 gateway 172.30.0.1 interface GigabitEthernet0/1/2 mac-address 00e0-fc12-3456 domain-name printer detect
 static-user detect interval 1
#
return


分享到:


相關文章: