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

[frr/ruijie] fix #4733 Add support for BGP_ROUTEMAPS #4955

Closed
wants to merge 1 commit into from
Closed
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
48 changes: 48 additions & 0 deletions dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,53 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
{% endblock maximum_paths %}
{% endif %}
!
{% if BGP_ROUTEMAPS %}
{% for name, routemap in BGP_ROUTEMAPS.iteritems() %}
route-map {{ name[0] }} {{ routemap['opttype'] }} {{ routemap['seqnumber'] }}
{% if routemap.has_key('matchcommunity') %}
match community {{ routemap['matchcommunity'] }}
{% endif %}
{% if routemap.has_key('prefix_name') %}
match ip address prefix-list {{ routemap['prefix_name'] }}
{% endif %}
{% if routemap.has_key('comm_range') %}
set community {{ routemap['comm_range'] }}
{% endif %}
{% if routemap.has_key('applycost') %}
set metric {{ routemap['applycost'] }}
{% endif %}
!
{% endfor %}
{% endif %}
!
{% block bgp_peers_with_range %}
{% if BGP_PEER_RANGE %}
{% for bgp_peer in BGP_PEER_RANGE.values() %}
neighbor {{ bgp_peer['name'] }} peer-group
{% if bgp_peer.has_key('remote_as') %}
neighbor {{ bgp_peer['name'] }} remote-as {{ bgp_peer['remote_as'] }}
{% endif %}
{% if bgp_peer.has_key('password') %}
neighbor {{ bgp_peer['name'] }} password simple {{ bgp_peer['password'] }}
{% endif %}
{% if bgp_peer.has_key('description') %}
neighbor {{ bgp_peer['name'] }} description {{ bgp_peer['description'] }}
{% endif %}
{% if bgp_peer.has_key('source') %}
neighbor {{ bgp_peer['name'] }} update-source {{ bgp_peer['source'] }}
{% endif %}
{% endfor %}
{% for bgp_peer in BGP_PEER_RANGE.values() %}
{% if bgp_peer.has_key('ip_range') %}
{% for iplist in bgp_peer['ip_range'] %}
{% if iplist %}
neighbor {{ iplist }} peer-group {{ bgp_peer['name'] }}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
{% endblock bgp_peers_with_range %}
!
! end of template: bgpd/bgpd.main.conf.j2
!