diff --git a/tests/bgp/conftest.py b/tests/bgp/conftest.py index afc4ce7e7f7..802ffa46b1a 100644 --- a/tests/bgp/conftest.py +++ b/tests/bgp/conftest.py @@ -238,7 +238,11 @@ def _setup_interfaces_dualtor(mg_facts, peer_count): { "local_intf": loopback_intf["name"], "local_addr": "%s/%s" % (loopback_intf_addr, loopback_intf_prefixlen), - "neighbor_intf": "eth%s" % mg_facts["minigraph_port_indices"][local_interface], + # Note: Config same subnets on PTF will generate two connect routes on PTF. + # This may lead different IPs has same FDB entry on DUT even they are on different + # interface and cause layer3 packet drop on PTF, so here same interface for different + # neighbor. + "neighbor_intf": "eth%s" % mg_facts["minigraph_port_indices"][local_interfaces[0]], "neighbor_addr": "%s/%s" % (mux_configs[local_interface]["server_ipv4"].split("/")[0], vlan_intf_prefixlen) } @@ -252,8 +256,7 @@ def _setup_interfaces_dualtor(mg_facts, peer_count): first_neighbor_port = None for conn in connections: - ptfhost.shell("ifconfig %s %s" % (conn["neighbor_intf"], - conn["neighbor_addr"])) + ptfhost.shell("ip address add %s dev %s" % (conn["neighbor_addr"], conn["neighbor_intf"])) if not first_neighbor_port: first_neighbor_port = conn["neighbor_intf"] # NOTE: this enables the standby ToR to passively learn