switchport
Use this command to set the mode of an interface to switched.
All interfaces are configured routed
by default. To change the behavior of an interface from switched to routed, you must explicitly give the no
switchport
command.
When you change the mode of an interface from switched to routed and vice-versa, all configurations for that interface are erased.
User should be prompted for confirmation, while executing switchport/no switchport
command. To support this requirement, please refer the command enable/disable confirmation-dialog.
Use the no
form of this command to set the mode to routed.
Command Syntax
switchport
no switchport
Parameters
None
Default
None
Command Mode
Interface mode
Applicability
This command was introduced before OcNOS version 1.3.
Examples
#configure terminal
(config)#interface eth0
(config-if)#switchport
(config)#interface eth0
(config-if)#no switchport
#configure terminal
(config)#enable confirmation-dialog
(config)#interface xe5
(config-if)#switchport
Are you sure? (y/n): y
(config-if)#
(config-if)#exit
(config)#disable confirmation-dialog
(config)#interface xe5
(config-if)#switchport
(config-if)#