04-30-2008 04:57 AM - edited 03-05-2019 10:42 PM
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
04-30-2008 05:31 AM
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
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
04-30-2008 05:33 AM
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?
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