As shown in Figure 1, the Switch functions as an FTP server. The requirements are as follows:
Reachable routes exist between the Switch and subnets. You need to configure the Switch to limit user access to the FTP server.
The following configurations are performed on the Switch. The configuration roadmap is as follows:
<HUAWEI> system-view [HUAWEI] sysname Switch [Switch] time-range ftp-access from 0:0 2014/1/1 to 23:59 2014/12/31 [Switch] time-range ftp-access 14:00 to 18:00 off-day
[Switch] acl number 2001 [Switch-acl-basic-2001] rule permit source 172.16.105.0 0.0.0.255 [Switch-acl-basic-2001] rule permit source 172.16.107.0 0.0.0.255 time-range ftp-access [Switch-acl-basic-2001] rule deny source any [Switch-acl-basic-2001] quit
[Switch] ftp server enable [Switch] aaa [Switch-aaa] local-user huawei password irreversible-cipher SetUserPasswd@123 [Switch-aaa] local-user huawei privilege level 15 [Switch-aaa] local-user huawei service-type ftp [Switch-aaa] local-user huawei ftp-directory flash: [Switch-aaa] quit
[Switch] ftp acl 2001
Run the ftp 172.16.104.110 command on PC1 (172.16.105.111/24) in subnet 1. PC1 can connect to the FTP server.
Run the ftp 172.16.104.110 command on PC2 (172.16.107.111/24) in subnet 2 on Monday in 2014. PC2 cannot connect to the FTP server. Run the ftp 172.16.104.110 command on PC2 (172.16.107.111/24) in subnet 2 at 15:00 on Saturday in 2014. PC2 can connect to the FTP server.
Run the ftp 172.16.104.110 command on PC3 (10.10.10.1/24). PC3 cannot connect to the FTP server.
Switch configuration file
# sysname Switch # FTP server enable FTP acl 2001 # time-range ftp-access 14:00 to 18:00 off-day time-range ftp-access from 00:00 2014/1/1 to 23:59 2014/12/31 # acl number 2001 rule 5 permit source 172.16.105.0 0.0.0.255 rule 10 permit source 172.16.107.0 0.0.0.255 time-range ftp-access rule 15 deny # aaa local-user huawei password irreversible-cipher $1a$a/sUWg/.p1*))=~SWzIRS0N",`&aS%'7X).m=o[PkQcv"!!TTQOI~Z)C'1<9$ local-user huawei privilege level 15 local-user huawei ftp-directory flash: local-user huawei service-type ftp # return