cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
822
Views
0
Helpful
3
Replies

Vlan mode access

ShaunEini3096
Level 1
Level 1

When you configure an interface on Cisco 3850 switch to be in a specific vlan you enter : 

1)switchport mode access

2) switchport access vlan ...number... 

 

why do we need both commends if the second command is enough? 

3 Replies 3

Mark Malone
VIP Alumni
VIP Alumni
Hi
first command make its a l2 switchport ,second command adds the vlan , no switchport makes it l3
second will work just on it own though too

meahmedhassan
Level 1
Level 1

the command switchport mode determine the mode of the port , if access or trunk and the default there is dynamic negotiation to choose mode , if the mode is access either by the command  swtichport mode access or dynamic  then the second command switchport access vlan X  means if the port decide to be access then use vlan x , so you write the second command only switchport access vlan X  but you depend on negotiation to decide the mode access .

  

switch(config-if)#swichport mode ?
access Set trunking mode to ACCESS unconditionally
dynamic Set trunking mode to dynamically negotiate access or trunk mode
trunk Set trunking mode to TRUNK unconditionally

 

 

Switch(config-if)#sw access ?
vlan Set VLAN when interface is in access mode

 

Pedro Arrieta
Level 1
Level 1
Hi Shaun,

- The first command is to set the port in access mode, if you don't use it, you depends on the mode dynamic and the other side.
- The second command is to set the vlan on the port.

Regards,
Review Cisco Networking for a $25 gift card