Port Profiles is a feature of Nexus switches, which allow a template of configuration to apply to a group of ports. This is similar to interface macros in Catalyst IOS. Unlike Catalyst IOS macros, NX-OS port-profiles are event driven, meaning IOS macros apply only once during initial configuration, but P0rt profiles immediately re-apply any time a change is made to the profile. You can read more detail from cisco official site.

In this lesson, we will learn, how to configure Port Profiles in Nexus switches?

Port Profiles

Prerequisites:

  • No prerequisites.
  • Require no license.

Configuration:

To configure, we have to go through few steps. These are –

  • Create the profile
  • Apply configuration to profile
  • Enable the profile
  • Assign profile to interface

Create the profile:
In this step, we will create a pofiles and name it “OurPortProfiles”. We are going to create our profile based on ethernet, however we have option to create it on port-channel and SVI.

Command:
port-profile type [ethernet | interface-vlan | port-channel] [name]

Example:
N7K-01(config)# port-profile type ethernet OurPortProfiles

Apply configuration to profile:
Here we will specify the configure. Later, if needed we can modify it.

Example:
N7K-01(config)# port-profile type ethernet OurPortProfiles
N7K-01(config-port-prof)# no shutdown
N7K-01(config-port-prof)# switchport mode access
N7K-01(config-port-prof)# switchport access vlan 10
N7K-01(config-port-prof)# spanning-tree port type edge

Enable the profile
By default, port-profiles are disabled. We can verify it using “show port-profile” command.

N7K-01# show port-profile

SHOW PORT_PROFILE

port-profile OurPortProfiles
 type: Ethernet
 description:
 status: disabled
 max-ports: 16384
 inherit:
 config attributes:
  spanning-tree port type edge
  switchport
  switchport access vlan 10
  no shutdown
 evaluated config attributes:
  spanning-tree port type edge
  switchport
  switchport access vlan 10
  no shutdown
 assigned interfaces:

Let’s enable it and then verify.

N7K-01(config)# port-profile type ethernet OurPortProfiles
N7K-01(config-port-prof)# state enabled
N7K-01# show port-profile

SHOW PORT_PROFILE

port-profile OurPortProfiles
 type: Ethernet
 description:
 status: enabled
 max-ports: 16384
 inherit:
 config attributes:
  spanning-tree port type edge
  switchport
  switchport access vlan 10
  no shutdown
 evaluated config attributes:
  spanning-tree port type edge
  switchport
  switchport access vlan 10
  no shutdown
 assigned interfaces:

Assign profile to interface:
Now you have to assign “OurPortProfiles” profile into the interface using “inherit” command. We are assigning it on interface e1/1 to e1/10.

Command:
inherit port-profile [name]

Example:
N7K-01(config)# interface e1/1-10
N7K-01(config-if-range)# inherit port-profile OurPortProfiles

Verification:

Command:
show port-profile
show run interface [interface range]
show port-profile expand-interface name [name]

Written by Rajib Kumer Das

I am Rajib Kumer Das, a network engineer with 7+ years of experience in multi-vendor environment. In my current company, I am responsible to take care critical projects and it's support cases. I do have several vendor certificates and have plans to go further.

Leave a Comment

Your email address will not be published. Required fields are marked *