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

incomplete bgp route map for RM_SET_SRC/RM_SET_SRC6 #3765

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
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
14 changes: 12 additions & 2 deletions dockers/docker-fpm-frr/zebra.interfaces.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,23 @@ link-detect
{% endif %}
{% endfor %}
{% endif %}
{% if lo_ipv4_addrs|length > 0 or lo_ipv6_addrs|length > 0 %}
interface Loopback0
{% if lo_ipv4_addrs|length > 0 %}
ip address {{ lo_ipv4_addrs[0] }}
{% endif %}
{% if lo_ipv6_addrs|length > 0 %}
ipv6 address {{ lo_ipv6_addrs[0] | ip }}/{{ lo_ipv6_addrs[0] | prefixlen }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does not subscript the config db lo address change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, so does all configs in templates, there are several commands referenced the lo address. To follow changes, a lot of work to do. I think it is a new requirement.

{% endif %}
!
{% endif %}
! Set ip source to loopback for bgp learned routes
{% if lo_ipv4_addrs|length > 0 -%}
{% if lo_ipv4_addrs|length > 0 %}
route-map RM_SET_SRC permit 10
set src {{ lo_ipv4_addrs[0] | ip }}
!
{% endif %}
{% if lo_ipv6_addrs|length > 0 %}
{% if lo_ipv6_addrs|length > 0 %}
route-map RM_SET_SRC6 permit 10
set src {{ lo_ipv6_addrs[0] | ip }}
!
Expand Down
7 changes: 5 additions & 2 deletions src/sonic-config-engine/minigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ def parse_xml(filename, platform=None, port_config_file=None):
vlan_members = None
pcs = None
mgmt_intf = None
lo_intf = None
lo_intfs = None
neighbors = None
devices = None
hostname = None
Expand Down Expand Up @@ -650,7 +650,10 @@ def parse_xml(filename, platform=None, port_config_file=None):
if alias in port_speeds_default:
results['MGMT_PORT'][name]['speed'] = port_speeds_default[alias]
results['MGMT_INTERFACE'][(name, key[1])] = mgmt_intf[key]
results['LOOPBACK_INTERFACE'] = lo_intfs
results['LOOPBACK_INTERFACE'] = {}
for lo_intf in lo_intfs:
results['LOOPBACK_INTERFACE'][lo_intf] = lo_intfs[lo_intf]
results['LOOPBACK_INTERFACE'][lo_intf[0]] = {}
results['MGMT_VRF_CONFIG'] = mvrf

phyport_intfs = {}
Expand Down
5 changes: 4 additions & 1 deletion src/sonic-config-engine/tests/sample_output/frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ interface PortChannel04
link-detect
!
!
interface Loopback0
ip address 10.1.0.32/32
ipv6 address fc00:1::32/128
!
! Set ip source to loopback for bgp learned routes
route-map RM_SET_SRC permit 10
set src 10.1.0.32
!

route-map RM_SET_SRC6 permit 10
set src fc00:1::32
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ interface PortChannel8
link-detect
!
!
interface Loopback0
ip address 4.0.0.0/32
!
! Set ip source to loopback for bgp learned routes
route-map RM_SET_SRC permit 10
set src 4.0.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ interface Ethernet8
link-detect
!
!
interface Loopback0
ip address 4.0.0.0/32
!
! Set ip source to loopback for bgp learned routes
route-map RM_SET_SRC permit 10
set src 4.0.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ interface Ethernet8
link-detect
!
!
interface Loopback0
ip address 4.0.0.0/32
!
! Set ip source to loopback for bgp learned routes
route-map RM_SET_SRC permit 10
set src 4.0.0.0
Expand Down
5 changes: 4 additions & 1 deletion src/sonic-config-engine/tests/sample_output/zebra_frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ interface PortChannel04
link-detect
!
!
interface Loopback0
ip address 10.1.0.32/32
ipv6 address fc00:1::32/128
!
! Set ip source to loopback for bgp learned routes
route-map RM_SET_SRC permit 10
set src 10.1.0.32
!

route-map RM_SET_SRC6 permit 10
set src fc00:1::32
!
Expand Down