This task explains how to configure a basic loopback interface.
Restrictions
-
The IP address of a loopback interface must be unique across all routers on the network.
-
That IP address must not be used by another interface on the router.
-
The IP address must not be used by an interface on any other router on the network.
RP/0/RP0/CPU0:router# configure
/* Enters interface configuration mode and names the new loopback interface */RP/0/RP0/CPU0:router#(config)# interface Loopback 3
/* Assigns an IP address and subnet mask to the virtual loopback interface */
RP/0/RP0/CPU0:router(config-if)# ipv4 address 172.18.189.38/32
RP/0/RP0/CPU0:router(config-if)# end
RP/0/RP0/CPU0:router(config-if)# commit
-
When you issue the end command, the system prompts you to commit changes:
Uncommitted changes found, commit them before exiting(yes/no/cancel)?
[cancel]:
-
Entering yes saves configuration changes to the running configuration file, exits the configuration session, and returns the router to
EXEC mode.
-
Entering no exits the configuration session and returns the router to EXEC mode without committing the configuration changes.
-
Entering cancel leaves the router in the current configuration session without exiting or committing the configuration changes.
-
Use the commit command to save the configuration changes to the running configuration file and remain within the configuration session.
/* Display the configuration of the loopback interface */RP/0/RP0/CPU0:router# show interfaces Loopback 3