On the network shown in Figure 1, the AC and AP are third-party WLAN access devices. Mobile STAs can access the Internet only after associating with a Wi-Fi network and passing Portal authentication. The requirements are as follows:
The RADIUS authentication and accounting keys configured on the RADIUS server must be the same as the shared key of the RADIUS server configured on the device.
# Add GE0/0/1 of SwitchA connected to SwitchB to VLANs 100 and 101. In this example, the AC uses the direct forwarding mode. If the AC uses the tunnel forwarding mode, you do not need to add this interface to VLAN 101.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 20 100 101 [SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] port link-type trunk [SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 100 101 [SwitchA-GigabitEthernet0/0/1] quit
# Add GE0/0/2 of SwitchA connected to the AC to VLANs 100 and 101.
[SwitchA] interface gigabitethernet 0/0/2 [SwitchA-GigabitEthernet0/0/2] port link-type trunk [SwitchA-GigabitEthernet0/0/2] port trunk allow-pass vlan 100 101 [SwitchA-GigabitEthernet0/0/2] quit
# Add GE0/0/3 of SwitchA connected to the server to VLAN 20.
[SwitchA] interface gigabitethernet 0/0/3 [SwitchA-GigabitEthernet0/0/3] port link-type trunk [SwitchA-GigabitEthernet0/0/3] port trunk allow-pass vlan 20 [SwitchA-GigabitEthernet0/0/3] quit
# Add interfaces on SwitchB to VLANs 100 and 101. In this example, the AC uses the direct forwarding mode. If the AC uses the tunnel forwarding mode, you do not need to add this interface to VLAN 101.
<HUAWEI> system-view [HUAWEI] sysname SwitchB [SwitchB] vlan batch 100 101 [SwitchB] interface gigabitethernet 0/0/1 [SwitchB-GigabitEthernet0/0/1] port link-type trunk [SwitchB-GigabitEthernet0/0/1] port trunk allow-pass vlan 100 101 [SwitchB-GigabitEthernet0/0/1] quit [SwitchB] interface gigabitethernet 0/0/2 [SwitchB-GigabitEthernet0/0/2] port link-type trunk [SwitchB-GigabitEthernet0/0/2] port trunk allow-pass vlan 100 101 [SwitchB-GigabitEthernet0/0/2] port trunk pvid vlan 100 [SwitchB-GigabitEthernet0/0/2] quit
# On SwitchA, specify an IP address for a VLANIF interface and configure a route destined for the server. In this example, the next hop is 10.4.1.2.
[SwitchA] interface vlanif 20 [SwitchA-Vlanif20] ip address 10.4.1.1 24 [SwitchA-Vlanif20] quit [SwitchA] interface vlanif 101 [SwitchA-Vlanif101] ip address 10.3.1.2 24 [SwitchA-Vlanif101] quit [SwitchA] ip route-static 10.5.1.0 255.255.255.0 10.4.1.2
Create and configure a RADIUS server template, an AAA authentication scheme, and an authentication domain.
[SwitchA] radius-server template rd1 [SwitchA-radius-rd1] radius-server authentication 10.5.1.3 1812 [SwitchA-radius-rd1] radius-server accounting 10.5.1.3 1813 [SwitchA-radius-rd1] radius-server shared-key cipher Huawei@2014 [SwitchA-radius-rd1] quit
[SwitchA] aaa [SwitchA-aaa] authentication-scheme abc [SwitchA-aaa-authen-abc] authentication-mode radius [SwitchA-aaa-authen-abc] quit
[SwitchA-aaa] accounting-scheme acco1 [SwitchA-aaa-accounting-acco1] accounting-mode radius [SwitchA-aaa-accounting-acco1] accounting realtime 15 [SwitchA-aaa-accounting-acco1] quit
[SwitchA-aaa] domain isp [SwitchA-aaa-domain-isp] authentication-scheme abc [SwitchA-aaa-domain-isp] accounting-scheme acco1 [SwitchA-aaa-domain-isp] radius-server rd1 [SwitchA-aaa-domain-isp] quit [SwitchA-aaa] quit
[SwitchA] aaa [SwitchA-aaa] authentication-scheme noauthen [SwitchA-aaa-authen-noauthen] authentication-mode none [SwitchA-aaa-authen-noauthen] quit
[SwitchA-aaa] domain ap_noauthen [SwitchA-aaa-domain-ap_noauthen] authentication-scheme noauthen [SwitchA-aaa-domain-ap_noauthen] quit [SwitchA-aaa] quit
# Configure non-authentication for the AP using either of the following methods:
[SwitchA] domain ap_noauthen mac-authen force mac-address 84a9-c48d-4020 mask ffff-ffff-ff00
[SwitchA] access-context profile enable [SwitchA] access-context profile name ap_access [SwitchA-access-context-ap_access] if-match vlan-id 100 [SwitchA-access-context-ap_access] quit [SwitchA] access-author policy name ap_noauthen [SwitchA-access-author-ap_noauthen] match access-context-profile ap_access action access-domain ap_noauthen [SwitchA-access-author-ap_noauthen] quit [SwitchA] access-author policy ap_noauthen global
[SwitchA] authentication unified-mode
By default, the unified mode is enabled. After you change the NAT mode between common and unified, the device automatically restarts.
[SwitchA] web-auth-server abc [SwitchA-web-auth-server-abc] server-ip 10.5.1.3 [SwitchA-web-auth-server-abc] port 50200 [SwitchA-web-auth-server-abc] url http://10.5.1.3:8445/portal [SwitchA-web-auth-server-abc] shared-key cipher Huawei@123 [SwitchA-web-auth-server-abc] quit
# Configure a Portal access profile named web1.
[SwitchA] portal-access-profile name web1 [SwitchA-portal-acces-profile-web1] web-auth-server abc direct [SwitchA-portal-acces-profile-web1] quit
[SwitchA] mac-access-profile name m1 [SwitchA-mac-access-profile-m1] quit
[SwitchA] authentication-profile name p1 [SwitchA-authen-profile-p1] mac-access-profile m1 [SwitchA-authen-profile-p1] portal-access-profile web1 [SwitchA-authen-profile-p1] access-domain isp force [SwitchA-authen-profile-p1] quit
[SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] authentication-profile p1 [SwitchA-GigabitEthernet0/0/1] quit