Inter-VLAN Routing: Connecting to a router

I understand the concept of inter-VLAN routing on Layer 3 switches, however, I'm unsure how to connect said switch to a router. I know the router needs an IP address on one interface to route, but how does one configure the switch port? Can't put an IP address on a switch port? I'm missing something here. Let's say I have 10 floors, each one with an edge switch and VLAN's representing floors, like 10.10.101.0/24 for the first floor, 10.10.102.0/24 for the second floor, etc. Routing between the VLAN's with a L3 switch works fine, just not sure how to get traffic out of the switch to a router. Default gateway on the subnets is set to the default VLAN address of the L3 switch. Any help appreciated. I've completed the ICND1 CCNA course (Keith Bogart) but feel like I missed this step somewhere. Thanks for any help.

Comments

  • MartinLosikMartinLosik ✭✭✭
    edited October 1

    if u have inter-VLAN routing on Layer 3 switch, u also have enabled routing on that switch (so, no need for router-on-stick).
    you have 2 options:
    -IP address on a switch port connecting to router (no switchport, ip address xxxx) making a switchport as a routed port. then, connect router to that "routed" port
    - IP address set to Vlan X , connect router to access port in vlan X.
    For above 2 ways, make sure router IP and switch IP are on same subnet.
    To get traffic to router for unknown destinations, switch routing table should have default gateway pointing to router (ip routes 0..0.00 0.00.0 IP of a router)


  • Here's my diagram. I have a static on the core directly connected to the router at g0/0, both of those interfaces are on the same subnet 10.99.99.0/24. Can't ping from PC 5.5.5.5 to the other end of the router. Still missing something...

  • MartinLosikMartinLosik ✭✭✭
    edited October 2

    can 5.5.5.5 ping router interface 20.20.20.1?
    can PC3 ping router?
    can Switch pings router?

    does switch and router have dynamic routing protocol? if not, u need static routes.
    does router knows about network 5.5..5.5 and 6.6.6.6 ?

    u can save PT file and share it with us. we can check/fix it.

  • Unfortunately I can't attach the file for some reason (invalid file format). At any rate, I can't ping 20.20.20.1 from 5.5.5.5. From PC3 I can ping 10.99.99.99.

    Core switch confg:
    core>en
    core#sh run
    Building configuration...

    Current configuration : 1826 bytes
    !
    version 16.3.2
    no service timestamps log datetime msec
    no service timestamps debug datetime msec
    no service password-encryption
    !
    hostname core
    !

    no ip cef
    ip routing
    !
    no ipv6 cef
    !
    !
    !!
    !
    !
    !
    spanning-tree mode pvst
    !
    !
    !
    interface GigabitEthernet1/0/1
    switchport access vlan 500
    !
    interface GigabitEthernet1/0/2
    switchport access vlan 600
    !
    interface GigabitEthernet1/0/3
    !
    interface GigabitEthernet1/0/4
    !
    interface GigabitEthernet1/0/5
    !
    interface GigabitEthernet1/0/6
    !
    interface GigabitEthernet1/0/7
    !
    interface GigabitEthernet1/0/8
    !
    interface GigabitEthernet1/0/9
    !
    interface GigabitEthernet1/0/10
    !
    interface GigabitEthernet1/0/11
    !
    interface GigabitEthernet1/0/12
    !
    interface GigabitEthernet1/0/13
    !
    interface GigabitEthernet1/0/14
    !
    interface GigabitEthernet1/0/15
    !
    interface GigabitEthernet1/0/16
    !
    interface GigabitEthernet1/0/17
    !
    interface GigabitEthernet1/0/18
    !
    interface GigabitEthernet1/0/19
    !
    interface GigabitEthernet1/0/20
    !
    interface GigabitEthernet1/0/21
    !
    interface GigabitEthernet1/0/22
    !
    interface GigabitEthernet1/0/23
    !
    interface GigabitEthernet1/0/24
    no switchport
    ip address 10.99.99.99 255.255.255.0
    duplex auto
    speed auto
    !
    interface GigabitEthernet1/1/1
    switchport mode access
    switchport nonegotiate
    !
    interface GigabitEthernet1/1/2
    switchport access vlan 600
    switchport mode access
    switchport nonegotiate
    !
    interface GigabitEthernet1/1/3
    !
    interface GigabitEthernet1/1/4
    !
    interface Vlan1
    ip address 10.20.0.1 255.255.255.0
    !
    interface Vlan500
    mac-address 000b.beb9.4c01
    ip address 5.5.5.1 255.255.255.0
    !
    interface Vlan600
    mac-address 000b.beb9.4c02
    ip address 6.6.6.1 255.255.255.0
    !
    ip classless
    ip route 0.0.0.0 0.0.0.0 10.99.99.100
    !
    ip flow-export version 9
    !
    !
    !
    !
    !
    !
    !
    !
    line con 0
    !
    line aux 0
    !
    line vty 0 4
    login
    !
    !
    !
    !
    end

    Router Config:

    router1#sh run
    Building configuration...

    Current configuration : 627 bytes
    !
    version 15.1
    no service timestamps log datetime msec
    no service timestamps debug datetime msec
    no service password-encryption
    !
    hostname router1
    !
    !
    !
    !
    !
    !
    !
    !
    ip cef
    no ipv6 cef
    !
    !
    !
    !
    license udi pid CISCO2901/K9 sn FTX1524NIWD-
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    spanning-tree mode pvst
    !
    !
    !
    !
    !
    !
    interface GigabitEthernet0/0
    ip address 10.99.99.100 255.255.255.0
    duplex auto
    speed auto
    !
    interface GigabitEthernet0/1
    ip address 20.20.20.1 255.255.255.0
    duplex auto
    speed auto
    !
    interface Vlan1
    no ip address
    !
    ip classless
    !
    ip flow-export version 9
    !
    !
    !
    !
    !
    !
    !
    !
    line con 0
    !
    line aux 0
    !
    line vty 0 4
    login
    !
    !
    !
    end

    router1#

  • no static routes or dynamic routing protocol. look at show ip route on router and L3 sw. Router does not know about 5.5.5.0/24 and 6.6.6.0/24 networks, does he?
    i think the simplest fix is to add ip route 0.0.0.0 0.0.0.0 10.99.99.99 on a router.
    but normally u would add routing protocol (EIGRP or OSPF)

    you can use 2nd party file sharing sites like dropmefiles or uploads

  • Thanks Martin. I think I have it figured out now. I appreciate your help.

Sign In or Register to comment.