# Border Gateway Protocol (BGP)

# URL

frinx-openconfig-network-instance:network-instances/network-instance=default/protocols/protocol=frinx-openconfig-policy-types%3ABGP,

# OPENCONFIG YANG

YANG models

{
    "protocol": [
        {
            "identifier": "frinx-openconfig-policy-types:BGP",
            "name": "",
            "config": {
                "identifier": "frinx-openconfig-policy-types:BGP",
                "name": ""
            },
                        
            "local-aggregates": {
                "aggregate": [
                    {
                        "config": {
                            "prefix": "",
                            "frinx-bgp-extension:apply-policy": [
                                ""
                            ]
                        }
                    }
                ]
            },
            
            "bgp": {
                "global": {
                   "afi-safis": {
                       "afi-safi": [
                           {
                               "afi-safi-name": "",
                               "config": {
                                   "afi-safi-name": "",
                                   "frinx-bgp-extension:auto-summary": "",
                                   "frinx-bgp-extension:redistribute-connected": {
                                       "enabled": "",
                                       "route-map": ""
                                   },
                                   "frinx-bgp-extension:redistribute-static": {
                                       "enabled": "",
                                       "route-map": ""
                                   },
                                   "frinx-bgp-extension:synchronization": "",
                                   "frinx-bgp-extension:default-information-originate": "",
                                   "frinx-bgp-extension:table-map": ""
                               }
                           }
                       ]
                   },
                   "config": {
                       "frinx-bgp-extension:log-neighbor-changes": "",
                       "as": "",
                       "router-id": "",
                       "frinx-bgp-extension:import-route": [
                           ""
                       ]
                   }
                },
                "neighbors|peer-groups": {
                    "neighbor|peer-group": [
                        {
                            "neighbor-address": "", //only for neighbor
                            "peer-group-name": "", //only for peer-group
                            "config": {
                                "neighbor-address": "", //only for neighbor
                                "peer-group-name": "", //only for peer-group
                                "peer-group": "", //only for neighbor
                                "peer-as": "",
                                "auth-password": "",
                                "description": "",
                                "send-community": "",
                                "remove-private-as": "",
                                "enabled": "",
                                "frinx-bgp-extension:neighbor-version": "",
                                "frinx-bgp-extension:fall-over-mode": "",
                                "frinx-bgp-extension:as-override": "",
                                "frinx-bgp-extension:timer-configuration": {
                                    "timer-mode": "",
                                    "time-before": "",
                                    "time-after": ""
                                },
                                "frinx-bgp-extension:transport": "",
                                "local-as": "",
                                "frinx-bgp-extension:local-as-group": {
                                    "no-prepend": "",
                                    "replace-as": ""
                                }
                            },
                            "transport": {
                                "config": {
                                    "local-address": "",
                                    "passive-mode": ""
                                }
                            },
                            "route-reflector": {
                                "config": {
                                    "route-reflector-client": ""
                                }
                            },
                            "ebgp-multihop": {
                                "config": {
                                    "enabled": "",
                                    "multihop-ttl": ""
                                }
                            },
                            "afi-safis": {
                                "afi-safi": [
                                    {
                                        "afi-safi-name": "",
                                        "config": {
                                            "frinx-bgp-extension:soft-reconfiguration": {
                                                "always": true|false
                                            },
                                            "afi-safi-name": ""
                                        },
                                        "apply-policy": {
                                            "config": {
                                                "import-policy": "",
                                                "export-policy": ""
                                            }
                                        },
                                        "ipv4|ipv6|vpnv4-unicast|l2vpn-evpn": {
                                            "config": {
                                                "send-default-route": "",
                                                "frinx-bgp-extension:send-default-route-route-policy": ""
                                            },
                                            "prefix-limit": {
                                                "config": {
                                                    "max-prefixes": "",
                                                    "shutdown-threshold-pct": ""
                                                }
                                            }
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
          
            }
        }
    ]
}

# OS Configuration Commands

# Cisco IOS XR 5.3.4

# CLI


router bgp  instance 
 
 address-family 
  network  route-policy 

 neighbor 
  remote-as 
  use neighbor-group 
  password clear 
  description 
  update-source 
  ebgp-multihop 
  no shutdown | shutdown

  address-family 
   route-policy | in|out
   maximum-prefix  
   send-community-ebgp 
   remove-private-AS
   next-hop-self
   default-originte
   soft-reconfiguration inbound always

ipv4 unicast is a conversion of set IPV4_UNICAST
ipv6 unicast is a conversion of set IPV6_UNICAST
remove-private-AS is a conversion of
default-originte is a conversion of
next-hop-self is a conversion of if value is "nexthopself"
no shutdown is a conversion of set true
shutdown is a conversion of set false
ipv4 unicast is a conversion of set IPV4_UNICAST
ipv6 unicast is a conversion of set IPV6_UNICAST
vpnv4 unicast is a conversion of set L3VPN_IPV4_UNICAST

# Unit

Link to github : xr-unit

# Cisco IOS XR 6.6.1 (via NetConf)

# CLI


router bgp  instance 
 
 address-family 

 neighbor 
  remote-as 
  password clear 
  description 
  update-source 
  address-family 

l2vpn evpn is a conversion of set L2VPN_EVPN
remove-private-AS is a conversion of
default-originte is a conversion of
next-hop-self is a conversion of if value is "nexthopself"
no shutdown is a conversion of set true
shutdown is a conversion of set false
l2vpn evpn is a conversion of set L2VPN_EVPN

# Unit

Link to github : xr-unit

# Cisco IOS XR 6.6.1 (no NetConf)

# CLI


router bgp 
 
 neighbor-group 
  address-family 
   route-policy | in|out

vpnv4 unicast is a conversion of set L3VPN_IPV4_UNICAST

# Unit

Link to github : xr-unit

# Cisco IOS XR 6.6.2

# CLI


router bgp  instance 
 
 address-family 
  network 

 neighbor 
  remote-as 
  password clear 
  description 

  address-family 
   route-policy | in|out
   maximum-prefix  
   send-community-ebgp 
   remove-private-AS
   default-originte route-policy 
   soft-reconfiguration inbound always

ipv4 unicast is a conversion of set IPV4_UNICAST
ipv6 unicast is a conversion of set IPV6_UNICAST
remove-private-AS is a conversion of
default-originte is a conversion of
ipv4 unicast is a conversion of set IPV4_UNICAST
ipv6 unicast is a conversion of set IPV6_UNICAST

# Unit

Link to github : xr-unit

# Cisco IOS XE 03.13.01.S


router bgp 
 bgp log-neighbor-changes|no bgp log-neighbor-changes
 neighbor  peer-group
 neighbor  peer-group 
 neighbor | remote-as 
 neighbor | transport connection-mode passive
 neighbor | password 
 neighbor | update-source 
 neighbor | description 
 address-family 
  neighbor | send-community 
  neighbor | route-reflector-client
  neighbor | route-map | in|out
  neighbor  version 
  neighbor  as-override
  neighbor  fall-over bfd
  neighbor  activate
  neighbor  remove-private-as
  neighbor  local-as   
  auto-summary|no auto-summary
  redistribute connected route-map |no redistribute connected
  redistribute static route-map |no redistribute static
  default-information originate|no default-information originate
  synchronization|no synchronization
  table-map  filter

bgp log-neighbor-changes is a conversion of set true
no bgp log-neighbor-changes is a conversion of set false default-information originate is a conversion of set true
no default-information originate is a conversion of set false neighbor as-override is a conversion of set true neighbor fall-over bfd is a conversion of set true transport connection-mode passive is a conversion of set true
route-reflector-client is a conversion of set true
remove-private-as is a conversion of set "frinx-openconfig-bgp-types:PRIVATE_AS_REMOVE_ALL" no-prepend is a conversion of set true
replace-as is a conversion of set true
neighbor version 4 is a conversion of set "frinx-bgp-extension:VERSION_4" auto-summary is a conversion of set true
no auto-summary is a conversion of set false *redistribute connected route-map * is a conversion of set true
no redistribute connected is a conversion of set false *redistribute static route-map * is a conversion of set true
no redistribute static is a conversion of set false synchronization is a conversion of set true
no synchronization is a conversion of set false

# Junos 17.3R1.10

# CLI


set routing-options autonomous-system 
activate protocols bgp group  neighbor  peer-as 

activate is a conversion of set true
deactivate is a conversion of set false

# Unit

Link to github : junos-unit

# Huawei NE5000E (V800R009C10SPC310)

# CLI


 
bgp                                  
 router-id                    
 peer  as-number             
 peer  description       
 peer  password cipher 
 peer  path-mtu 
 peer  timer   hold 
                                       
 ipv4-family unicast                       
  import-route 
  peer  enable                   
  peer  route-policy  import
  peer  route-policy  export

auto-discovery is conversion of set "frinx-bgp-extension:transport"
keepalive is conversion of set "timer_mode"
0-21845 is conversion of set "time_before"
3-65535 is conversion of set "timer_after"
direct, static is conversions of set "import_route"

# Unit

Link to github : huawei-unit