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

Added iptables rules to make sure BGP don't ack back to BGP peer syn messages #1561

Merged
merged 2 commits into from
Apr 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions ansible/roles/test/tasks/qos_sai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,18 @@
- lldpd
- lldp-syncd

- name: Disable bgpd
- name: Ensure BGP Daemon stopped
become: yes
lineinfile: dest=/etc/quagga/daemons
regexp=^bgpd=.*$
line='bgpd=no'
notify:
- Restart Quagga Daemon
neethajohn marked this conversation as resolved.
Show resolved Hide resolved
supervisorctl: state=stopped name=bgpd
delegate_to: "{{ ansible_host }}_bgp"

- name: Add iptables rule to drop BGP SYN Packet from peer so that we do not ACK back
shell: "iptables -A INPUT -j DROP -p tcp --destination-port bgp"
become: true

- name: Add ip6tables rule to drop BGP SYN Packet from peer so that we do not ACK back
shell: "ip6tables -A INPUT -j DROP -p tcp --destination-port bgp"
become: true

- meta: flush_handlers

Expand Down Expand Up @@ -467,14 +471,20 @@
- lldpd
- lldp-syncd

- name: Remove iptables rule to drop BGP SYN Packet from Peer
shell: "iptables -D INPUT -j DROP -p tcp --destination-port bgp"
become: true

- name: Remove ip6tables rule to drop BGP SYN Packet from Peer
shell: "ip6tables -D INPUT -j DROP -p tcp --destination-port bgp"
become: true

- name: Enable bgpd
become: yes
lineinfile: dest=/etc/quagga/daemons
regexp=^bgpd=.*$
line='bgpd=yes'
supervisorctl: state=started name=bgpd
delegate_to: "{{ ansible_host }}_bgp"
notify:
- Restart Quagga Daemon
neethajohn marked this conversation as resolved.
Show resolved Hide resolved
delegate_to: "{{ ansible_host }}_bgp"

- name: Restore original watermark polling status
shell: counterpoll watermark {{watermark_status.stdout}}
Expand Down