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.
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
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?
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.
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.