Creating a Logical Interface

This article shows you how to create logical interface on FlexSwitch.

Using the CLI to Create a Logical Interface

The following steps explain how to create a logical interface using the FlexSwitch CLI. See Accessing the Command Line Reference for more information about logging into the CLI facility.

This is a three step process:

  • Creating and verifying a named logical IPv4 Interface (IPv4Intf object).
  • Assigning an IP address to the new logical interface.
  • Applying the configuration.

Create and Verify a Named Instance

Enter the following commands to create and verify an instance. The CLI must be in the config mode.

localhost(config)#interface logical <name>
localhost(config-if)#showunapplied

If the command was successful you see a result similar to the following example.

Pending Config
NOTE: If attribute is not user provisioned default values shown, when config is applied a
read before write action will occur to fill in values of attributes not set by user.

id: 1   object: LogicalIntf   status: PENDING CONFIG  valid: True delete: False num user cmds: 1

 command                      attr       value      model attr    iskey    required    userprov    time provisioned        
----------------------------------------------------------------------------------------------------------------------------
 interface logical Lintf01    logical    Lintf01    Name          True     X           X           Thu May  4 19:14:49 2017

Assign an IP Address to the Port

In this step you will assign an IP address to the logial port created in the previous step.

Enter the following command while still at the (config-if) prompt.

localhost(config-if)#ip address <IP_address>
localhost(config-if)#showunapplied

If the command was successful you see a result similar to the following example.

Pending Config
NOTE: If attribute is not user provisioned default values shown, when config is applied a
read before write action will occur to fill in values of attributes not set by user.

iid: 15 object: LogicalIntf   status: PENDING CONFIG  valid: True delete: False num user cmds: 1
 command                       attr       value       model attr    iskey    required    userprov    time provisioned         
------------------------------------------------------------------------------------------------------------------------------
 interface logical LogIntf1    logical    LogIntf1    Name          True     X           X           Tue Aug 15 14:49:34 2017 

id: 1   object: IPv4Intf   status: PENDING CONFIG  valid: True delete: False num user cmds: 2
 command                       attr       value           model attr    iskey    required    userprov    time provisioned         
----------------------------------------------------------------------------------------------------------------------------------
 interface logical LogIntf1    logical    LogIntf1        IntfRef       True     X           X           Tue Aug 15 14:52:30 2017 
 ip address 10.1.10.1/30       address    10.1.10.1/30    IpAddr        True     X           X           Tue Aug 15 14:52:30 2017 

Apply the Configuration

Enter the following command to apply the configuration.

localhost(config-if-ip-<ip_address>)#apply

If the command was successful you see a result similar to the following example.

Applying Config:
id: 15  object: LogicalIntf   status: APPLIED CONFIG  valid: True delete: False num user cmds: 1
 command                       attr       value       model attr    iskey    required    userprov    time provisioned         
------------------------------------------------------------------------------------------------------------------------------
 interface logical LogIntf1    logical    LogIntf1    Name          True     X           X           Tue Aug 15 14:49:34 2017 

sdk:createLogicalIntf(loLogIntf1,Type=Loopback,Description=none) result: SUCCESS: http status code: 201


id: 1   object: IPv4Intf   status: APPLIED CONFIG  valid: True delete: False num user cmds: 2
 command                       attr       value           model attr    iskey    required    userprov    time provisioned         
----------------------------------------------------------------------------------------------------------------------------------
 interface logical LogIntf1    logical    LogIntf1        IntfRef       True     X           X           Tue Aug 15 14:52:30 2017 
 ip address 10.1.10.1/30       address    10.1.10.1/30    IpAddr        True     X           X           Tue Aug 15 14:52:30 2017 

sdk:createIPv4Intf(loLogIntf1,10.1.10.1/30,AdminState=UP) result: SUCCESS: http status code: 201

Using the REST API To Create a Logical Interface.

The following steps expain how to create a logical interface on FlexSwitch using the REST APIs.

Creating the Interface

In this step the LogicalIntfc object is created by supplying the REST request with the name of the interface and the type (in this case loopback).

curl  -i "Content-Type: application/json" -d '{"name":<"intf_name">,
"type":"loopback"}' http://<Your Host IP>/public/v1/config/LogicalIntf