Options

VLan & DHCP router config

rakemrakem Member Posts: 800
hey everyone question about Vlans and setting up a router for DHCP.

Say i have the following situation
network = 10.1.21.0 255.255.255.224
So host addresses would be as follows:
VLAN2 = 10.1.21.1 - 10.1.21.30
VLAN3 = 10.1.21.33 - 10.1.21.62
VLAN4 = 10.1.21.65 - 10.1.21.126
VLAN5 = 10.1.21.129 - 10.1.21.190
VLAN6 = 10.1.21.193 - 10.1.21.222

Right so i have setup the router with the following config, im using the first address in each subnet for each sub interface address.

Router(config)#int fa0/0
Router(config-if)#no ip address
Router(config-if)#int fa0/0.2
Router(config-subif)#ip address 10.1.21.1 255.255.255.224
Router(config-subif)#int fa0/0.3
Router(config-subif)#encapsulation dot1q 3
Router(config-subif)#ip address 10.1.21.33 255.255.255.224
Router(config-subif)#int fa0/0.4
Router(config-subif)#encapsulation dot1q 4
Router(config-subif)#ip address 10.1.21.65 255.255.255.224
Router(config-subif)#int fa0/0.5
Router(config-subif)#encapsulation dot1q 5
Router(config-subif)#ip address 10.1.21.129 255.255.255.224
Router(config-subif)#int fa0/0.6
Router(config-subif)#encapsulation dot1q 6
Router(config-subif)#ip address 10.1.21.193 255.255.255.224
Router(config-subif)#exit


Ok so is it possible to configure the router, (its a Cisco 1841) with DHCP for each VLAN?
so i would need 6 seperate DHCP pools i guess.
I have been playing around with different DHCP commands on the router but im really not sure what im doing

Router(config)#ip dhcp pool vlanPool
Router(dhcp-config)#network ?
A.B.C.D Network number in dotted-decimal notation
Router(dhcp-config)#network 10.1.21.0 255.255.255.224


yea im not really sure how to get it to work... can anyone give me some pointers, or a link or something?

cheers.
CCIE# 38186
showroute.net

Comments

  • Options
    markzabmarkzab Member Posts: 619
    rakem wrote:
    Router(config)#int fa0/0
    Router(config-if)#no ip address
    Router(config-if)#int fa0/0.2
    Router(config-subif)#ip address 10.1.21.1 255.255.255.224
    Router(config-subif)#int fa0/0.3
    Router(config-subif)#encapsulation dot1q 3
    Router(config-subif)#ip address 10.1.21.33 255.255.255.224
    Router(config-subif)#int fa0/0.4
    Router(config-subif)#encapsulation dot1q 4
    Router(config-subif)#ip address 10.1.21.65 255.255.255.224
    Router(config-subif)#int fa0/0.5
    Router(config-subif)#encapsulation dot1q 5
    Router(config-subif)#ip address 10.1.21.129 255.255.255.224
    Router(config-subif)#int fa0/0.6
    Router(config-subif)#encapsulation dot1q 6
    Router(config-subif)#ip address 10.1.21.193 255.255.255.224
    Router(config-subif)#exit

    I don't mean to hijack your thread but I just wanted to ask you something. I noticed on each sub-interface you executed 2 commands--encapsulation dot1q and IP address. I was wondering why you didn't run the encapsulation command on the first sub-interface you created, sub-intf 2?

    Just trying to learn for myself. icon_wink.gif

    Sorry I can't help you though.
    "You, me, or nobody is gonna hit as hard as life. But it ain't how hard you hit; it's about how hard you can get hit, and keep moving forward. How much you can take, and keep moving forward. That's how winning is done!" - Rocky
  • Options
    rakemrakem Member Posts: 800
    ah good point. i think i just forgot. haha
    each sub interface should defiantly have the encapsulation specified.
    CCIE# 38186
    showroute.net
  • Options
    markzabmarkzab Member Posts: 619
    rakem wrote:
    ah good point. i think i just forgot. haha
    each sub interface should defiantly have the encapsulation specified.

    Nice to see after 6 years away from the industry my troubleshooting skills are still in tact. icon_lol.gif
    "You, me, or nobody is gonna hit as hard as life. But it ain't how hard you hit; it's about how hard you can get hit, and keep moving forward. How much you can take, and keep moving forward. That's how winning is done!" - Rocky
  • Options
    rakemrakem Member Posts: 800
    Ok well if anyone is interested i think i have figured this out for my self.

    config would be something like the following:

    1841(config)#ip dhcp pool vlan2
    1841(dhcp-config)#network 10.1.21.0 255.255.255.224
    1841(dhcp-config)#def
    1841(dhcp-config)#default-router 10.1.21.1
    1841(dhcp-config)#dns-server 10.1.21.3 10.1.20.3 10.1.20.4
    1841(dhcp-config)#domain-name domain.local
    1841(dhcp-config)#lease 5

    1841(config)#ip dhcp pool vlan3
    1841(dhcp-config)#network 10.1.21.32 255.255.255.224
    1841(dhcp-config)#dns-server 10.1.21.3 10.1.20.3 10.1.20.4
    1841(dhcp-config)#default-router 10.1.21.33
    1841(dhcp-config)#domain-name domain.local
    1841(dhcp-config)#lease 5

    1841(config)#ip dhcp pool vlan4
    1841(dhcp-config)#network 10.1.21.64 255.255.255.224
    1841(dhcp-config)#default-router 10.1.21.65
    1841(dhcp-config)#dns-server 10.1.21.3 10.1.20.3 10.1.20.4
    1841(dhcp-config)#domain
    1841(dhcp-config)#domain-name domain.local
    1841(dhcp-config)#lease 5
    1841(dhcp-config)#

    So you would create a different pool for each VLAN and use the network command to define which addresses relate to the pool.

    Anyone got any other suggestions? i think this would work, will be testing in a test lab soon hopefully..
    CCIE# 38186
    showroute.net
Sign In or Register to comment.