11-24-2021 06:33 AM
hi all,
i know you can do it but what are the best commands to use
conf t
int gix/x/x
switchport mode access
switchport access vlan 1
switchport trunk allowed vlan 11,22
will that work?
or do i need to remove
switchport mode access
thanks,
rob
11-24-2021 08:21 AM
I recall (?) you can often have both sets of commands on an interface and some take precedence over the others. If so, don't recall which have precedence. If commands can be mixed (i.e. both access and trunk commands on same interface), personally I believe it's a bit of a poor practice, unless there's a real need for it (ditto using DTP), because it makes unclear how port is intended to be used. (What port is actually currently doing can be determined by other status commands, but again, actual usage might not easily clarify usage is as intended or is an accidental error.)
11-24-2021 08:37 AM
Hi
A port can be configured with both access related command and trunk related commands at the same time.
What will be used then? That depends on if it is the command "switchport mode access" or "switchport mode trunk"
If the port is operating as a accessport, the trunkrelated commands will be ignored, and vice verse.
So in your example the port will be operated as an accessport in vlan 1.
And I agree with Joseph, it is not a good idea to have it configure like that, ii not using DTP.
/Mikael
11-24-2021 03:17 PM
You want an access port to be tagged like a trunk is, Why ? By definition, access ports are not tagged; only trunks are so I am not sure what is the goal here? Anyway, I would remove "switchport mode access:" as this command force port to be access mode and not even DTP are send out. From Cisco Doc "Access Puts the port into permanent non-trunking mode and negotiates to convert the link into a nontrunk link. The port becomes a nontrunk port even if the neighboring port does not agree to the change."
"switchport access vlan 1" is not needed as this is default settings and command does not appear in the run config.
By default, a port should be in auto mode which means such port is willing to convert the link to a trunk. DTPs are not disabled and such port may becomes a trunk port depending on the other side.
When it comes to switch port, it often depends on the other guy; not just your side but other side matters as well.
So, with only "switchport trunk allowed vlan 11,22" you have pretty good chances to have port in trunking mode if the other side agrees or requests.
Regards, ML
**Please Rate All Helpful Responses **
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide