LACP Configuration

This topic guides you through configuring LACP on FlexSwitch using both the CLI and the REST interface.

LACP Topo

Configuring LACP using the FlexSwitch CLI

For more information about the CLI, see Using the CLI.

Verifying Interfaces

Before you begin it is a best practice to verify the state of the interfaces.

Execute the commands in the example below to verify that the interfaces are UP.

localhost(config):interface fpPort 1-4
localhost(config-if-eth-1-4):no shut
localhost(config-if-eth-1-4):apply
Applying Config:
id: 23  object: Port   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      1        IntfRef       True     X           X           Wed Nov 23 14:30:09 2033
 no shutdown UP          shutdown    UP       AdminState    False                X           Wed Nov 23 14:30:10 2033



id: 23  object: Port   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      2        IntfRef       True     X           X           Wed Nov 23 14:30:09 2033
 no shutdown UP          shutdown    UP       AdminState    False                X           Wed Nov 23 14:30:10 2033


id: 23  object: Port   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        IntfRef       True     X           X           Wed Nov 23 14:30:09 2033
 no shutdown UP          shutdown    UP       AdminState    False                X           Wed Nov 23 14:30:10 2033



id: 23  object: Port   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        IntfRef       True     X           X           Wed Nov 23 14:30:09 2033
 no shutdown UP          shutdown    UP       AdminState    False                X           Wed Nov 23 14:30:10 2033

Configuring the Port Channel

In this example we will:

  • Create a Port Channel named port_channel 1.
  • Set the admin_state to UP.
  • Apply the configuration.

Use the following CLI commands to create a Port Channel.

localhost(config):interface port_channel 1
localhost(config-if-port-channel-1):admin_state UP
localhost(config-if-port-channel-1):apply

Applying Config:
id: 23  object: LaPortChannel   status: APPLIED CONFIG  valid: True delete: False num user cmds: 2
 command                     attr            value    model attr    iskey    required    userprov    time provisioned
------------------------------------------------------------------------------------------------------------------------------
 interface port_channel 1    port_channel    1        IntfRef       True     X           X           Wed Nov 23 14:30:29 2033
 admin_state UP              admin_state     UP       AdminState    False                X           Wed Nov 23 14:30:42 2033

Add Members to the Bundle

In this example we add add fpPorts 1 through 4 to port_channel 1.

localhost(config-if-eth-1-4):port_channel 1
localhost(config-if-eth-1-4):apply

Applying Config:
id: 23  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 14:31:24 2033
 fpPort 1-4
 port_channel 1                    port_channel    1         IntfRef        False    X           X           Wed Nov 23 14:31:24 2033


id: 23  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 14:31:24 2033
 port_channel 1          port_channel    1        IntfRef        False    X           X           Wed Nov 23 14:31:24 2033



id: 23  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 14:31:24 2033
 port_channel 1          port_channel    1        IntfRef        False    X           X           Wed Nov 23 14:31:24 2033

Verify the Configuration

Verify the configuration using the show port_channel 1 command in the CLI.

localhost(config):show port_channel 1

Applying Show:
IntfRef: agg1
 IfIndex: 16777217--------------------------------------------------------------------------------------------------------------------------------------------------
| LagType | Interval | Mode   | System Id         | System Priority | Hash Mode | OperState | ConfigMode   | Members      | Members Up in Bundle |
| LACP    | 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']          |
sdk:printLaPortChannelState(agg1,) result: SUCCESS

Configuring LACP using the FlexSwitch REST Interface

Verifying Interfaces

Before you begin it is a best practice to verify that all the interfaces are UP.

bash-4.3$ curl -sX GET -u admin -d '{"IntfRef": "fpPort1"}' 'http://localhost:8080/public/v1/state/Port' | python -m json.tool | egrep '"OperState":'
Enter host password for user 'admin':
        "OperState": "DOWN",
bash-4.3$ curl -sX GET -u admin -d '{"IntfRef": "fpPort2"}' 'http://localhost:8080/public/v1/state/Port' | python -m json.tool | egrep '"OperState":'
Enter host password for user 'admin':
        "OperState": "DOWN",
bash-4.3$ curl -sX GET -u admin -d '{"IntfRef": "fpPort3"}' 'http://localhost:8080/public/v1/state/Port' | python -m json.tool | egrep '"OperState":'
Enter host password for user 'admin':
        "OperState": "DOWN",
bash-4.3$ curl -sX GET -u admin -d '{"IntfRef": "fpPort4"}' 'http://localhost:8080/public/v1/state/Port' | python -m json.tool | egrep '"OperState":'
Enter host password for user 'admin':
        "OperState": "DOWN",

Note

The preceding example shows that all the interfaces are DOWN, hence we need to put them in an UP state.

Bring the Interfaces UP

Use the commands in the following example to change the state of the interfaces to UP.

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"
}
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"
}
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"
}
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"
}

Configuring the Port Channel

Use the command in following example to create the Port Channel and add the bundle.

Note

When configuring the Port Channel using the REST interface, this is a single step as opposed to two steps using the CLI.

bash-4.3$ curl -sX POST -u admin -d '{"IntfRef": "agg1","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": "09a83e58-d0e3-4d6c-646a-dd59aa7c4b8c",
    "Result": "Success"
}

Verify the configuration

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": 0,
                "MinLinks": 1,
                "OperState": "UP",
                "PresentInHw": "YES",
                "SystemIdMac": "a8:2b:b5:17:b9:01",
                "SystemPriority": 32768
            },
            "ObjectId": "09a83e58-d0e3-4d6c-646a-dd59aa7c4b8c"
        }
    ]
}