0

I have set up the router as a dhcp server and I would like to use the layer 3 switch to route each PC in seperate vlans. How do I configure the router and L3 switch for inter vlan routing ?

the router config:

Current configuration : 787 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
ip dhcp excluded-address 10.1.0.1
!
ip dhcp pool 1
 network 10.1.0.0 255.255.255.0
 default-router 10.1.0.1
!
!
!
ip cef
no ipv6 cef
!
!
!
!
license udi pid CISCO2911/K9 sn FTX1524W57G-
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface GigabitEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface GigabitEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface GigabitEthernet0/2
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

L3 switch config :

Current configuration : 1244 bytes
!
version 12.2(37)SE1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
!
!
!
!
ip routing
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/1
!
interface FastEthernet0/2
 switchport trunk encapsulation dot1q
 switchport mode trunk
 switchport nonegotiate
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
 ip address 10.1.0.1 255.255.255.0
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
!
end

enter image description here

3
  • Please edit your question to include the router and switch configurations. The answer depends on the existing configurations, and we have no idea about that.
    – Ron Maupin
    Apr 24 at 15:08
  • 2
    Where are the VLANs that you want to route between?
    – Zac67
    Apr 24 at 15:27
  • I only created vlan 1 in the L3 switch and assigned an ip address to that interface
    – user159729
    Apr 24 at 15:29

2 Answers 2

1

To route on the layer-3 switch:

  1. IP routing needs to be enabled on the L3 switch (ip routing, it is by default on a 3560).
  2. VLANs need to be created and assigned to end-node ports in access mode.
  3. IP addresses need to be assigned to each VLAN interface (SVI) - via DHCP would work, but static addresses are preferred.
  4. The SVIs must not be in shutdown.

Another option is to route between VLANs on the router which also works with a layer-2 switch. The port towards the router needs to use trunk mode with all required VLANs allowed, and on the router you'd use VLAN subinterfaces to connect each VLAN.

A layer-3 switch is usually much better suited for inter-VLAN routing since it's generally hardware-based, causes no additional forwarding delays, and avoids the switch-router interconnect bottleneck.

2

Routing is enabled on the switch by default. So place your interfaces (fa0/2 and fa0/3) in the proper VLANs and that’s all you need to do.

The interfaces connected to the PCs should be access mode, not trunk

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.