Local guest configuration and management example

Network requirements

As shown in Figure 24, create a local guest named user1 for Jack. Configure local guest attributes and manage the local guest on the router as follows:

Figure 23: Network diagram

Configuration procedure

  1. Manage local guests:

    # Enable the guest auto-delete feature for expired local guests.

    <Router> system-view
    [Router] local-guest auto-delete enable
    

    # Specify an SMTP server to send local guest email notifications.

    [Router] local-guest email smtp-server smtp://192.168.0.112/smtp
    

    # Specify the email sender address as bbb@ccc.com in the email notifications sent by the device for local guests.

    [Router] local-guest email sender bbb@ccc.com
    

    # Specify the email address of the guest manager as guest-manager@ccc.com.

    [Router] local-guest manager-email guest-manager@ccc.com
    

    # Configure the subject and body of the email notifications to be sent to the local guest.

    [Router] local-guest email format to guest subject Guest account information
    [Router] local-guest email format to guest body A guest account has been created for your use. The username, password, and valid dates for the account are given below.
    

    # Configure the subject and body of the email notifications to be sent to the guest sponsor.

    [Router] local-guest email format to sponsor subject Guest account information
    [Router] local-guest email format to sponsor body A guest account has been created. The username, password, and valid dates for the account are given below.
    

    # Configure the subject and body of the email notifications to be sent to the guest manager.

    [Router] local-guest email format to manager subject Guest registration information
    [Router] local-guest email format to manager body A guest account has been registered. The username for the account is given below. Please approve the register information.
    
  2. Configure the local guest:

    # Create a user group named guest1.

    [Router] user-group guest1
    [Router-ugroup-guest1] quit
    

    # Create a local guest named user1 and enter local guest view.

    [Router] local-user user1 class network guest
    

    # Set the guest password to 123456 in plain text.

    [Router-luser-network(guest)-user1] password simple 123456
    

    # Assign the guest to user group guest1.

    [Router-luser-network(guest)-user1] group guest1
    

    # Specify the name of the local guest.

    [Router-luser-network(guest)-user1] full-name Jack
    

    # Specify the company of the local guest.

    [Router-luser-network(guest)-user1] company cc
    

    # Configure the email address of the local guest.

    [Router-luser-network(guest)-user1] email Jack@cc.com
    

    # Configure the phone number of the local guest.

    [Router-luser-network(guest)-user1] phone 131129237
    

    # Configure a description for the local guest.

    [Router-luser-network(guest)-user1] description A guest from company cc
    

    # Configure the validity period of the local guest.

    [Router-luser-network(guest)-user1] validity-datetime 2015/4/1 08:00:00 to 2015/4/3 18:00:00
    

    # Specify the guest sponsor name as Sam.

    [Router-luser-network(guest)-user1] sponsor-full-name Sam
    

    # Configure the email address of the guest sponsor.

    [Router-luser-network(guest)-user1] sponsor-email Sam@aa.com
    

    # Configure the department of the guest sponsor as security.

    [Router-luser-network(guest)-user1] sponsor-department security
    [Router-luser-network(guest)-user1] quit
    
  3. Configure the device to send guest email notifications:

    # Send an email notification to the guest sponsor.

    [Router] local-guest send-email user-name user1 to sponsor
    

    # Send an email notification to the guest.

    [Router] local-guest send-email user-name user1 to guest
    

Verifying the configuration

# Display local guest information.

[Router] display local-user user-name user1 class network guest
Total 1 local users matched.

Network access guest user user1:
  State:                     Active
  Service type:              LAN access/Portal
  User group:                guest1
  Full name:                 Jack
  Company:                   cc
  Email:                     Jack@cc.com
  Phone:                     131129237
  Description:               A guest from company cc
  Sponsor full name:         Sam
  Sponsor department:        security
  Sponsor email:             Sam@aa.com
  Period of validity: 
    Start date and time:     2015/04/01-08:00:00
    Expiration date and time:2015/04/03-18:00:00

# Verify that Jack can use username user1 and password 123456 to pass local authentication and come online during the validity period. (Details not shown.)