diff --git a/core/lib/Drupal/Core/Entity/EntityDisplayModeBase.php b/core/lib/Drupal/Core/Entity/EntityDisplayModeBase.php
index 0ec97b7..fe7f105 100644
--- a/core/lib/Drupal/Core/Entity/EntityDisplayModeBase.php
+++ b/core/lib/Drupal/Core/Entity/EntityDisplayModeBase.php
@@ -107,4 +107,16 @@ public static function preDelete(EntityStorageInterface $storage, array $entitie
     \Drupal::entityManager()->clearCachedFieldDefinitions();
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  protected function urlRouteParameters($rel) {
+    $uri_route_parameters = parent::urlRouteParameters($rel);
+    if ($rel === 'add-form') {
+      $uri_route_parameters['entity_type_id'] = $this->getTargetType();
+    }
+
+    return $uri_route_parameters;
+  }
+
 }
diff --git a/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php b/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php
index 3bb0b13..350a86a 100644
--- a/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php
+++ b/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\field_ui\Functional;
 
+use Drupal\Core\Entity\Entity\EntityFormMode;
+use Drupal\Core\Entity\Entity\EntityViewMode;
 use Drupal\Tests\BrowserTestBase;
 
 /**
@@ -68,6 +70,14 @@ public function testEntityViewModeUI() {
     // Test editing the view mode.
     $this->drupalGet('admin/structure/display-modes/view/manage/entity_test.' . $edit['id']);
 
+    // Test that the link templates added by field_ui_entity_type_build() are
+    // generating valid routes.
+    $view_mode = EntityViewMode::load('entity_test.' . $edit['id']);
+    $this->assertSame('/admin/structure/display-modes/view', $view_mode->toUrl('collection')->toString());
+    $this->assertSame('/admin/structure/display-modes/view/add/entity_test', $view_mode->toUrl('add-form')->toString());
+    $this->assertSame('/admin/structure/display-modes/view/manage/entity_test.' . $edit['id'], $view_mode->toUrl('edit-form')->toString());
+    $this->assertSame('/admin/structure/display-modes/view/manage/entity_test.' . $edit['id'] . '/delete', $view_mode->toUrl('delete-form')->toString());
+
     // Test deleting the view mode.
     $this->clickLink(t('Delete'));
     $this->assertRaw(t('Are you sure you want to delete the view mode %label?', ['%label' => $edit['label']]));
@@ -114,6 +124,14 @@ public function testEntityFormModeUI() {
     // Test editing the form mode.
     $this->drupalGet('admin/structure/display-modes/form/manage/entity_test.' . $edit['id']);
 
+    // Test that the link templates added by field_ui_entity_type_build() are
+    // generating valid routes.
+    $view_mode = EntityFormMode::load('entity_test.' . $edit['id']);
+    $this->assertSame('/admin/structure/display-modes/form', $view_mode->toUrl('collection')->toString());
+    $this->assertSame('/admin/structure/display-modes/form/add/entity_test', $view_mode->toUrl('add-form')->toString());
+    $this->assertSame('/admin/structure/display-modes/form/manage/entity_test.' . $edit['id'], $view_mode->toUrl('edit-form')->toString());
+    $this->assertSame('/admin/structure/display-modes/form/manage/entity_test.' . $edit['id'] . '/delete', $view_mode->toUrl('delete-form')->toString());
+
     // Test deleting the form mode.
     $this->clickLink(t('Delete'));
     $this->assertRaw(t('Are you sure you want to delete the form mode %label?', ['%label' => $edit['label']]));
