This section provides an example for configuring Layer 2 IPoE access (web authentication).
In web authentication mode, users must enter usernames and passwords on a portal page for authentication and can access the network after passing the authentication.
The configuration roadmap is as follows:
Create a pre-authentication domain named pre-web and an authentication domain named after-auth.
Configure AAA schemes.
Create a RADIUS server group.
Configure forcible redirection to a specified web server in the pre-authentication domain pre-web, and bind a user group, an authentication scheme (none authentication), and an accounting scheme (none accounting) to the domain so that users in the user group can access only limited resources.
Bind an authentication scheme (RADIUS authentication) and accounting scheme (RADIUS accounting) to the authentication domain after-auth.
Configure a pre-authentication domain and authentication domain on a BAS interface.
# Create a pre-authentication domain named pre-web and an authentication domain named after-auth.
<HUAWEI> system-view [~HUAWEI] aaa [~HUAWEI-aaa] domain pre-web [*HUAWEI-aaa-domain-pre-web] commit [~HUAWEI-aaa-domain-pre-web] quit [~HUAWEI-aaa] domain after-auth [*HUAWEI-aaa-domain-after-auth] commit [~HUAWEI-aaa-domain-after-auth] quit [~HUAWEI-aaa] quit
# Configure a RADIUS server group named rd2.
[~HUAWEI] radius-server group rd2 [*HUAWEI-radius-rd2] radius-server authentication 192.168.8.249 1812 [*HUAWEI-radius-rd2] radius-server accounting 192.168.8.249 1813 [*HUAWEI-radius-rd2] radius-server type standard [*HUAWEI-radius-rd2] radius-server shared-key-cipher Root@1234 [*HUAWEI-radius-rd2] commit [~HUAWEI-radius-rd2] quit
# Configure an authentication scheme named auth2, with RADIUS authentication specified.
[~HUAWEI] aaa [~HUAWEI-aaa] authentication-scheme auth2 [*HUAWEI-aaa-authen-auth2] authentication-mode radius [*HUAWEI-aaa-authen-auth2] commit [~HUAWEI-aaa-authen-auth2] quit
# Configure an accounting scheme named acct2, with RADIUS accounting specified.
[~HUAWEI-aaa] accounting-scheme acct2 [*HUAWEI-aaa-accounting-acct2] accounting-mode radius [*HUAWEI-aaa-accounting-acct2] commit [~HUAWEI-aaa-accounting-acct2] quit [~HUAWEI-aaa] quit
# Configure an authentication scheme named auth3, with none authentication specified.
[~HUAWEI] aaa [~HUAWEI-aaa] authentication-scheme auth3 [*HUAWEI-aaa-authen-auth3] authentication-mode none [*HUAWEI-aaa-authen-auth3] commit [~HUAWEI-aaa-authen-auth3] quit
# Configure an accounting scheme named acct3, with none accounting specified.
[~HUAWEI-aaa] accounting-scheme acct3 [*HUAWEI-aaa-accounting-acct3] accounting-mode none [*HUAWEI-aaa-accounting-acct3] commit [~HUAWEI-aaa-accounting-acct3] quit [~HUAWEI-aaa] quit
[~HUAWEI] ip pool pool2 bas local [*HUAWEI-ip-pool-pool2] gateway 172.16.1.1 255.255.255.0 [*HUAWEI-ip-pool-pool2] commit [~HUAWEI-ip-pool-pool2] section 0 172.16.1.2 172.16.1.200 [~HUAWEI-ip-pool-pool2] dns-server 192.168.8.252 [*HUAWEI-ip-pool-pool2] commit [~HUAWEI-ip-pool-pool2] quit
[~HUAWEI] aaa [~HUAWEI-aaa] domain after-auth [*HUAWEI-aaa-domain-after-auth] authentication-scheme auth2 [*HUAWEI-aaa-domain-after-auth] accounting-scheme acct2 [*HUAWEI-aaa-domain-after-auth] commit [~HUAWEI-aaa-domain-after-auth] radius-server group rd2 [*HUAWEI-aaa-domain-after-auth] commit [~HUAWEI-aaa-domain-after-auth] quit [~HUAWEI-aaa] quit
[~HUAWEI] interface gigabitEthernet0/1/0 [~HUAWEI-GigabitEthernet0/1/0] bas [~HUAWEI-GigabitEthernet0/1/0-bas] access-type layer2-subscriber default-domain pre-authentication pre-web authentication after-auth [*HUAWEI-GigabitEthernet0/1/0-bas] authentication-method web [*HUAWEI-GigabitEthernet0/1/0-bas] commit
# sysname HUAWEI # radius-server group rd2 radius-server shared-key-cipher %^%#W)<2!w*fb2<lJf5$6S|($o\aAaq`_C!FAt*Yk-<!%^%# radius-server authentication 192.168.8.249 1812 weight 0 radius-server accounting 192.168.8.249 1813 weight 0 # ip pool pool2 bas local gateway 172.16.1.1 255.255.255.0 section 0 172.16.1.2 172.16.1.200 dns-server 192.168.8.252 # user-group web-before # acl number 6004 rule 5 permit ip source user-group web-before destination ip-address 192.168.8.251 0 rule 10 permit ip source ip-address 192.168.8.251 0 destination user-group web-before rule 15 permit ip source user-group web-before destination ip-address 192.168.8.252 0 rule 20 permit ip source ip-address 192.168.8.252 0 destination user-group web-before # acl number 6005 rule 5 permit tcp source user-group web-before destination-port eq www rule 10 permit tcp source user-group web-before destination-port eq 8080 # acl number 6008 rule 3 permit ip source ip-address any destination user-group web-before rule 5 permit ip source user-group web-before destination ip-address any # traffic classifier redirect operator or if-match acl 6005 precedence 4 # traffic classifier web-be-deny operator or if-match acl 6008 precedence 5 # traffic classifier web-be-permit operator or if-match acl 6004 precedence 3 # traffic behavior deny1 deny # traffic behavior perm1 # traffic behavior redirect http-redirect # traffic policy web share-mode classifier web-be-permit behavior perm1 precedence 1 classifier redirect behavior redirect precedence 2 classifier web-be-deny behavior deny1 precedence 3 # aaa authentication-scheme auth2 # authentication-scheme auth3 authentication-mode none # accounting-scheme acct2 # accounting-scheme acct3 accounting-mode none # domain pre-web authentication-scheme auth3 accounting-scheme acct3 ip-pool pool2 user-group web-before web-server 192.168.8.251 web-server url http://192.168.8.251 web-server url-parameter # domain after-auth authentication-scheme auth2 accounting-scheme acct2 radius-server group rd2 # interface GigabitEthernet0/1/0 bas # access-type layer2-subscriber default-domain pre-authentication pre-web authentication after-auth authentication-method web # traffic-policy web inbound # web-auth-server enable web-auth-server 192.168.8.251 key cipher %^%#aQL6,Ua<|@sxPQK/1f'4/GBJ6,6)q>$Z^7*,!2yR%^%# # undo web-auth-server source-ip all web-auth-server source-ip 192.168.8.1 # undo web-auth-server source-ipv6 all # return