cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
371
Views
0
Helpful
2
Replies

Simple VLAN Network Configuration

sarfarazkazi
Level 1
Level 1

Dear All,

I am a newbie and have setup a small lab to practise vlans. I have not done any configuration on the switch or the router. Below are my queries:

1. Do I have to configure sub-internfaces on the router for the vlans? If not then how can I get the traffic from each vlan to the internet?

2. Are the respective vlans able to access each other? Eg Will I be able to access a host on vlan 102 from vlan 101?

3. How will all the hosts each on vlan get IP address from the DHCP server?

4. What is the basic working configuration for this setup?

Thanks for all your help.

Regards

Sarf

2 Replies 2

Jon Marshall
Hall of Fame
Hall of Fame

1) Yes if you don't have an added switch module.

2) If you setup subinterfaces on the 2811 - yes.

3) By use of ip-helper address - see below

4)

2960

2960(config)# vlan 101

2960(config-vlan)# name vlan101

etc.. for each vlan

On the port connecting the 2960 to the 2811

int fa0/1

switchport mode trunk

Then you can allocate ports into vlans by using the following commands

int fa0/2

switchport mode access

switchport access vlan 101

etc..

On 2811

int gi0/1.101

encapsulation dot1q 101

ip address 192.168.5.1 255.255.255.0

int gi0/1.102

encapsulation dot1q 102

ip address 192.168.6.1 255.255.255.0

etc..

Note.

The interface numbers do not have to match the vlan numbers eg.

gi0/1.101 could just as easily be

gi0/1.1 it's up to you. BUT the encapsulation dot1q - this must use the correct vlan number.

Set your clients in vlan 101 to have a default-gateway of 192.168.5.1

vlan 102 - default-gateway of 192.168.6.1

etc..

Under each subinterface on your 2811 whatever the DHCP server is - lets say 192.168.5.10

int vlan 102

ip helper-address 192.168.5.10

Note you don't need this under the interface that the DHCP server is on.

Jon

SJessulat_2
Level 1
Level 1

Hi Sarf,

1. Yes, you have to configure sub-interfaces on the router, each with a IP-Adress in the subnet of that vlan.

2. The Vlans are only accessible from each other if the router has the mentioned sub-interfaces.

3. The DHCP-Server has to have a pool for each subnet/vlan. When the dhcp-server gets an dhcp-request, he sees the packet with the source-address of the routers sub-interface. E.g. if a host from vlan 101 requests an IP-address, the packet arrives at the dhcp-server with the routers IP-Adress of VLAN 101. Because of that, the DHCP-Server knows what pool he has to choose.

BUT you have to configure IP-Helper-adresses on the routers sub-interfaces, otherwise the router wouldn't forward the dhcp-requests because they are broadcasts.

4. Do you want the exact commands?

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card