我正在使用FPM做一些事情,我认为它可以满足您的需求:
load protocol system:fpm/phdf/ether.phdf
load protocol flash:/fpm/phdf/ipv6.phdf
!
class-map type stack match-all cm-ipv6
match field ETHER type eq 0x86DD next IPV6
class-map type access-control match-all cm-ipv6-facebook
match start IPV6 dest-addr offset 9 size 4 eq 0xFACEB00C
!
policy-map type access-control pm-ipv6-facebook
class cm-ipv6-facebook
drop
policy-map type access-control pm-filter
class cm-ipv6
log
service-policy pm-ipv6-facebook
!
interface FastEthernet0/1
service-policy type access-control input pm-filter
我必须为此滚动自己的ipv6.phdf文件:
<?xml version="1.0" encoding="UTF-8"?>
<phdf>
<version>1</version>
<protocol name="ipv6" description="Definition-for-the-IPv6-protocol">
<field name="version" description="IP version">
<offset type="fixed-offset" units="bits">0</offset>
<length type="fixed" units="bits">4</length>
</field>
<field name="tc" description="IPv6-Traffic-Class">
<offset type="fixed-offset" units="bits">4</offset>
<length type="fixed" units="bits">8</length>
</field>
<field name="fl" description="IPv6-Flow-Label">
<offset type="fixed-offset" units="bits">12</offset>
<length type="fixed" units="bits">20</length>
</field>
<field name="length" description="IPv6-Payload-Length">
<offset type="fixed-offset" units="bits">32</offset>
<length type="fixed" units="bits">16</length>
</field>
<field name="nh" description="IPv6-Next-Header">
<offset type="fixed-offset" units="bits">48</offset>
<length type="fixed" units="bits">8</length>
</field>
<field name="hl" description="IPv6-Hop-Limit">
<offset type="fixed-offset" units="bits">56</offset>
<length type="fixed" units="bits">8</length>
</field>
<field name="source-addr" description="IPv6-Source-Address">
<offset type="fixed-offset" units="bits">64</offset>
<length type="fixed" units="bits">128</length>
</field>
<field name="dest-addr" description="IPv6-Destination-Address">
<offset type="fixed-offset" units="bits">192</offset>
<length type="fixed" units="bits">128</length>
</field>
<field name="payload-start" description="IPv6-Payload-Start">
<offset type="fixed-offset" units="bits">320</offset>
<length type="fixed" units="bits">0</length>
</field>
<headerlength type="fixed" value="320"></headerlength>
<constraint field="version" value="6" operator="eq"></constraint>
</protocol>
</phdf>
不幸的是,当我执行“显示策略映射类型访问控制接口fa0 / 1”时,在ethertype上没有找到匹配项:
FastEthernet0/1
Service-policy access-control input: pm-filter
Class-map: cm-ipv6 (match-all)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: field ETHER type eq 0x86DD next IPV6
log
Service-policy access-control : pm-ipv6-facebook
Class-map: cm-ipv6-facebook (match-all)
0 packets, 0 bytes
5 minute offered rate 0 bps
Match: start IPV6 dest-addr offset 9 size 4 eq 0xFACEB00C
drop
Class-map: class-default (match-any)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
Class-map: class-default (match-any)
10000 packets, 1863618 bytes
5 minute offered rate 14000 bps, drop rate 0 bps
Match: any
我怀疑我对Facebook IPv6地址的ping不能通过CEF正常运行(FPM常见问题解答说这是必需的),或者我丢失了一些东西。尽管如此,我还是将它提供给任何想要咀嚼的人。