Skip to content

Commit

Permalink
[neighbor_advertiser]: Add V6 support to mirror ICMPV6 packets (sonic…
Browse files Browse the repository at this point in the history
…-net#612)

Add two entries to mirror ICMPV6 type 128 and 129 packets.

Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
  • Loading branch information
stcheng authored and yxieca committed Aug 26, 2019
1 parent 81e1420 commit de9d6f9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion scripts/neighbor_advertiser
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ SYSLOG_IDENTIFIER = 'neighbor_advertiser'

MIRROR_SESSION_NAME = 'neighbor_advertiser'
MIRROR_ACL_TABLE_NAME = 'EVERFLOW'
MIRROR_ACL_TABLEV6_NAME = 'EVERFLOWV6'
MIRROR_ACL_RULE_NAME = 'rule_arp'
MIRROR_ACL_RULEV6_NAME = 'rule_nd'
VXLAN_TUNNEL_NAME = 'neighbor_advertiser'
VXLAN_TUNNEL_MAP_PREFIX = 'map_'

Expand Down Expand Up @@ -314,7 +316,17 @@ def add_mirror_acl_rule():
'mirror_action': MIRROR_SESSION_NAME
}

config_db.set_entry('ACL_RULE', (MIRROR_ACL_TABLE_NAME, MIRROR_ACL_RULE_NAME), acl_rule_info)
config_db.set_entry('ACL_RULE',
(MIRROR_ACL_TABLE_NAME, MIRROR_ACL_RULE_NAME), acl_rule_info)

acl_rule_info = {
'PRIORITY': '8887',
'ICMPV6_TYPE': '128',
'mirror_action': MIRROR_SESSION_NAME
}

config_db.set_entry('ACL_RULE',
(MIRROR_ACL_TABLEV6_NAME, MIRROR_ACL_RULEV6_NAME), acl_rule_info)


def set_mirror_tunnel(ferret_server_ip):
Expand All @@ -333,6 +345,7 @@ def remove_mirror_session():

def remove_mirror_acl_rule():
config_db.set_entry('ACL_RULE', (MIRROR_ACL_TABLE_NAME, MIRROR_ACL_RULE_NAME), None)
config_db.set_entry('ACL_RULE', (MIRROR_ACL_TABLEV6_NAME, MIRROR_ACL_RULEV6_NAME), None)


def reset_mirror_tunnel():
Expand Down

0 comments on commit de9d6f9

Please sign in to comment.