Skip to content

Commit

Permalink
frr set loopback interface type for default vrf loopback (#7039)
Browse files Browse the repository at this point in the history
  • Loading branch information
arifogel committed Jun 2, 2021
1 parent dfd9da7 commit 9053587
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ private void populateInterfaceProperties(Configuration c, InterfacesInterface if
@VisibleForTesting
static void populateLoopbackProperties(
@Nullable InterfacesInterface vsLoopback, org.batfish.datamodel.Interface viLoopback) {
viLoopback.setInterfaceType(InterfaceType.LOOPBACK);
if (vsLoopback != null && vsLoopback.getClagVxlanAnycastIp() != null) {
// Just assume CLAG is correctly configured and comes up
viLoopback.setAllAddresses(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import org.batfish.datamodel.EmptyIpSpace;
import org.batfish.datamodel.GeneratedRoute;
import org.batfish.datamodel.Interface;
import org.batfish.datamodel.InterfaceType;
import org.batfish.datamodel.Ip;
import org.batfish.datamodel.OriginType;
import org.batfish.datamodel.OspfExternalType2Route;
Expand Down Expand Up @@ -939,4 +940,11 @@ public void testOspfAddresses() throws IOException {
assertNull(iface.getOspfSettings());
}
}

@Test
public void testLoopbackInterfaceType() throws IOException {
Configuration c = parseConfig("loopback");
assertThat(c.getAllInterfaces(), hasKeys("lo"));
assertThat(c.getAllInterfaces().get("lo").getInterfaceType(), equalTo(InterfaceType.LOOPBACK));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
loopback
# This file describes the network interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

auto lo
iface lo

# ports.conf --
# ports.conf --
#
# configure port speed, aggregation, and subdivision.
#
# The ports in Cumulus VX are not configurable from here.
#frr version
frr version 4.0+cl3u8
frr defaults datacenter
hostname loopback
!

0 comments on commit 9053587

Please sign in to comment.