How to Configure an Interface to Allow Only Access from Certain IP Addresses?

m7g
m7g  Diamond  (1)
7 years 10 months ago  View: 1077  Reply: 0
1F
        To configure an interface to allow access from certain IP addresses, configure an ACL to match the IP addresses, reference the ACL in a traffic policy, and apply the traffic policy to the interface. For example, to allow only the user with IP address 1.1.1.2 to access Ethernet0/0/1, run the following commands:


[HUAWEI] acl number 3030
[HUAWEI-acl-adv-3030] rule permit ip source 1.1.1.2 0
[HUAWEI-acl-adv-3030] quit
[HUAWEI] acl number 3031
[HUAWEI-acl-adv-3031] rule permit ip
[HUAWEI] traffic classifier test1
[HUAWEI-classifier-test1] if-match acl 3030
[HUAWEI] traffic classifier test2
[HUAWEI-classifier-test2] if-match acl 3031
[HUAWEI] traffic behavior test1
[HUAWEI-behavior-test1] permit
[HUAWEI] traffic behavior test2
[HUAWEI-behavior-test2] deny
[HUAWEI] traffic policy test
[HUAWEI-trafficpolicy-test] classifier test1 behavior test1
[HUAWEI-trafficpolicy-test] classifier test2 behavior test2
[HUAWEI] interface ethernet 0/0/1
[HUAWEI-Ethernet0/0/1] traffic-policy test inbound