cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2549
Views
0
Helpful
13
Replies

Access and Trunk in one port config

db
Level 1
Level 1

Hello

Can anybody tell me why the following config does not work in trunk mode?

interface GigabitEthernet1/0/1
switchport access vlan 30
switchport trunk native vlan 30
switchport trunk allowed vlan 10,20,30,40
switchport mode trunk

If this config is apply then the port does not work in native trunk for vlan 30.

I thought the switchport access vlan 30 does not effect the trunk mode.

But so it is.

Why is this so?

Greetings

13 Replies 13

Jon Marshall
Hall of Fame
Hall of Fame

The "switchport mode ...." command is what defines the port so it should work as a trunk. 

What exactly is not working ?

Jon

That's what I thought so.

But in my case the client is working in mode access with "switchport access vlan 30".

So now I want to tag this port. I configured mode trunk.

Now the client should fall untagged in vlan 30 because "switchport trunk native vlan 30".

But the client does not get a network connection.

You need to configure the client NIC to trunk as well ie. you can't just set the switch end, it has to be both. 

Did you do this ?

Jon

The client send his traffic untagged.

If I am right the command  "switchport trunk native vlan 30" is a kind of fallback and the traffic is carry in vlan 30 but the client does not need  to tag his traffic.

If i remove the command switchport access vlan 30, everythings work.

That is mysterious.

Perhaps you don't need to configure the client NIC. 

The "switchport access vlan 30" line should be ignored if it is a trunk so not sure what is going on.

Jon

I agree with Jon, the trunk mode should override the access port command.  What's the device and its running version?

Have you tried the config without the access port command?

Perhaps we ought to ask whether this is on real switches or on some software simulated network.

HTH

Rick

HTH

Rick

It is a hardware device WS-C3850-24XS with the image cat3k_caa-universalk9.

Hello

show interface GigabitEthernet1/0/1 switchport

res
Paul


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Yes, without the access port command the port is working properly.

Thanks for clarifying that this is a real switch and not a simulated one. It is interesting that if you remove the access port command that it does work properly. This represents a change in behavior for IOS switches. I have seen quite a few switches which configure ports as trunks and also have the switchport access vlan command on the port and it has worked fine.

HTH

Rick

HTH

Rick

Possibly a bug?

It is possible that this is a bug. But it is also possible, and I think it is likely, that this is Cisco cleaning up an inconsistency. We have seen other instances of Cisco changing behavior of IOS to clean up or correct behaviors that had been in place. I remember how surprised I was the first time that I saw a switch config that had an interface with mode set to trunk that also included the access vlan command. It is an inconsistency and I suspect that Cisco has decided to clean it up.

HTH

Rick

HTH

Rick