diff --git a/dockers/docker-fpm-frr/frr/bgpd/templates/internal/peer-group.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/templates/internal/peer-group.conf.j2 index c5f3f0b2f3a9..0b15136c555a 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/templates/internal/peer-group.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/templates/internal/peer-group.conf.j2 @@ -19,7 +19,7 @@ exit-address-family address-family ipv6 {% if CONFIG_DB__DEVICE_METADATA['localhost']['switch_type'] == 'chassis-packet' %} - neighbor INTERNAL_PEER_V4 update-source {{ get_ipv6_loopback_address(CONFIG_DB__LOOPBACK_INTERFACE, "Loopback4096") | ip }} + neighbor INTERNAL_PEER_V6 update-source {{ get_ipv6_loopback_address(CONFIG_DB__LOOPBACK_INTERFACE, "Loopback4096") | ip }} {% elif CONFIG_DB__DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %} neighbor INTERNAL_PEER_V6 route-reflector-client {% endif %} diff --git a/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_chasiss_packet.conf b/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_chasiss_packet.conf index 08ef259e0899..c36359de77dd 100644 --- a/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_chasiss_packet.conf +++ b/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_chasiss_packet.conf @@ -11,7 +11,7 @@ neighbor INTERNAL_PEER_V4 route-map TO_BGP_INTERNAL_PEER_V4 out exit-address-family address-family ipv6 - neighbor INTERNAL_PEER_V4 update-source 2603:10e2:400::3 + neighbor INTERNAL_PEER_V6 update-source 2603:10e2:400::3 neighbor INTERNAL_PEER_V6 soft-reconfiguration inbound neighbor INTERNAL_PEER_V6 allowas-in 1 neighbor INTERNAL_PEER_V6 route-map FROM_BGP_INTERNAL_PEER_V6 in diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 58bc90c004a1..4a60cd4edce1 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -279,7 +279,7 @@ def parse_png(png, hname, dpg_ecmp_content = None): mux_cable_ports[intf_name] = "true" - if (len(dpg_ecmp_content)): + if dpg_ecmp_content and (len(dpg_ecmp_content)): for version, content in dpg_ecmp_content.items(): # version is ipv4 or ipv6 fine_grained_content = formulate_fine_grained_ecmp(version, content, port_device_map, port_alias_map) # port_alias_map FG_NHG_MEMBER.update(fine_grained_content['FG_NHG_MEMBER']) diff --git a/src/sonic-config-engine/tests/sample-chassis-packet-lc-graph.xml b/src/sonic-config-engine/tests/sample-chassis-packet-lc-graph.xml index 96726b2a3fb0..26e6ccb9322e 100644 --- a/src/sonic-config-engine/tests/sample-chassis-packet-lc-graph.xml +++ b/src/sonic-config-engine/tests/sample-chassis-packet-lc-graph.xml @@ -105,7 +105,7 @@ - str2-88 + str2-8808-lc2-1 @@ -114,7 +114,18 @@ Eth1/1/47 27.1.1.1/24 - + + + + + + IPNextHop + + 8.0.0.1/32 +
192.168.1.2,192.168.2.2
+ StaticRoute +
+
diff --git a/src/sonic-config-engine/tests/sample-chassis-packet-lc-port-config.ini b/src/sonic-config-engine/tests/sample-chassis-packet-lc-port-config.ini index ed0f52a1adf5..52cb3360a504 100644 --- a/src/sonic-config-engine/tests/sample-chassis-packet-lc-port-config.ini +++ b/src/sonic-config-engine/tests/sample-chassis-packet-lc-port-config.ini @@ -1,4 +1,4 @@ -# name lanes alias index speed asic_port_name role source_npu target_npu +# name lanes alias index speed asic_port_name role Ethernet13 1280,1281,1282,1283 Eth1/1/13 13 100000 Eth13-ASIC1 Ext Ethernet14 1284,1285,1286,1287 Eth1/1/14 14 100000 Eth14-ASIC1 Ext Ethernet16 1288,1289,1290,1291 Eth1/1/16 16 100000 Eth16-ASIC1 Ext diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index ba2250ac7d8f..5a2250f0f904 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -898,6 +898,13 @@ def test_minigraph_bgp_packet_chassis_peer(self): ) def test_minigraph_bgp_packet_chassis_static_route(self): + argument = '-m "' + self.packet_chassis_graph + '" -p "' + self.packet_chassis_port_ini + '" -v "STATIC_ROUTE"' + output = self.run_script(argument) + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict("{'8.0.0.1/32': {'nexthop': '192.168.1.2,192.168.2.2'}}") + ) + argument = '-m "' + self.packet_chassis_graph + '" -p "' + self.packet_chassis_port_ini + '" -n "' + "asic1" + '" -v "STATIC_ROUTE"' output = self.run_script(argument) self.assertEqual(