组网需求 <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

公司企业网通过交换机Switch实现各部门之间的互连。

要求正确配置IPv4 ACL,禁止研发部门和市场部门在上班时间(8:0018:00)访问工资查询服务器(IP地址为192.168.4.1),而总裁办公室不受限制,可以随时访问。

<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />

配置 IPv4 ACL 组网图

# 定义8:0018:00的周期时间段。

<Switch> system-view

[Switch] time-range trname 8:00 to 18:00 working-day

# 定义研发部门到工资查询服务器的访问规则。

[Switch] acl number 3000

[Switch-acl-adv-3000] rule deny ip source 192.168.2.0 0.0.0.255 destination 192.168.4.1 0.0.0.0 time-range trname

[Switch-acl-adv-3000] quit

# 定义市场 部门到工资查询服务器的访问规则。

[Switch] acl number 3001

[Switch-acl-adv-3001] rule deny ip source 192.168.3.0 0.0.0.255 destination 192.168.4.1 0.0.0.0 time-range trname

[Switch-acl-adv-3001] quit

应用 IPv4 ACL

# 定义类c_rd,对匹配IPv4 ACL 3000的报文进行分类。

[Switch] traffic classifier c_rd

[Switch-classifier-c_rd] if-match acl 3000

[Switch-classifier-c_rd] quit

# 定义流行为b_rd,动作为拒绝报文通过。

[Switch] traffic behavior b_rd

[Switch-behavior-b_rd] filter deny

[Switch-behavior-b_rd] quit

# 定义类c_market,对匹配IPv4 ACL 3001的报文进行分类。

[Switch] traffic classifier c_market

[Switch-classifier-c_market] if-match acl 3001

[Switch-classifier-c_market] quit

# 定义流行为b_market,动作为拒绝报文通过。

[Switch] traffic behavior b_market

[Switch-behavior-b_market] filter deny

[Switch-behavior-b_market] quit

# 定义QoS策略p_rd,为类c_rd指定流行为b_rd

[Switch] qos policy p_rd

[Switch-qospolicy-p_rd] classifier c_rd behavior b_rd

[Switch-qospolicy-p_rd] quit

# 定义QoS策略p_market,为类c_market指定流行为b_market

[Switch] qos policy p_market

[Switch-qospolicy-p_market] classifier c_market behavior b_market

[Switch-qospolicy-p_market] quit

# QoS策略p_rd应用到端口Ethernet 2/0/2

[Switch] interface Ethernet 2/0/2

[Switch-Ethernet2/0/2] qos apply policy p_rd inbound

[Switch-Ethernet2/0/2] quit

# QoS策略p_market应用到端口Ethernet 2/0/3

[Switch] interface Ethernet 2/0/3

[Switch-Ethernet2/0/3] qos apply policy p_market inbound