Configuring MAC‑Based Internet Access Restrictions on a Router Using Traffic Policies
This guide explains how to restrict selected LAN hosts from accessing the Internet by configuring MAC‑address based ACLs and traffic policies on a router, allowing only gateway communication while handling dynamic IP addresses.
The network diagram shows a router acting as the enterprise gateway; internal users access the Internet through it. Because the hosts may change IP addresses, limiting access by IP is ineffective, so the solution uses source MAC‑address based restrictions to block Internet access while still permitting gateway traffic.
Configuration steps on the router:
sysname Routervlan batch 10acl number 3001rule 1 permit ip destination 10.1.1.0 0.0.0.255traffic classifier gate operator andif-match acl 3001traffic classifier mac1 operator andif-match source-mac 0015-c50d-0001traffic classifier mac2 operator andif-match source-mac 0015-c50d-0002traffic classifier mac3 operator andif-match source-mac 0015-c50d-0003traffic behavior p1permittraffic behavior d1denytraffic policy myqosclassifier gate behavior p1classifier mac1 behavior d1classifier mac2 behavior d1classifier mac3 behavior d1interface Vlanif10ip address 10.1.1.1 255.255.255.0traffic-policy myqos inboundinterface Ethernet2/0/0port link-type trunkport trunk allow-pass vlan 10Verification: run display traffic policy user-defined to view the policy; restricted hosts can ping the gateway but not external IPs.
Configuration notes: ensure the router‑switch link is a trunk port with VLAN 10, and configure the gateway‑allowing classifier and behavior before the deny classifier because packets are matched sequentially.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
