Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple VLAN DHCP 1

Status
Not open for further replies.

nickwa

MIS
Jan 27, 2008
4
US
Is it possible (and if so how would I do it) to set up an 1841 router to do dhcp for 20 different vlans trunked to a 2960 switch and then nat that out to an internet connection? I have looked for docs but can't find anything helpful.


Thanks
 
Hello
Yes!Its possible.This command is your friend.

"ip helper-address"



Regards
 
Sorry, I wasn't clear. I wanted the router to do the DHCP for the VLANs/subnets. I think it does but I don't want to screw this up. I found a config that has something that looks like it will work -
Is it as easy as adding this?

ip dhcp pool pool1
import all
network 192.168.20.0 255.255.255.0
default-router 192.168.20.1
ip dhcp pool pool2
import all
network 192.168.21.0 255.255.255.0
default-router 192.168.21.1
interface Vlan20
description VLAN20
ip address 192.168.20.1 255.255.255.0
no ip redirects
no ip unreachables
no ip proxy-arp
ip nat inside
ip virtual-reassembly
interface Vlan21
description VLAN21
ip address 192.168.21.1 255.255.255.0
no ip redirects
no ip unreachables
no ip proxy-arp
ip nat inside
ip virtual-reassembly

and then trunking e1 to the switch?

Thanks for the help.
 
If you plan on configuring 20 Vlans, I wouldn't recommend using a router on stick.
 
Thanks - Don't really have a choice. It's for a vendor series of networks at a temporary site. They just need to communicate on their own subnet and VPN out. Will this work? Do I have to make changes to this?

Thanks
 
Just know that router on a stick is a bottleneck and single point of failure...

Burt
 
Hello
In your case I would pull an old computer out of the attic and make it a linux box.Then run it as a DHCP server.

Regards
 
Here is a setup I used for a client

Router Setup:
(One per port/vlan)
ip dhcp excluded-address 10.0.101.1 10.0.101.10
ip dhcp excluded-address 10.0.102.1 10.0.102.10

(One per port/vlan)
ip dhcp pool vlan101
network 10.0.101.0 255.255.255.0
default-router 10.0.101.1
!
ip dhcp pool vlan102
network 10.0.102.0 255.255.255.0
default-router 10.0.102.1

interface FastEthernet0/0
ip address dhcp
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
no cdp enable
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
!
(One subinterface per port/vlan)
interface FastEthernet0/1.101
encapsulation dot1Q 101
ip address 10.0.101.1 255.255.255.0
ip access-group 101 in
no ip redirects
no ip unreachables
no ip proxy-arp
ip nat inside
ip virtual-reassembly
!
interface FastEthernet0/1.102
encapsulation dot1Q 102
ip address 10.0.102.1 255.255.255.0
ip access-group 102 in
no ip redirects
no ip unreachables
no ip proxy-arp
ip nat inside
ip virtual-reassembly
!

(One ACL per port/vlan)
access-list 101 permit ip 10.0.101.0 0.0.0.255 10.0.101.0 0.0.0.255
access-list 101 deny ip 10.0.101.0 0.0.0.255 10.0.0.0 0.255.255.255
access-list 101 permit ip any any
access-list 102 permit ip 10.0.102.0 0.0.0.255 10.0.102.0 0.0.0.255
access-list 102 deny ip 10.0.102.0 0.0.0.255 10.0.0.0 0.255.255.255
access-list 102 permit ip any any

access-list 199 permit ip 10.0.0.0 0.0.255.255 any
ip nat inside source list 199 interface FastEthernet0/0 overload

Switch:
(Configure each interface with different VLAN)
interface FastEthernet0/1
switchport access vlan 101
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/2
switchport access vlan 102
switchport mode access
spanning-tree portfast

(Trunk a port to the router.)
interface GigabitEthernet0/1
switchport trunk allowed vlan 1,101-124
switchport mode trunk


That should do it for you without having to buy new equipment.


Brent
Systems Engineer / Consultant
CCNP, CCSP
 
each dhcp pool you setup will only assign addresses to networks you have setup. So if you have a pool for 192.168.2.0 and you have a network 192.168.2.0 it will assign addresses in that network.

CCNA MCSE MCP NET+ A+ Security+
 
I got most of it on my own. But thanks anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top