cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1152
Views
0
Helpful
7
Replies

Routing the VLANs

salmanfaryad
Level 1
Level 1

Hello,

 I have a core switch configuration as attached:

 I want to connect a router for telephony configuration.

Can anyone help me out?

7 Replies 7

Hello,

 

it depends on the switch and how you want to set this up. One option would be to enable IP routing on the switch, and then add the lines marked in bold. Give the router interface connected to the switch an IP address such as 192.168.11.2/24.

 

hostname Switch
!
ip dhcp excluded-address 192.168.11.1 192.168.11.5
ip dhcp excluded-address 192.168.7.1 192.168.7.5
!
ip dhcp pool DATA
network 192.168.7.0 255.255.255.0
default-router 192.168.7.1
ip dhcp pool VOICE
network 192.168.11.0 255.255.255.0
default-router 192.168.11.1
option 150 ip 192.168.11.1
!
--> ip routing
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
switchport mode trunk
!
interface FastEthernet0/2
switchport mode trunk
!
interface FastEthernet0/3
switchport mode trunk
!
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
--> description Link to Router
--> switchport access vlan 11
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
shutdown
!
interface Vlan5
mac-address 000c.cf40.9501
ip address 192.168.7.1 255.255.255.0
!
interface Vlan11
mac-address 000c.cf40.9502
ip address 192.168.11.1 255.255.255.0
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
end

salmanfaryad
Level 1
Level 1

Thanks for your feedback.

1- Router should access both vlans (5 and 11) 

2- That's why I configured 192.168.1.1/24 at router interface FastEthernet0/0 that is connected to the switch.

3- Switch interface FastEthernet0/1 is connected to Router

What about the below configuration?

 

 

 

ip routing

!

!

!

!

!

!

!

!

!

!

!

!

!

!

!

spanning-tree mode pvst

!

!

!

!

!

!

interface FastEthernet0/1

description **Connected-to-Router**

switchport trunk encapsulation dot1q

switchport mode trunk

!

interface FastEthernet0/2

switchport trunk encapsulation dot1q

switchport mode trunk

!

interface FastEthernet0/3

switchport trunk encapsulation dot1q

switchport mode trunk

!

 

interface Vlan1

no ip address

shutdown

!

interface Vlan5

mac-address 00e0.b0bb.4e01

ip address 192.168.7.1 255.255.255.0

!

interface Vlan11

mac-address 00e0.b0bb.4e02

ip address 192.168.11.1 255.255.255.0

!

ip classless

ip route 192.168.7.0 255.255.255.0 192.168.1.1

ip route 192.168.11.0 255.255.255.0 192.168.1.1

!

ip flow-export version 9

 

Hello,

 

that would work as well. You would need to create a subinterface on the router as in the below example. You don't need the static routes, as the networks are directly connected.

 

Router

 

interface GigabitEthernet0/0.11

description Link to Switch

encapsulation dot1q 11

ip address 192.168.11.2 255.255.255.0

Thanks a lot for your reply,

 But can it work without sub-interface at router?

It didn't, I tried

Attached is the file of Router configurations. 

From what you say it seems this router is only for voice? If so, change your router interface to

 

interface FastEthernet0/0 ip address 192.168.11.1 255.255.255.0

 

 Set the interface on your switch to access vlan 11.

 

I can see from you DHCP scope for Data that the DGW is 192.168.7.1, seeing as that IP is not on said router I presume you have another router for Data.

If you do not like to extend the Layer 2 to Router-  and doo not want to use sub-interface, you can use Point to Point interface between Router and Switch. You can exchange the Routes in Layer3 routing table, you can use static route or dynamic routing choice is yours.

 

If you like to extended the Lauer 2/3 VLAN you need to use sub-interfaces only, there is no other options we have here.

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Review Cisco Networking for a $25 gift card