Switch Configuration

I see three different configuration in my cisco switch. Does it mean any difference, especially on first and last one ?  Tks
 
interface FastEthernet3/0/16
 switchport access vlan 3

interface FastEthernet2/0/22
 switchport access vlan 3
 switchport mode access
 spanning-tree portfast

interface FastEthernet1/0/11
 switchport access vlan 3
 switchport mode access
AXISHKAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

arnoldCommented:
Ref discussion from long ago.
I think it will explain the difference between the first and last option.
https://supportforums.cisco.com/discussion/9934401/switchport-mode-access

The second one is like the last one, but includes a mechanism to prevent network looping over this feed.
0
AXISHKAuthor Commented:
so some of the ports may connect to mini switch, should I configure the port with
 no spanning-tree portfast

tks
0
arnoldCommented:
As long as the mini switch is not used to feed another switch which might feed another to a point where it might create a loop....

Guess the question should be the reverse what is it you want to do?
The second and last will only allow VLAN3 traffic to pass through it, while the first could dynamically allow other VLAN traffic to flow making the connection function as a trunk.
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

AXISHKAuthor Commented:
we will replace switches for customers,

so if spanning-tree portfast is binded in the interface, those mini switch will not work, correct
0
arnoldCommented:
when the spanning-tree portfast is enabled if it detects a packet loop meaning it sees a mac address from the connection that it already knows from another source, it will lock out this port.


port 1 <=> remote Switch

Port 4 <=> another link

The switch sees the same MAC address on port 1 and port 4. port 1 with the spanning-tree portfast will be locked out to prevent packet loop, enters on port 1 leaves on port 4 reenters on port 1 leaves on port 4....

.
0
AXISHKAuthor Commented:
Do you mean"spanning-tree portfast" doesn't block the port to min-switch connection and it only disable the port when loop is detected, correct ?   ie. I can keep it in my configuration. Tks
0
Oliver KaiserSystems EngineerCommented:
I think there is some major confusion going on in this question, let me help you out...

interface FastEthernet3/0/16
 switchport access vlan 3

Open in new window


- switchport access vlan 3 is used to tell the switch incoming traffic should be tagged with VLAN tag 3 upon transfer across a trunk (tagged port)

interface FastEthernet2/0/22
 switchport access vlan 3
 switchport mode access
 spanning-tree portfast

Open in new window


- switchport mode access is used to tell the switch incoming traffic is not being tagged
- spanning-tree portfast is used to tell the switch that spanning-tree should not go through listening and learning state. This behavior is desired on edge ports which do not connect to other bridges, which could lead to a loop. portfast does not disable spanning-tree on the port, but by not going through listening and learning state a loop could form which would still be blocked...but not before it could form as it would if portfast was not enabled

So what is the conclusion?
- switchport mode access is redundant if switchport access vlan 3 is used. If the assignment to vlan 3 was not enabled the port would be assigned to the native vlan (1 by default)
- spanning-tree portfast can be used on edge-ports (ports facing server/client) to forward traffic instantly. portfast should not be enabled on interfaces facing other switches because a loop could form and spanning-tree cannot act preventive but reactive.

Let me know if the explanation is clear or if there is anything else I can help you out with
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AXISHKAuthor Commented:
To test my understanding :

if a port connect to a PoE switch where IP phones are attached, it should not cause any harm to put spanning-tree portfast on the interfaces, correct?
0
Oliver KaiserSystems EngineerCommented:
Yes and No. If the PoE Switch is the only bridge connected there will probably be no harm but it is not recommanded to do portfast an inter-switch link.
0
AXISHKAuthor Commented:
can I say if I can ensure there is only one link connecting my Cisco switch to PoE switch, it shouldn't be any problem ? The only concern is there are two links connecting these two switch, where loop will be formed...

Tks
0
Oliver KaiserSystems EngineerCommented:
Yes you could, but there is really no reason to do so. You would save a few seconds in case spanning-tree needs to reconverge.
0
AXISHKAuthor Commented:
Tks
0
benhansonCommented:
I believe part of the accepted solution is incorrect.  Specifically the premise that 'switchport mode access' is a redundant command.

First off, remember that if a command is set at it's default, it won't be shown.

Trunk port carries multiple vlans
Access port only carries one vlan

The default config for a switch port is to be a trunk.  ('switchport mode trunk')  So in order for a port to be an access port, which means it will only pass traffic from a specific VLAN, you have to issue 'switchport mode access' on that interface.  'switchport access vlan 3' is telling the switch WHICH vlan to restrict to and to tag with.  If you go from 'switchport mode access' to 'switchport mode trunk', the switch doesn't clear out your 'switchport access vlan 3' setting.  That way you can go from access to trunk and back to access without having to remember what vlan it was previously on.

If you set 'switchport mode access' with no corresponding 'switchport access vlan #' command, you are making it an access port on VLAN 1.
0
Oliver KaiserSystems EngineerCommented:
Ben,

I think what you mean by default trunk is on switches using DTP which have either switchport mode dynamic auto or on some other models switchport mode dynamic desireable enabled by default. That would not be equivalend to mode trunk since DTP would be used to negotiate if a trunk should be formed or not.

Nevertheless good explanation I left the bits and pieces about DTP out.
If the mode is not hardcoded "switchport mode access" the Interface can form a trunk if the switch supports DTP, therefore it is best practice to set switchport mode manually!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Switches / Hubs

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.