Associate Vlan with subnet

30 pts.
Tags:
DHCP
Subnets
VLAN
VLAN trunking
Hi, I can't figure out how to associate a VLAN with a Subnet. For subnets you need to have a router in between. For VLAN's trunking...but how do I associate these 2 so when a port on the switch is change from VLAN 1 to VLAN 2 to get IP address from a different subnet DHCP. Thank you!

Answer Wiki

Thanks. We'll let you know when a new response is added.

By default a VLAN is a mechanism that seperates broadcast domains, and is not assocaited with Layer 3 addressing. To make a long story short, in order to accomplish communication between two differnet networks that are in two differnet VLAN’s you will need a Layer 3 device to route traffic between the two differnet networks. This can be accomplished by using a dedicated router connected to a switch, or by using a switch with layer 3 functionality.

If you are using the router and switch method, you can either have two interfaces on the router connected to the switch, one in each VLAN. For example purposes, lets say router interface fa0/0 is IP’d 10.1.1.1 255.255.255.0 and connected to switchport fa0/0 on switch 1 in VLAN 2; and interface fa0/1 is IP’d 10.2.2.1 255.255.255.0 and is connected to switchport fa0/1 on switch 1 in VLAN3. Now the rest of the ports on the switch have workstations and servers connected and let say workstations are in VLAN 2 and servers in VLAN3. The workstation have a default-gatewat of 10.1.1.1, which is the router’s interface, and the servers have a default gateway of 10.2.2.1, which is the other router interace. SInce these networks are directly connected on the router, servers and workstations will be able to communicate with each other. An alternative to this scenario is use only one router interface and create a trunk to the switch by using sub-intefaces on the router and tagging VLAN’s using a trunking protocol such as 802.1Q. The last method is commonly know as “router-on-a-stick”

Another example on how to accomplish this task is multilayer switching This method uses only a multilayer switch, a switch that is capable of layer 2 and layer3 functionality. WIth this method, you would create switched virtual interfaces(SVI’s) that are virtual layer 3 intefaces capable of routing traffic. To accomplish the sames results as in the previous example, you will need to create 2 SVI;s on the switch, and enable IP routing. Here is an example

Create SVI for VLAN 2
Router(config)#int vlan 2
Router(config-if)#ip address 10.1.1.1 255.255.255.0
Router(config-if)#no shut

Assign VLAN 2 to a switchport for a workstation
Router(config-if)#int fa1/0
Router(config-if)#switchport access vlan 2

Create SVI for VLAN 3
Router(config)#interface vlan 3
Router(config-if)#ip address 10.2.2.1 255.255.255.0

Assign VLAN3 to a switchport for a server
Router(config-if)#interface fa1/1
Router(config-if)#switchport access vlan 3

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following