You can create a port profile that contains many interface commands and apply that port profile to a range of interfaces.
Each port profile can be applied only to a specific type of interface; the choices are as follows:
-
Ethernet
-
VLAN network
interface
-
Port channel
When you choose
Ethernet or port channel as the interface type, the port profile is in the
default mode which is Layer 3. Enter the
switchport command to change the port profile to Layer
2 mode.
You inherit the port
profile when you attach the port profile to an interface or range of
interfaces. When you attach, or inherit, a port profile to an interface or
range of interfaces, the system applies all the commands in that port profile
to the interfaces. Additionally, you can have one port profile inherit the
settings from another port profile. Inheriting another port profile allows the
initial port profile to assume all of the commands of the second, inherited,
port profile that do not conflict with the initial port profile. Four levels of
inheritance are supported. The same port profile can be inherited by any number
of port profiles.
The system applies the
commands inherited by the interface or range of interfaces according to the
following guidelines:
-
Commands that you
enter under the interface mode take precedence over the port profile’s commands
if there is a conflict. However, the port profile retains that command in the
port profile.
-
The port profile’s
commands take precedence over the default commands on the interface, unless the
port-profile command is explicitly overridden by the default command.
-
When a range of
interfaces inherits a second port profile, the commands of the initial port
profile override the commands of the second port profile if there is a
conflict.
-
After you inherit
a port profile onto an interface or range of interfaces, you can override
individual configuration values by entering the new value at the interface
configuration level. If you remove the individual configuration values at the
interface configuration level, the interface uses the values in the port
profile again.
-
There are no
default configurations associated with a port profile.
A subset of commands
are available under the port-profile configuration mode, depending on which
interface type you specify.
To apply the
port-profile configurations to the interfaces, you must enable the specific
port profile. You can configure and inherit a port profile onto a range of
interfaces prior to enabling the port profile. You would then enable that port
profile for the configurations to take effect on the specified interfaces.
If you inherit one or
more port profiles onto an original port profile, only the last inherited port
profile must be enabled; the system assumes that the underlying port profiles
are enabled.
When you remove a port
profile from a range of interfaces, the system undoes the configuration from
the interfaces first and then removes the port-profile link itself. Also, when
you remove a port profile, the system checks the interface configuration and
either skips the port-profile commands that have been overridden by directly
entered interface commands or returns the command to the default value.
If you want to delete
a port profile that has been inherited by other port profiles, you must remove
the inheritance before you can delete the port profile.
You can also choose a
subset of interfaces from which to remove a port profile from among that group
of interfaces that you originally applied the profile. For example, if you
configured a port profile and configured ten interfaces to inherit that port
profile, you can remove the port profile from just some of the specified ten
interfaces. The port profile continues to operate on the remaining interfaces
to which it is applied.
If you delete a
specific configuration for a specified range of interfaces using the interface
configuration mode, that configuration is also deleted from the port profile
for that range of interfaces only. For example, if you have a channel group
inside a port profile and you are in the interface configuration mode and you
delete that port channel, the specified port channel is also deleted from the
port profile as well.
Just as in the device,
you can enter a configuration for an object in port profiles without that
object being applied to interfaces yet. For example, you can configure a
virtual routing and forward (VRF) instance without it being applied to the
system. If you then delete that VRF and related configurations from the port
profile, the system is unaffected.
After you inherit a
port profile on an interface or range of interfaces and you delete a specific
configuration value, that port-profile configuration is not operative on the
specified interfaces.
If you attempt to
apply a port profile to the wrong type of interface, the system returns an
error.
When you attempt to
enable, inherit, or modify a port profile, the system creates a checkpoint. If
the port-profile configuration fails, the system rolls back to the prior
configuration and returns an error. A port profile is never only partially
applied.