Skip to content

Instantly share code, notes, and snippets.

View rohitthakur2590's full-sized avatar

Rohit Thakur rohitthakur2590

View GitHub Profile
@rohitthakur2590
rohitthakur2590 / bgp_address_family_before_overridden_deviation
Created June 21, 2021 11:51
Junos before BGP address family deviation
--- before
+++ after
@@ -10,24 +10,51 @@
"address_family[1].af_type[0].legacy_redirect_ip_action.send": true,
"address_family[1].af_type[0].loops": 4,
"address_family[1].af_type[0].no_install": true,
- "address_family[1].af_type[0].output_queue_priority_expedited": true,
+ "address_family[1].af_type[0].prefix_limit.forever": true,
+ "address_family[1].af_type[0].prefix_limit.limit_threshold": 100,
+ "address_family[1].af_type[0].prefix_limit.maximum": 15,
@rohitthakur2590
rohitthakur2590 / bgp_address_family_fact_diff.txt
Created June 21, 2021 11:32
Junos BGP address family fact diff
- name: Gather current BGP address family configuration from the device
junipernetworks.junos.junos_bgp_address_family:
state: gathered
register: result
- name: Find out diff between intended and current configuration
ansible.utils.fact_diff:
before: "{{ bgp_address_family|ansible.utils.to_paths }}"
after: "{{ result['gathered']|ansible.utils.to_paths }}"
@rohitthakur2590
rohitthakur2590 / relpaced_state_input.txt
Created June 21, 2021 09:43
bgp_address_family replaced yaml content
address_family:
- af_type:
- accepted_prefix_limit:
idle_timeout_value: 2001
limit_threshold: 98
maximum: 20
damping: true
defer_initial_multipath_build:
maximum_delay: 2
type: signaling
@rohitthakur2590
rohitthakur2590 / replaced_output.txt
Last active June 21, 2021 10:03
junos bgp_address_family replaced operation logs
Before Device Config:
=====================
vagrant@vsrx# show routing-options
autonomous-system 65534 loops 3 asdot-notation;
vagrant@vsrx# show protocols bgp
family inet {
unicast {
local-ipv4-address 9.9.9.9;
extended-nexthop;
@rohitthakur2590
rohitthakur2590 / merged.txt
Created June 17, 2021 14:27
Junos bgp address family merged operation log
Before Device Config:
=====================
vagrant@vsrx# show routing-options
autonomous-system 65534 loops 3 asdot-notation;
vagrant@vsrx# show protocols bgp
family inet {
flow {
loops 4;
no-install;
@rohitthakur2590
rohitthakur2590 / bgp_af_merged_config.txt
Created June 17, 2021 13:31
To be merged bgp_address_family_config
address_family:
- af_type:
- accepted_prefix_limit:
idle_timeout_value: 2001
limit_threshold: 98
maximum: 20
damping: true
defer_initial_multipath_build:
maximum_delay: 2
type: signaling
@rohitthakur2590
rohitthakur2590 / bgp_address_family_facts.yaml
Last active June 17, 2021 13:06
gathered facts for inventory host vars
[junos]$ cat lab_inventory/host_vars/junos/bgp_address_family.yaml
bgp_address_family:
address_family:
- af_type:
- accepted_prefix_limit:
idle_timeout_value: 2001
limit_threshold: 98
maximum: 20
damping: true
defer_initial_multipath_build:
@rohitthakur2590
rohitthakur2590 / bgp_address_family_inventory_build.yaml
Created June 17, 2021 11:18
BGP address family inventory builder example
---
- name: convert configured BGP address family resource to structured data
hosts: junos
vars:
inventory_dir: "lab_inventory"
inventory_hostname: "junos"
gather_facts: false
tasks:
- name: Use the bgp_address_family resource module to gather the current config
@rohitthakur2590
rohitthakur2590 / runnig_config.txt
Last active June 17, 2021 13:03
Junos running config
vagrant@vsrx# show routing-options
autonomous-system 65534 loops 3 asdot-notation;
vagrant@vsrx# show protocols bgp
family inet {
flow {
loops 4;
no-install;
output-queue-priority expedited;
legacy-redirect-ip-action {
@rohitthakur2590
rohitthakur2590 / ios_bgp_playbook.txt
Created April 20, 2021 14:00
Configure global BGP and bgp_address_family attributes for IOS platform
---
- name: IOS_BGP
hosts: ios-lab
collections:
- cisco.ios.ios
tasks:
- name: Configure global BGP with bgp_global
cisco.ios.ios_bgp_global:
config: