Vlan Routing Lab

controlcontrol Member Posts: 309
Hi,

Recently attempted a small Lab, not from any particular book/course - just thought I'd try something my self.

I had posted on CLN also regarding this but didn't get much feedback.

I wrote it all down on paper which was simple enough but when it came to implementation, got a bit lost. I know in theory how to do it, and put it on paper but come to the physical side...struggling.

Not even sure if what I'm trying to achieve is possible so looking for some advice. I'm trying to start small and do this with only one switch (2950) and one router (1751)

I want to create 2 vlans and get them talking to each other using one router interface (FE) (I'm thinking that the router interface will have to have a sub interface created so each interface can then act as a gateway for their relevant VLAN)?

I also want the router to act as a DHCP server for both of my vlans. Am I able to create 2 scopes and have the router know which scope is for what VLAN?


Now I can create the VLANs on the switch, but I think it's the IP addressing / DHCP side of things that is confusing me when trying to implement.

Is what I'm trying to LAB possible and could anyone provide some simple steps to get this going. Like I said, the breakdown and theory of it all I understand, just putting it all together I'm hitting a wall.

Comments

  • bermovickbermovick Member Posts: 1,135 ■■■■□□□□□□
    You're pretty much talking about the famous 'router on a stick' setup here.

    What you'll do is configure the switch's port as a trunk carrying both vlans, then create subinterfaces on the router, with each having an address in the appropriate subnet. You'll have to add an extra command on the router so it'll identify the right subinterface with the right tagged packets. You'll either leave the main interface without an address or leave it for untagged packets.

    For DHCP I'm pretty sure the router would know which pool to use, based on which (sub)interface the DHCP request comes in on.

    Config-wise you'll be looking at something like this:

    int f0/0.10
    encapsulation dot1q 10
    ip address 192.168.10.1 255.255.255.0
    int f0/0.20
    encapsulation dot1q 20
    ip address 192.168.20.1 255.255.255.0

    Note even though I made each subinterface match the VLAN tag (which matched the subnet), that's really not necessary (unless you want to stay sane)



    [edit] encapsulation command has to come before the ip address command
    Latest Completed: CISSP

    Current goal: Dunno
  • controlcontrol Member Posts: 309
    Excellent, with regards to the DHCP - It all seems logical now - of course if the DHCP request is coming from the VLAN it will go to the router subinterface for that VLAN - icon_smile.gif That's for that!

    Would this work if I used the router main interface and one subinterface? Or would I always have to go down the 2 sub interfaces?
  • bermovickbermovick Member Posts: 1,135 ■■■■□□□□□□
    The main router interface defaults to 'untagged' packets (in fact, you can't configure it to take tagged packets), so you can. I personally prefer using subinterfaces (see sanity reference above), but other people would probably say putting the native vlan on the primary interface makes sense too.
    Latest Completed: CISSP

    Current goal: Dunno
Sign In or Register to comment.