2017-01-19 22:56:26 -06:00
|
|
|
#!/bin/bash
|
|
|
|
## vtysh only accepts script in stdin, so cannot be directly used in shebang
|
|
|
|
## Cut the tail of this script and feed vtysh stdin
|
|
|
|
sed -n -e '9,$p' < "$0" | vtysh "$@"
|
|
|
|
## Exit with vtysh return code
|
|
|
|
exit $?
|
|
|
|
|
2018-06-14 23:53:31 -05:00
|
|
|
## vtysh script start from next line, which line number MUST equal in 'sed' command above
|
2017-01-19 22:56:26 -06:00
|
|
|
|
|
|
|
configure terminal
|
2017-08-08 18:23:58 -05:00
|
|
|
router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
|
|
|
|
{% for neighbor_addr in BGP_NEIGHBOR %}
|
2019-07-18 18:34:26 -05:00
|
|
|
{% if neighbor_addr | ipv4 %}
|
2017-08-08 18:23:58 -05:00
|
|
|
neighbor {{ neighbor_addr }} route-map ISOLATE out
|
2019-07-18 18:34:26 -05:00
|
|
|
{% else %}
|
|
|
|
address-family ipv6
|
|
|
|
neighbor {{ neighbor_addr }} route-map ISOLATE out
|
|
|
|
exit-address-family
|
|
|
|
{% endif %}
|
2017-01-19 22:56:26 -06:00
|
|
|
{% endfor %}
|
|
|
|
exit
|
|
|
|
exit
|
|
|
|
|
2017-08-08 18:23:58 -05:00
|
|
|
{% for neighbor_addr in BGP_NEIGHBOR %}
|
|
|
|
clear ip bgp {{ neighbor_addr }} soft out
|
2017-01-19 22:56:26 -06:00
|
|
|
{% endfor %}
|