08-08-2013 05:41 AM - edited 03-07-2019 02:49 PM
Hi,
I'm trying to run 2 vlans on a lab network.
I've a network 10.180.0.0/16 for this purpose in that I'm already using in my internal dhcp server. Static addressess for server are form 10.180.128.0-254/16 scope and clients are dynamic from 10.180.140.1 - 10.180.141.254/16 scope.
Now I wish to add also IP phones and connect them between the PC and Switch.
There is also a router that routes to the another subnet of the lan and internet.
Thus I don't have much problems to create and assign the to the ports of the switch vlan's, the magior problem is that I cant figure it out how to configure the router interface with class B subnet to manage the routing between the two vlan's that I create.
All the docs I've read talk about C class subnets, and subinterfaces. And if I have one subnet B that I use with 2 vlan's? I.e.
10.180.0.0/16:
10.180.128.1/16 - router int fa0/0
|
|-->10.180.128.1 - 254/16 - servers/switches
|
|-->10.180.140.1/16 - 10.180.141.254/16 (vlan1) -> computers/clients
|
|-->10.180.200.1/16 - 10.180.200.254/16 (vlan2) -> ip phones
How to configure the router to make them talk together so I can at least ping from device from vlan1 to device in vlan2?
BR
Marcin
08-08-2013 04:43 PM
Marcin,
As you have already defined your data network as a class B 10.180.x.x/16 we normally consider that as 1 vlan. To burst this down into vlans/subnets you will need to go around and change all your masks and default gateways that could be a daunting task.
Generally 1 vlan (layer 2) = 1 subnet (layer 3).
The simplest solution here would be to define a new
ip range for the VOIP.
Lets say 192.168.2.0/24 (Class c).
So vlan 1 = 10.180.0.0/16
vlan 2 = 192.168.2.0/24.
On the interface of the switch that connect to the router, define this as a trunk.
!
int fas 0/24
desc *** TRUNK TO ROUTER ***
switchport encap dot1q
switchport mode trunk
switcport trunk allowed vlan 1-2
no shut
!
!
! Suggested basic config for a phone with pc in back of it.
!
int fas 0/1
desc *** PHONE & PC PORT ***
switchport mode host
switchport access vlan 1
switchport voice vlan 2
no shut
!
On the router
!
int fas0/0
desc *** TRUNK TO SWITCH ***
no ip addrerss
no shut
!
int fas0/0.1
desc *** DATA VLAN 1 ***
encapsulation dot1Q 1
ip address 10.180.128.1 255.255.0.0
!
int fas0/0.2
desc *** VOIP VLAN 2 ***
encapsulation dot1Q 2
ip address 192.168.2.1 255.255.255.0
ip helper-address 10.180.x.x ((YOUR DHCP SERVER)
!
You will have to build a scope on your dhcp server with the correct options fot your type of phones.Or build the scope on this router and remove the ip helper.
something like this :-
!
ip dhcp excluded-address 192.168.2.1
!
ip dhcp pool VOIP VLAN 2
network 192.168.2.0 255.255.255.0
default-router 192.168.2.1
option 150 ip 192.168.2.250 (Your VOIP tftp server)
!
Obviously you will need to replace my suggested addresses with your own. But this may give you a start.
Regards,
Alex.
Please rate useful posts.
08-08-2013 10:23 PM
So it helped me to work out the working solution. Thanks. Below is my router and SW config, if in any case someone else will search for such kind of solution.
One more question/update. The command switchport mode host is depretiated i think the correct one should be switchport mode access instead.
The router config:
Router#sh running-config
Building configuration...
Current configuration : 1166 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
ip dhcp pool VOIP
network 192.168.2.0 255.255.255.0
default-router 192.168.2.1
option 150 ip 192.168.2.1
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.1
description **** PC VLAN1 ****
encapsulation dot1Q 1 native
ip address 10.180.128.1 255.255.0.0
!
interface FastEthernet0/0.2
description **** VOIP VLAN 2 ****
encapsulation dot1Q 2
ip address 192.168.2.1 255.255.255.0
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface Vlan1
no ip address
shutdown
!
ip classless
!
telephony-service
max-ephones 42 //****** is it a router limitation or packet tracer to 42 phones? or to have more is cosco UC switcher needed?
max-dn 100
ip source-address 10.180.128.1 port 2000
auto assign 4 to 99
auto assign 1 to 100
!
ephone-dn 1
number 602
!
ephone-dn 2
number 605
!
ephone 1
device-security-mode none
mac-address 0090.214B.BE16
type 7960
button 1:2
!
ephone 2
device-security-mode none
mac-address 00E0.F7AC.391D
type 7960
button 1:1
!
line con 0
line vty 0 4
login
!
end
Switch conf:
Switch#sh running-config
Building configuration...
Current configuration : 2132 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
interface FastEthernet0/1
switchport trunk allowed vlan 1-2
switchport mode trunk
!
interface FastEthernet0/2
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/3
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/4
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/5
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/6
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/7
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/8
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/9
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/10
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/11
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/12
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/13
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/14
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/15
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/16
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/17
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/18
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/19
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/20
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/21
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/22
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/23
switchport mode access
switchport voice vlan 2
!
interface FastEthernet0/24
switchport mode access
switchport voice vlan 2
!
interface Vlan1
no ip address
shutdown
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
end
Besides all of it I've also connected a separate dhcp server for 10.180.0.0/16 network.
Thx and best regards.
Marcin
08-09-2013 03:45 AM
Hi Marcin,
!
switchport mode host
!
I have used this for many years , I am sad if this is being taken out.
It is like a wee macro, it performs 3 tasks
1) Sets the interface to access mode
2) disables the interface from port channelling
3) Enables spanning tree portfast on the interface
Any way I hope I have helped you to build your new VOIP overlay network, Looks OK above
Regards,
Alex.
Please rate useful posts.
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