On an "Access" port on a switch, any VLAN tag received from the connected host is stripped, and the tag for the port's assigned VLAN is added. If the frame is leaving an access port to a host, any VLAN tags that were used are stripped away before transmission.
For a "Trunk" port (on a switch), the native VLAN command tells the switch which VLAN untagged frames go into. By default, untagged frames go into VLAN 1 (the default VLAN).
On a router, when you specify "encapsulation dot1q 99 native", you are telling the router to correlate untagged frames with the subinterface where the command is placed. It also tells the router that frames leaving that interface should be untagged.
Consequently, you could simply not specify a native vlan on either side and packets heading for VLAN 99 should go normally...
[red]Router:[/red]
interface FastEthernet0/0
description Connection to Switch Fa1/0
no ip address
speed 100
full-duplex
!
interface FastEthernet0/0.1
! Leave fa0/0.1 untagged
[green]encapsulation dot1Q 1 native[/green]
ip address 172.17.1.1 255.255.255.0
!
interface FastEthernet0/0.99
[green]! Tag traffic bound for VLAN 99[/green]
encapsulation dot1Q 99 native
ip address 172.17.99.1 255.255.255.0
!
[red]Switch:[/red]
no ip routing
!
interface FastEthernet1/0
description Connection to Router Fa0/0
[green]! Untagged traffic goes to default VLAN (1)[/green]
switchport trunk native vlan 99
switchport mode trunk
BTW... I did have a problem changing the native vlan on the trunk and was forced to do a shut/no shut on the switch (Fa1/0). Probably a quirk in GNS3.
PSC
[—] CCNP (R&S/Wireless) [•] CCSP [•] MCITP: Enterprise Admin [•] MCSE [—]
Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --Mr. The Plague, from the movie "Hackers