Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ebtables]add the filter rule for ARP packets with vlan tag: #3945

Merged
merged 1 commit into from
May 7, 2020

Conversation

wangshengjun
Copy link
Contributor

  1. ebtables -t filter -A FORWARD -p 802_1Q --vlan-encap 0806 -j DROP
    The ARP packet with vlan tag can't match the default rule.

Signed-off-by: wangshengjun wangshengjun@asterfusion.com

- What I did
The default rule can't match the ARP packet with vlan tag.So add a new rule for the case.
The new rule as follows:
ebtables -t filter -A FORWARD -p 802_1Q --vlan-encap 0806 -j DROP

- How I did it

- How to verify it
admin@sonic:~$ sudo ebtables -L
Bridge table: filter

Bridge chain: INPUT, entries: 0, policy: ACCEPT

Bridge chain: FORWARD, entries: 3, policy: ACCEPT
-d BGA -j DROP
-p ARP -j DROP
-p 802_1Q --vlan-encap ARP -j DROP

Bridge chain: OUTPUT, entries: 0, policy: ACCEPT

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

1. ebtables -t filter -A FORWARD -p 802_1Q --vlan-encap 0806 -j DROP
The ARP packet with vlan tag can't match the default rule.

Signed-off-by: wangshengjun <wangshengjun@asterfusion.com>
@lguohan
Copy link
Collaborator

lguohan commented Dec 27, 2019

why the checked in file is a binary file? can we have text file for the rule?

Copy link
Collaborator

@lguohan lguohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need text file, not binary file.

@wangshengjun
Copy link
Contributor Author

@lguohan The original file of ebtables.filter is binary file.

@wangshengjun
Copy link
Contributor Author

The ebtables.filter should be loaded in the running system, and check it by issuing the cmd of 'ebtables -L'

@lguohan
Copy link
Collaborator

lguohan commented Jan 26, 2020

@prsunny , can you take a look?

@prsunny
Copy link
Contributor

prsunny commented Feb 8, 2020

for persistance, the filter file was added as binary. Will discuss with Ying to identify an approach - Original PR - #2805

@peter-yu
Copy link

peter-yu commented Feb 12, 2020

There are silimiar issue about IPv6 neighbour-solicitation/neighbour-advertisement.

The following rule will filter duplicate untagged IPv6 NS/NA packets:

sudo /sbin/ebtables -t filter -A FORWARD -p IPV6 --ip6-protocol ipv6-icmp --ip6-icmp-type 135:136/0 -j DROP

As for vlan tagged IPv6 NS/NA packet, do you know how to filter only NS/NA, except using

sudo /sbin/ebtables -A FORWARD -p 802_1Q --vlan-encap IPv6 -j DROP

to drop all IPv6 packet?
Thanks.

@lguohan
Copy link
Collaborator

lguohan commented May 5, 2020

I am ok with the binary format as it is consistent with the original commit. @prsunny , are you ok with adding the new rule here?

@prsunny
Copy link
Contributor

prsunny commented May 5, 2020

@lguohan , lgtm

@prsunny prsunny merged commit bed4a79 into sonic-net:master May 7, 2020
rlhui pushed a commit that referenced this pull request May 10, 2020
1. ebtables -t filter -A FORWARD -p 802_1Q --vlan-encap 0806 -j DROP
The ARP packet with vlan tag can't match the default rule.

Signed-off-by: wangshengjun <wangshengjun@asterfusion.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants