Set the mode for the Ethernet interface on a Cisco switch with the following steps:
- Onboard a switch in the NSO mode. For more information, see Onboard a Cisco switch in Bare Metal Orchestrator.
- Change the directory to ~/samples/switch-profiles.
- Create a switchportconfig YAML file by copying the sample file, switch_port_config_trunk_mode.yaml.
cp <switch_port_config_trunk_mode>.yaml <new-switchportconfig-id>.yaml
- Edit the <new-switchportconfig-id>.yaml file in Vim or a similar editor.
- Customize the <new-switchportconfig-id>.yaml file:
Update the attributes in the switchportconfig YAML file. For more information, see Switch port configuration field definitions.
This is an example switchportconfig.yaml file for a Cisco switch:
apiVersion: mw.dell.com/v4
kind: SwitchPortConfig
metadata:
name: switch-port-config-1
spec:
interfaceConfig:
name:"2/10"
switchport: true
mode : "trunk"
mtu:9216
trunkVlan:
-149
-159 - Save the file and quit the editor.
- Create the switchportconfig YAML file with the following command:
bmo create switchportconfig -f switchportconfig.yaml
- Edit the Cisco switch configuration with the following command:
bmo edit switch -f <cisco-switch-id>.yaml
In the switch YAML file, add the switchPortConfig attribute under the IncludeConfig section and assign a value. For example, switch-port-config-1 to apply the Ethernet interface configuration. - Verify the updated details. For more information, see View switches and switch status and View switch inventory.
After applying the Ethernet interface configuration, you can perform the following:
- To change the Ethernet interface port mode, see Change the Ethernet interface port mode - Cisco switch.
- To assign an IP address for the Ethernet interface, see Set the IP address for the Ethernet interface - Cisco switch.