Configuring Static Port Channels

This topic guides you through the process of configuring static port channels on FlexSwitch using both the CLI and REST interfaces.

Configuring Static Port Channels with the FlexSwitch CLI

Verify Ports

It is good practice to verify that the ports included in the port channel are in an UP state before proceeding.

Verify the state of the ports from the CLI using the show command as shown in the example below.

localhost#show interface status
Applying Show:

 Port        Description    Status    Mtu            Duplex    Speed    AutoNeg    Type
-----------------------------------------------------------------------------------------
 fpPort1                    UP        Full_Duplex    16356     1000     ON         SGMII
 fpPort2                    UP        Full_Duplex    16356     1000     ON         SGMII
 fpPort3                    UP        Full_Duplex    16356     1000     ON         SGMII
 fpPort4                    UP        Full_Duplex    16356     1000     ON         SGMII

Create the Port Channel

In this example we:

  • create and name a port channel.
  • set the admin state to UP.
  • set the LSG type to Static.
  • apply the configuration.
localhost(config):interface port_channel 1
localhost(config-if-port-channel-1):admin_state UP
localhost(config-if-port-channel-1):lagtype 1 #(0 == LACP / 1 == Static)
localhost(config-if-port-channel-1):apply
Applying Config:
id: 1   object: LaPortChannel   status: APPLIED CONFIG  valid: True delete: False num user cmds: 3
 command                     attr            value    model attr    iskey    required    userprov    time provisioned
------------------------------------------------------------------------------------------------------------------------------
 interface port_channel 1    port_channel    1        IntfRef       True     X           X           Wed Nov 23 19:51:23 2033
 admin_state UP              admin_state     UP       AdminState    False                X           Wed Nov 23 19:51:31 2033
 lagtype 1                   lagtype         1        LagType       False                X           Wed Nov 23 19:51:46 2033

Adding fpPorts to the Port Channel

In this example we:

  • select the ports added to the channel.
  • specify the port channel.
  • apply the configuration.
localhost(config)#interface fpPort 1-4
localhost(config-if-eth-1-4)#port_channel 1
localhost(config-if-eth-1-4)#apply

fpPorts 1 & 2 Associated with the Port Channel

Applying Config:
id: 1   object: LaPortChannel   status: APPLIED CONFIG  valid: True delete: False num user cmds: 2
 command                           attr            value     model attr     iskey    required    userprov    time provisioned
--------------------------------------------------------------------------------------------------------------------------------------
 interface fpPort 1-4,interface    fpPort          [1, 2]    IntfRefList    False    X           X           Wed Nov 23 19:52:24 2033
 fpPort 1-4
 port_channel 1                    port_channel    1         IntfRef        False    X           X           Wed Nov 23 19:52:24 2033

fpPort 3 Associated with the Port Channel

id: 1   object: LaPortChannel   status: APPLIED CONFIG  valid: True delete: False num user cmds: 2
 command                 attr            value    model attr     iskey    required    userprov    time provisioned
---------------------------------------------------------------------------------------------------------------------------
 interface fpPort 1-4    fpPort          [3]      IntfRefList    False    X           X           Wed Nov 23 19:52:24 2033
 port_channel 1          port_channel    1        IntfRef        False    X           X           Wed Nov 23 19:52:24 2033

fpPort 3 Associated with the Port Channel

id: 1   object: LaPortChannel   status: APPLIED CONFIG  valid: True delete: False num user cmds: 2
 command                 attr            value    model attr     iskey    required    userprov    time provisioned
---------------------------------------------------------------------------------------------------------------------------
 interface fpPort 1-4    fpPort          [4]      IntfRefList    False    X           X           Wed Nov 23 19:52:24 2033
 port_channel 1          port_channel    1        IntfRef        False    X           X           Wed Nov 23 19:52:24 2033

Verify the Configuration

Verify the configuration using the CLI show command as shown in the example below.

localhost#show port_channel 1
Applying Show:

IntfRef: agg1
 IfIndex: 27--------------------------------------------------------------------------------------------------------------------------------------------------
| LagType | Interval | Mode   | System Id         | System Priority | Hash Mode | OperState | ConfigMode   | Members      | Members Up in Bundle |
| STATIC  | SLOW     | ACTIVE | a8:2b:b5:17:b9:01 | 32768           | 0         | UP        | Unconfigured | [u'fpPort1', | [u'fpPort1',         |
|         |          |        |                   |                 |           |           |              | u'fpPort2',  | u'fpPort2',          |
|         |          |        |                   |                 |           |           |              | u'fpPort3',  | u'fpPort3',          |
|         |          |        |                   |                 |           |           |              | u'fpPort4']  | u'fpPort4']          |

Configuring Port Channels using the REST Interface

Verify Ports

It is good practice to verify that the ports included in the port channel are in an UP state before proceeding.

In this example we use a PATCH REST request that sets the AdminState of each port to UP.

fpPort1

bash-4.3$ curl -sX PATCH -u admin -d '{"IntfRef": "fpPort1","AdminState": "UP"}' 'http://localhost:8080/public/v1/config/Port' | python -m json.tool

Enter host password for user 'admin':

{
    "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
    "Access-Control-Allow-Methods": "POST, GET, OPTIONS, PATCH, DELETE",
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Max_age": "86400",
    "ObjectId": "1cd39894-8d16-497a-5b57-79265d5b95d2",
    "Result": "Success"
}

fpPort2

bash-4.3$ curl -sX PATCH -u admin -d '{"IntfRef": "fpPort2","AdminState": "UP"}' 'http://localhost:8080/public/v1/config/Port' | python -m json.tool
Enter host password for user 'admin':
{
    "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
    "Access-Control-Allow-Methods": "POST, GET, OPTIONS, PATCH, DELETE",
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Max_age": "86400",
    "ObjectId": "4684aeb9-b5f9-4ab1-7ce2-6f77127bca0e",
    "Result": "Success"
}

fpPort3

bash-4.3$ curl -sX PATCH -u admin -d '{"IntfRef": "fpPort3","AdminState": "UP"}' 'http://localhost:8080/public/v1/config/Port' | python -m json.tool

Enter host password for user 'admin':

{
    "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
    "Access-Control-Allow-Methods": "POST, GET, OPTIONS, PATCH, DELETE",
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Max_age": "86400",
    "ObjectId": "f2dca8eb-2f9d-4c70-5d7b-9b1d1b30a379",
    "Result": "Success"
}

fpPort4

bash-4.3$ curl -sX PATCH -u admin -d '{"IntfRef": "fpPort4","AdminState": "UP"}' 'http://localhost:8080/public/v1/config/Port' | python -m json.tool

Enter host password for user 'admin':

{
    "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
    "Access-Control-Allow-Methods": "POST, GET, OPTIONS, PATCH, DELETE",
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Max_age": "86400",
    "ObjectId": "65113945-c32c-4693-651e-c90f6857cfde",
    "Result": "Success"
}

Create the Port Channel

In this example we make a REST POST request that:

  • creates the port channel.
  • sets the IntfRef attribute.
  • associates a list of fpPorts (see above).

Note

Associating the ports is a separate step when configuring a port channel using the CLI.

bash-4.3$ curl -sX POST -u admin -d '{"IntfRef": "agg1","LagType": 1,"IntfRefList":["fpPort1","fpPort2","fpPort3","fpPort4"]}' 'http://localhost:8080/public/v1/config/LaPortChannel' | python -m json.tool

Enter host password for user 'admin':

{
    "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
    "Access-Control-Allow-Methods": "POST, GET, OPTIONS, PATCH, DELETE",
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Max_age": "86400",
    "ObjectId": "17a50e6d-1ae6-45b3-5f83-5a851fa60fb1",
    "Result": "Success"
}

Verify the Configuration

Use the GET REST request in the example below to verify the configuration.

Note

When verifying the state of an object use the /state/LaPortChannels endpoint.

bash-4.3$ curl -sX GET -u admin -d '{}' 'http://localhost:8080/public/v1/state/LaPortChannels' | python -m json.tool

Enter host password for user 'admin':

{
    "CurrentMarker": 0,
    "MoreExist": false,
    "NextMarker": 2,
    "ObjCount": 1,
    "Objects": [
        {
            "Object": {
                "AdminState": "UP",
                "ConfigMode": "Unconfigured",
                "IfIndex": 27,
                "Interval": 1,
                "IntfRef": "agg1",
                "IntfRefList": [
                    "fpPort1",
                    "fpPort2",
                    "fpPort3",
                    "fpPort4"
                ],
                "IntfRefListUpInBundle": [
                    "fpPort1",
                    "fpPort2",
                    "fpPort3",
                    "fpPort4"
                ],
                "LacpMode": 0,
                "LagHash": 0,
                "LagType": 1,
                "MinLinks": 1,
                "OperState": "UP",
                "PresentInHw": "YES",
                "SystemIdMac": "a8:2b:b5:17:b9:01",
                "SystemPriority": 32768
            },
            "ObjectId": "17a50e6d-1ae6-45b3-5f83-5a851fa60fb1"
        }
    ]
}

Done!