< Home

Example for Configuring Combined Authentication on VLANIF Interface

Networking Requirements

As shown in Figure 1, lots of users in a company access the enterprise network through GE0/0/1 of the Switch (used as an access device). To effectively manage the users accessing the enterprise network, the company requires that only authenticated users can access the network. Considering that access users use various types of terminals and some terminals do not have authentication clients installed, the administrator needs to configure combined authentication on VLANIF interfaces.

Figure 1 Networking diagram for configuring combined authentication

Configuration Roadmap

The configuration roadmap is as follows:

  1. Create and configure a RADIUS server template, an AAA scheme, and an authentication domain; bind the RADIUS server template and the AAA scheme to the authentication domain. This step implements communication between the Switch and RADIUS server.
  2. Configure MAC address authentication on VLANIF interfaces.
  3. Configure Portal authentication.

Before configuring this example, ensure that devices can communicate with each other in the network.

Procedure

  1. Create VLANs and configure the VLAN allowed by the interface to ensure network communication.

    # Create VLAN 10 and VLAN 20.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch
    [Switch] vlan batch 10 20

    # On the Switch, set GE0/0/1 connecting to users as an access interface, and add GE0/0/1 to VLAN 10.

    [Switch] interface gigabitethernet 0/0/1
    [Switch-GigabitEthernet0/0/1] port link-type access
    [Switch-GigabitEthernet0/0/1] port default vlan 10 
    [Switch-GigabitEthernet0/0/1] quit

    Configure the interface type and VLANs according to the actual situation. In this example, users are added to VLAN 10.

    # On the Switch, set GE0/0/2 connecting to the RADIUS server as an access interface, and add GE0/0/2 to VLAN 20.

    [Switch] interface gigabitethernet 0/0/2
    [Switch-GigabitEthernet0/0/2] port link-type access
    [Switch-GigabitEthernet0/0/2] port default vlan 20
    [Switch-GigabitEthernet0/0/2] quit

  2. Create and configure a RADIUS server template, an AAA scheme, and an authentication domain.

    # Create and configure RADIUS server template rd1.

    [Switch] radius-server template rd1
    [Switch-radius-rd1] radius-server authentication 192.168.2.30 1812
    [Switch-radius-rd1] radius-server shared-key cipher Huawei@2012
    [Switch-radius-rd1] quit

    # Create AAA scheme abc and set the authentication mode to RADIUS.

    [Switch] aaa
    [Switch-aaa] authentication-scheme abc
    [Switch-aaa-authen-abc] authentication-mode radius
    [Switch-aaa-authen-abc] quit

    # Create authentication domain isp1, and bind AAA scheme abc and RADIUS server template rd1 to authentication domain isp1.

    [Switch-aaa] domain isp1
    [Switch-aaa-domain-isp1] authentication-scheme abc
    [Switch-aaa-domain-isp1] radius-server rd1
    [Switch-aaa-domain-isp1] quit
    [Switch-aaa] quit

    # Configure the default domain isp1 in the system view. When a user enters the user name in the format of user@isp1, the user is authenticated in the authentication domain isp1. If the user name does not carry the domain name or carries a nonexistent domain name, the user is authenticated in the default domain.

    [Switch] domain isp1

    # Test whether a user can be authenticated using RADIUS authentication. A user name test@huawei.com and password Huawei2012 have been configured on the RADIUS server.

    [Switch] test-aaa test@huawei.com Huawei2012 radius-template rd1
    Info: Account test succeeded.

  3. Configure MAC address authentication.

    # Switch the NAC mode to common mode.

    [Switch] undo authentication unified-mode
    Warning: Switching the authentication mode will take effect after system restart
    . Some configurations are invalid after the mode is switched. For the invalid co
    mmands, see the user manual. Save the configuration file and reboot now? [Y/N] y
    • By default, the NAC unified mode is used.
    • After the unified mode is switched to common mode, you must save the configuration and restart the device to make each function in the new configuration mode take effect.

    # Enable MAC address authentication in the system and VLANIF interface views

    <Switch> system-view
    [Switch] mac-authen
    [Switch] interface vlanif 10
    [Switch-Vlanif10] mac-authen
    [Switch-Vlanif10] quit

  4. Configure Portal authentication.

    # Create and configure Portal server template abc.

    [Switch] web-auth-server abc
    [Switch-web-auth-server-abc] server-ip 192.168.2.20
    [Switch-web-auth-server-abc] port 50200
    [Switch-web-auth-server-abc] url http://192.168.2.30:8080/webagent
    [Switch-web-auth-server-abc] quit

    Ensure that the port number configured on the device is the same as that used by the Portal server.

    # Enable Portal authentication.

    [Switch] interface vlanif 10 
    [Switch-Vlanif10] web-auth-server abc direct
    [Switch-Vlanif10] quit

    # Set the shared key to Huawei@123 in cipher text.

    [Switch] web-auth-server abc
    [Switch-web-auth-server-abc] shared-key cipher Huawei@123
    [Switch-web-auth-server-abc] quit

    # Set the maximum number of concurrent Portal users to 100.

    [Switch] portal max-user 100
    # Set the user keepalive detection interval to 500s.
    [Switch] portal timer offline-detect 500

  5. Verify the configuration.

    1. Run the display mac-authen, display portal, and display web-auth-server configuration commands. The command output shows that MAC address authentication and Portal authentication have been enabled on the interface VLANIF10.
    2. The user can access the network after passing MAC address authentication or Portal authentication.
    3. After the user goes online, you can run the display access-user command on the device to check all online user information.

Configuration Files

Switch configuration file

#
sysname Switch 
#                                                                               
vlan batch 10 20
undo authentication unified-mode
#                                                                               
domain isp1
#                                                                               
mac-authen
#
radius-server template rd1
 radius-server shared-key cipher %^%#t67cDelRvAQg;*"4@P/3~q_31Sn{ST\V8'Ci633)%^%#
 radius-server authentication 192.168.2.30 1812 weight 80
#                                                                               
web-auth-server abc                                                             
 server-ip 192.168.2.20                                                         
 port 50200                                                                     
 shared-key cipher %^%#t:hJ@gD7<+G&,"Y}Y[VP4\foQ&og/Gg(,J4#\!gD%^%#                             
 url http://192.168.2.30:8080/webagent  
#
aaa
 authentication-scheme abc
  authentication-mode radius
 domain isp1
  authentication-scheme abc
  radius-server rd1
#                                                                               
interface Vlanif10   
 web-auth-server abc direct                                                     
 mac-authen                                                                     
#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 10  
#
interface GigabitEthernet0/0/2             
 port link-type access                                                        
 port default vlan 20
#                                                                                             
portal max-user 100                                                             
portal timer offline-detect 500  
#
return
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >