06-23-2020 02:11 PM - edited 06-23-2020 02:12 PM
So I wanted to set up two Vlans on my switch, and a trunk through my router in order to reach the internet, but after I've configurated the subinterfaces on the router, neither of them will go up and form a link with the trunk port. I'm not sure why this is happening, as I've actually done it before successfully, but now after I reconfigured it the same way, it does not seem to function whatsoever.
I will provide screenshots to my running-config on both devices, and how I've configured the ports and VLANs, could anyone point me in the right direction as to why this is happening?
Switch Configuration, Trunk Port g1/0/1 is attached to Router Port g0/0
The Router Configuration is Below Switch Configuration
Solved! Go to Solution.
06-23-2020 02:39 PM - edited 06-23-2020 02:39 PM
To simplify the setup: I do below config.
on Switch :
config t
default interface gi 1/0/1
!
interface gi 1/0/1
switchport trunk encapsulation dot1q
switchport mode trunk
spanning-tree portfast trunk
no shut
!
end
On Router
on the interface (i do not believe you need "in" syntax)
interface gi 0/0.3
no ip virtual-reassembly in
ip virtual-reassembly
!
interface gi 0/0.4
no ip virtual-reassembly in
ip virtual-reassembly
Other note :
if you like to use any native VLAN, you can use the syntax
encapsulation dot1q 4 native
hope you have other NAT Setup done since this config not covering so
06-23-2020 02:39 PM - edited 06-23-2020 02:39 PM
To simplify the setup: I do below config.
on Switch :
config t
default interface gi 1/0/1
!
interface gi 1/0/1
switchport trunk encapsulation dot1q
switchport mode trunk
spanning-tree portfast trunk
no shut
!
end
On Router
on the interface (i do not believe you need "in" syntax)
interface gi 0/0.3
no ip virtual-reassembly in
ip virtual-reassembly
!
interface gi 0/0.4
no ip virtual-reassembly in
ip virtual-reassembly
Other note :
if you like to use any native VLAN, you can use the syntax
encapsulation dot1q 4 native
hope you have other NAT Setup done since this config not covering so
06-23-2020 03:00 PM
Forgot to mention, but my Switch (model c3850) does not have the encapsulation dot1q command, and supposedly just defaults to it no matter what. Beyond that, no other commands made any real difference.
06-23-2020 02:48 PM
On the uplink port on the switch (g1/0/1) remove "switchport trunk native vlan 4" since there is no native vlan configured on the router. On the switch, why the default gateway is pointing to 1.70. .70 is the outside interface of the router. It should pointing to one of the sub-interface e.g 192.168.3.1 or 4.1
On the router, interface 0/1 has a private IP (70.1) but the NAT is for outside (ip nat outside). If this is connecting to Internet, the IP on this interface needs to a public IP and not private.
Also, for NAT just use standard access list access-list 1 permit 192.168.4.0 0.0.0.255 any. If you need 3.x network to access the Internet. that subnet needs to be added to the access-list as well.
HTH
06-23-2020 03:12 PM
Alright, I changed everything like you said, to no real effect. I should probably clarify what I meant more by 'not working' and specify that the subinterfaces I created on the router never actually go up to begin the trunking process. Technically, the router is already on the internet, but due to the trunk not working, none of my host devices can connect to it themselves.
06-23-2020 03:19 PM - edited 06-23-2020 03:21 PM
I agree with my colleague Reza that the main issue about vlan 4 is that the switch trunk specifies that vlan 4 is the native vlan. So frames for vlan 4 will be transmitted without tags. But the router configuration specifies that vlan 4 is a subinterface (and does not specify that it is the native vlan) and so the router expects tagged frames for vlan 4. To fix this either change the switch config so that vlan 4 is not native or change the router config so that vlan 4 is native.
[edit] removed comments about default gateway that were not correct as I looked more closely at the config.
I see why vlan 4 is not working. I am not clear about vlan 3. Is there a problem with devices on vlan 3? If so please provide some additional information to help us understand that problem.
06-23-2020 03:40 PM
I just figured it out and managed to get it all working, but I'm not too sure what it was either. I just used 'default interface' on the subinterfaces and the VLAN ports and it managed to work when I reinstated the command again. I might've messed something up when I removed the configuration the first time around, I'm not sure; either way I'll give you guys stars for putting up with my weird post.
06-25-2020 10:04 AM
Thanks for the update. Glad to know that you did get it working. I have experienced issues where I configured some feature, was not working so I removed parts of the config, put parts of config back in. Config looked ok but something had gotten out of sync and it did not work. Removing config and starting over (or doing a reload) would fix the issue and the config worked. Sounds like you may have experienced one of those.
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