Loopback
Loopback interfaces are virtual logical interfaces that provide a stable, always-up reference point for network services including routing protocol router IDs, management access, and service endpoints that remain accessible regardless of physical interface states. They support full Layer 3 functionality including IPv4 and IPv6 addressing, routing protocol participation (OSPF, BGP), MPLS services, and advanced features such as BFD for fast failure detection and network monitoring applications. Loopback interfaces are essential for network design best practices, providing consistent reachability for critical services, enabling effective network troubleshooting, and serving as anchor points for overlay networks, VPN services, and network management systems.
Diagram
Section titled “Diagram”Classes
Section titled “Classes”interfaces (iosxe.devices.configuration)
Section titled “interfaces (iosxe.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| loopbacks | List | [loopbacks] | No |
loopbacks (iosxe.devices.configuration.interfaces)
Section titled “loopbacks (iosxe.devices.configuration.interfaces)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| id | Integer | Yes | ||
| interface_groups | List | String | No | |
| interface_group_policy | Choice | merge, replace | No | |
| description | String | No | ||
| shutdown | Boolean | true, false | No | |
| ip_mtu | Integer | min: 68, max: 18000 | No | |
| vrf_forwarding | String | No | ||
| ipv4 | Class | [ipv4] | No | |
| ipv6 | Class | [ipv6] | No | |
| arp_timeout | Integer | min: 0, max: 2147483 | No | |
| load_interval | Integer | min: 30, max: 600 | No | |
| mpls | Class | [mpls] | No | |
| ospf | Class | [ospf] | No | |
| ospfv3 | Class | [ospfv3] | No | |
| isis | Class | [isis] | No | |
| pim | Class | [pim] | No | |
| igmp | Class | [igmp] | No | |
| zone_member_security | String | No |
ipv4 (iosxe.devices.configuration.interfaces.loopbacks)
Section titled “ipv4 (iosxe.devices.configuration.interfaces.loopbacks)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| address | IP | No | ||
| address_mask | IP | No | ||
| proxy_arp | Boolean | true, false | No | |
| access_group_in | String | No | ||
| access_group_out | String | No | ||
| redirects | Boolean | true, false | No | |
| unreachables | Boolean | true, false | No | |
| nat_inside | Boolean | true, false | No | |
| nat_outside | Boolean | true, false | No | |
| unnumbered_interface_type | Choice | Loopback, Vlan, GigabitEthernet, TwoGigabitEthernet, FiveGigabitEthernet, TenGigabitEthernet, TwentyFiveGigabitEthernet, FortyGigabitEthernet, FiftyGigabitEthernet, HundredGigabitEthernet, PortChannel | No | |
| unnumbered_interface_id | Any | String or Integer[min: 0] | No | |
| address_dhcp | Boolean | true, false | No |
ipv6 (iosxe.devices.configuration.interfaces.loopbacks)
Section titled “ipv6 (iosxe.devices.configuration.interfaces.loopbacks)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| enable | Boolean | true, false | No | |
| addresses | List | [addresses] | No | |
| link_local_addresses | List | IP | No | |
| address_autoconfig_default | Boolean | true, false | No | |
| address_dhcp | Boolean | true, false | No | |
| mtu | Integer | min: 1280, max: 9976 | No | |
| pim | Class | [pim] | No |
mpls (iosxe.devices.configuration.interfaces.loopbacks)
Section titled “mpls (iosxe.devices.configuration.interfaces.loopbacks)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ip | Boolean | true, false | No | |
| mtu | Integer | No |
ospf (iosxe.devices.configuration.interfaces.loopbacks)
Section titled “ospf (iosxe.devices.configuration.interfaces.loopbacks)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| authentication_key_chain | String | No | ||
| authentication_message_digest | Boolean | true, false | No | |
| authentication_null | Boolean | true, false | No | |
| cost | Integer | min: 1, max: 65535 | No | |
| dead_interval | Integer | min: 1, max: 65535 | No | |
| hello_interval | Integer | min: 1, max: 65535 | No | |
| message_digest_keys | List | [message_digest_keys] | No | |
| mtu_ignore | Boolean | true, false | No | |
| multi_area_ids | List | Any[String or Integer[min: 0]] | No | |
| network_type | Choice | broadcast, non-broadcast, point-to-multipoint, point-to-point | No | |
| priority | Integer | min: 0, max: 255 | No | |
| process_ids | List | [process_ids] | No | |
| ttl_security_hops | Integer | min: 1, max: 254 | No |
ospfv3 (iosxe.devices.configuration.interfaces.loopbacks)
Section titled “ospfv3 (iosxe.devices.configuration.interfaces.loopbacks)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| bfd | Boolean | true, false | No | |
| cost | Integer | min: 1, max: 65535 | No | |
| dead_interval | Integer | min: 1, max: 65535 | No | |
| hello_interval | Integer | min: 1, max: 65535 | No | |
| mtu_ignore | Boolean | true, false | No | |
| network_type | Choice | broadcast, non-broadcast, point-to-multipoint, point-to-point | No | |
| priority | Integer | min: 0, max: 255 | No |
isis (iosxe.devices.configuration.interfaces.loopbacks)
Section titled “isis (iosxe.devices.configuration.interfaces.loopbacks)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| area_tag | String | No | ||
| ipv4_metric_levels | List | [ipv4_metric_levels] | No | |
| network_point_to_point | Boolean | true, false | No |
pim (iosxe.devices.configuration.interfaces.loopbacks)
Section titled “pim (iosxe.devices.configuration.interfaces.loopbacks)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| passive | Boolean | true, false | No | |
| dense_mode | Boolean | true, false | No | |
| sparse_mode | Boolean | true, false | No | |
| sparse_dense_mode | Boolean | true, false | No | |
| bfd | Boolean | true, false | No | |
| border | Boolean | true, false | No | |
| bsr_border | Boolean | true, false | No | |
| dr_priority | Integer | min: 0, max: 4294967294 | No |
igmp (iosxe.devices.configuration.interfaces.loopbacks)
Section titled “igmp (iosxe.devices.configuration.interfaces.loopbacks)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| version | Integer | min: 1, max: 3 | No |
addresses (iosxe.devices.configuration.interfaces.loopbacks.ipv6)
Section titled “addresses (iosxe.devices.configuration.interfaces.loopbacks.ipv6)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| prefix | IP | Yes | ||
| eui_64 | Boolean | true, false | No |
pim (iosxe.devices.configuration.interfaces.loopbacks.ipv6)
Section titled “pim (iosxe.devices.configuration.interfaces.loopbacks.ipv6)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| pim | Boolean | true, false | No | |
| bfd | Boolean | true, false | No | |
| bsr_border | Boolean | true, false | No | |
| dr_priority | Integer | min: 0, max: 4294967295 | No |
message_digest_keys (iosxe.devices.configuration.interfaces.loopbacks.ospf)
Section titled “message_digest_keys (iosxe.devices.configuration.interfaces.loopbacks.ospf)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| id | Integer | min: 1, max: 255 | Yes | |
| md5_auth_key | String | No | ||
| md5_auth_type | Choice | 0, 7 | No |
process_ids (iosxe.devices.configuration.interfaces.loopbacks.ospf)
Section titled “process_ids (iosxe.devices.configuration.interfaces.loopbacks.ospf)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| id | Integer | min: 1, max: 65535 | No | |
| areas | List | Any[String or Integer[min: 0]] | No |
ipv4_metric_levels (iosxe.devices.configuration.interfaces.loopbacks.isis)
Section titled “ipv4_metric_levels (iosxe.devices.configuration.interfaces.loopbacks.isis)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| level | Choice | level-1, level-2 | Yes | |
| value | Integer | min: 1, max: 16777214 | Yes |
Guidelines and Limitations
Section titled “Guidelines and Limitations”IP Address Reassignment Between Interfaces
Section titled “IP Address Reassignment Between Interfaces”IOS-XE enforces IP address uniqueness within the same VRF — no two interfaces can hold the same IP address simultaneously. When swapping IP addresses between two interfaces (for example, moving 10.1.1.1 from Loopback101 to Loopback102 and vice versa), terraform apply will fail because Terraform updates both interfaces in parallel without awareness of the cross-resource conflict. The device rejects the new IP assignment with an “inconsistent value: Device refused one or more commands” error because the target IP still exists on the other interface.
To perform an IP swap, apply the change in two steps:
- Remove the IP addresses from both interfaces (delete the
ipv4block or assign temporary addresses) and runterraform apply. - Set the new desired IP addresses and run
terraform applya second time.
Examples
Section titled “Examples”interface Loopback0 description Loopback0 ip address 5.5.5.5 255.255.255.0 ipv6 address dhcpiosxe: devices: - name: Device1 configuration: interfaces: loopbacks: - id: 0 description: Loopback0 ipv4: address: 5.5.5.5 address_mask: 255.255.255.0 ipv6: enable: true address_dhcp: trueFull example:
iosxe: devices: - name: Device1 configuration: interfaces: loopbacks: - id: 1 description: Production Loopback 2 interface_groups: - management shutdown: false ip_mtu: 1400 vrf_forwarding: prod arp_timeout: 30 load_interval: 30 ipv4: address: 192.168.2.1 address_mask: 255.255.255.0 address_dhcp: true proxy_arp: true access_group_in: ACL_IN access_group_out: ACL_OUT redirects: false unreachables: false verify_unicast_source_reachable_via: any verify_unicast_source_allow_default: true ipv6: enable: true addresses: - prefix: 2001::1 prefix_length: 64 link_local_addresses: - fe80::1 mtu: 1450 pim: dr_priority: 100 bfd: enable: true local_address: 172.16.1.1 interval: 120 interval_multiplier: 3 interval_min_rx: 100 echo: false mpls: mtu: 1450 ip: true ospf: cost: 50 dead_interval: 3 hello_interval: 1 mtu_ignore: true network_type: point-to-multipoint priority: 1 ttl_security_hops: 2 process_ids: - id: 1 areas: - "0.0.0.0" ospfv3: network_type: point-to-point cost: 50 bfd: true dead_interval: 40 hello_interval: 10 mtu_ignore: true priority: 100 pim: dense_mode: true bfd: true border: true bsr_border: true dr_priority: 100 igmp: version: 2 isis: area_tag: TEST # Must match an isis_processes.area_tag defined under routing ipv4_metric_levels: - level: level-1 value: 50NAT Inside Loopback
Section titled “NAT Inside Loopback”Configure a loopback interface as a NAT inside interface. This is commonly used when the loopback serves as a source for traffic that should be translated by NAT.
Note: nat_inside and nat_outside are mutually exclusive on a single interface (only one can be configured at a time).
Cisco IOS-XE CLI Equivalent:
interface Loopback100 description NAT Inside Loopback ip address 10.0.100.1 255.255.255.255 ip nat insideiosxe: devices: - name: Device1 configuration: interfaces: loopbacks: - id: 100 description: NAT Inside Loopback ipv4: address: 10.0.100.1 address_mask: 255.255.255.255 nat_inside: trueNAT Outside Loopback
Section titled “NAT Outside Loopback”Configure a loopback interface as a NAT outside interface. This is used when the loopback represents a public-facing address that receives translated traffic.
Cisco IOS-XE CLI Equivalent:
interface Loopback200 description NAT Outside Loopback ip address 203.0.113.1 255.255.255.255 ip nat outsideiosxe: devices: - name: Device1 configuration: interfaces: loopbacks: - id: 200 description: NAT Outside Loopback ipv4: address: 203.0.113.1 address_mask: 255.255.255.255 nat_outside: trueUnicast Reverse Path Forwarding (uRPF)
Section titled “Unicast Reverse Path Forwarding (uRPF)”Configure uRPF source verification on a loopback interface. The reachable-via mode can be rx (strict mode — source must be reachable via the receiving interface) or any (loose mode — source must be reachable via any interface).
Cisco IOS-XE CLI Equivalent:
interface Loopback200 description uRPF Loopback ip address 200.0.0.1 255.255.255.255 ip verify unicast source reachable-via any allow-defaultiosxe: devices: - name: Device1 configuration: interfaces: loopbacks: - id: 200 description: uRPF Loopback ipv4: address: 200.0.0.1 address_mask: 255.255.255.255 verify_unicast_source_reachable_via: any verify_unicast_source_allow_default: trueLoopback interfaces are virtual logical interfaces that provide a stable, always-up reference point for network services including routing protocol router IDs, management access, and service endpoints that remain accessible regardless of physical interface states. They support full Layer 3 functionality including IPv4 and IPv6 addressing, routing protocol participation (OSPF, BGP), MPLS services, and advanced features such as BFD for fast failure detection and network monitoring applications. Loopback interfaces are essential for network design best practices, providing consistent reachability for critical services, enabling effective network troubleshooting, and serving as anchor points for overlay networks, VPN services, and network management systems.
Diagram
Section titled “Diagram”Classes
Section titled “Classes”interfaces (iosxe.devices.configuration)
Section titled “interfaces (iosxe.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| loopbacks | List | [loopbacks] | No |
loopbacks (iosxe.devices.configuration.interfaces)
Section titled “loopbacks (iosxe.devices.configuration.interfaces)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| id | Integer | Yes | ||
| interface_groups | List | String | No | |
| description | String | No | ||
| shutdown | Boolean | true, false | No | |
| vrf_forwarding | String | No | ||
| ipv4 | Class | [ipv4] | No | |
| ipv6 | Class | [ipv6] | No | |
| arp_timeout | Integer | min: 0, max: 2147483 | No | |
| load_interval | Integer | min: 30, max: 600 | No | |
| mpls | Class | [mpls] | No | |
| ospf | Class | [ospf] | No | |
| ospfv3 | Class | [ospfv3] | No | |
| pim | Class | [pim] | No | |
| igmp | Class | [igmp] | No |
ipv4 (iosxe.devices.configuration.interfaces.loopbacks)
Section titled “ipv4 (iosxe.devices.configuration.interfaces.loopbacks)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| address | IP | No | ||
| address_mask | IP | No | ||
| proxy_arp | Boolean | true, false | No | |
| access_group_in | String | No | ||
| access_group_out | String | No | ||
| redirects | Boolean | true, false | No | |
| unreachables | Boolean | true, false | No | |
| unnumbered_interface_type | Choice | Loopback, Vlan, GigabitEthernet, FiveGigabitEthernet, TenGigabitEthernet, FortyGigabitEthernet, HundredGigabitEthernet, PortChannel | No | |
| unnumbered_interface_id | Any | String or Integer[min: 0] | No |
ipv6 (iosxe.devices.configuration.interfaces.loopbacks)
Section titled “ipv6 (iosxe.devices.configuration.interfaces.loopbacks)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| enable | Boolean | true, false | No | |
| addresses | List | [addresses] | No | |
| link_local_addresses | List | IP | No | |
| address_autoconfig_default | Boolean | true, false | No | |
| address_dhcp | Boolean | true, false | No | |
| mtu | Integer | min: 1280, max: 9976 | No | |
| pim | Class | [pim] | No |
mpls (iosxe.devices.configuration.interfaces.loopbacks)
Section titled “mpls (iosxe.devices.configuration.interfaces.loopbacks)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ip | Boolean | true, false | No | |
| mtu | Integer | No |
ospf (iosxe.devices.configuration.interfaces.loopbacks)
Section titled “ospf (iosxe.devices.configuration.interfaces.loopbacks)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| cost | Integer | min: 1, max: 65535 | No | |
| dead_interval | Integer | min: 1, max: 65535 | No | |
| hello_interval | Integer | min: 1, max: 65535 | No | |
| mtu_ignore | Boolean | true, false | No | |
| network_type | Choice | broadcast, non-broadcast, point-to-multipoint, point-to-point | No | |
| priority | Integer | min: 0, max: 255 | No | |
| ttl_security_hops | Integer | min: 1, max: 254 | No | |
| process_ids | List | [process_ids] | No | |
| message_digest_keys | List | [message_digest_keys] | No |
ospfv3 (iosxe.devices.configuration.interfaces.loopbacks)
Section titled “ospfv3 (iosxe.devices.configuration.interfaces.loopbacks)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| network_type | Choice | broadcast, non-broadcast, point-to-multipoint, point-to-point | No | |
| cost | Integer | min: 1, max: 65535 | No |
pim (iosxe.devices.configuration.interfaces.loopbacks)
Section titled “pim (iosxe.devices.configuration.interfaces.loopbacks)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| passive | Boolean | true, false | No | |
| dense_mode | Boolean | true, false | No | |
| sparse_mode | Boolean | true, false | No | |
| sparse_dense_mode | Boolean | true, false | No | |
| bfd | Boolean | true, false | No | |
| border | Boolean | true, false | No | |
| bsr_border | Boolean | true, false | No | |
| dr_priority | Integer | min: 0, max: 4294967294 | No |
igmp (iosxe.devices.configuration.interfaces.loopbacks)
Section titled “igmp (iosxe.devices.configuration.interfaces.loopbacks)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| version | Integer | min: 1, max: 3 | No |
addresses (iosxe.devices.configuration.interfaces.loopbacks.ipv6)
Section titled “addresses (iosxe.devices.configuration.interfaces.loopbacks.ipv6)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| prefix | IP | Yes | ||
| eui_64 | Boolean | true, false | No |
pim (iosxe.devices.configuration.interfaces.loopbacks.ipv6)
Section titled “pim (iosxe.devices.configuration.interfaces.loopbacks.ipv6)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| pim | Boolean | true, false | No | |
| bfd | Boolean | true, false | No | |
| bsr_border | Boolean | true, false | No | |
| dr_priority | Integer | min: 0, max: 4294967295 | No |
process_ids (iosxe.devices.configuration.interfaces.loopbacks.ospf)
Section titled “process_ids (iosxe.devices.configuration.interfaces.loopbacks.ospf)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| id | Integer | min: 1, max: 65535 | No | |
| areas | List | Any[String or Integer[min: 0]] | No |
message_digest_keys (iosxe.devices.configuration.interfaces.loopbacks.ospf)
Section titled “message_digest_keys (iosxe.devices.configuration.interfaces.loopbacks.ospf)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| id | Integer | min: 1, max: 255 | Yes | |
| md5_auth_key | String | No | ||
| md5_auth_type | Choice | 0, 7 | No |
Examples
Section titled “Examples”iosxe: devices: - name: Device1 configuration: interfaces: loopbacks: - id: 0 description: Loopback0 ip_address: 5.5.5.5 ip_address_mask: 255.255.255.0Full example:
iosxe: devices: - name: Device1 configuration: interfaces: loopbacks: - id: 1 description: Production Loopback 2 shutdown: false vrf_forwarding: prod arp_timeout: 30 load_interval: 30 ipv4: address: 192.168.2.1 address_mask: 255.255.255.0 proxy_arp: true access_group_in: ACL_IN access_group_out: ACL_OUT redirects: false unreachables: false ipv6: enable: true addresses: - prefix: 2001::1 prefix_length: 64 link_local_addresses: - fe80::1 mtu: 1450 bfd: enable: true local_address: 172.16.1.1 interval: 120 interval_multiplier: 3 interval_min_rx: 100 echo: false mpls: mtu: 1450 ip: true ospf: cost: 50 dead_interval: 3 hello_interval: 1 mtu_ignore: true network_type: point-to-multipoint priority: 1 ttl_security_hops: 2 process_ids: - id: 1 areas: - "0.0.0.0" ospfv3: network_type: point-to-point cost: 50 pim: dense_mode: true bfd: true border: true bsr_border: true dr_priority: 100 igmp: version: 2