Press "Enter" to skip to content

Configure DHCP for VLAN

        <a href="https://i.stack.imgur.com/2YiY9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2YiY9.png" alt="enter image description here" /></a>
I'm configuring DHCP for VLAN on a router. At last, the computer can not retrieve the IP address. Below is how I have configured. Switch
Switch>en

Switch#conf t

Switch(config)#vlan 10
Switch(config-vlan)#name LEFT
Switch(config-vlan)#vlan 20
Switch(config-vlan)#name MIDDLE
Switch(config-vlan)#vlan 30
Switch(config-vlan)#name RIGHT
Switch(config-vlan)#exit

Switch(config)#vlan range fa0/1-8
Switch(config)#int range fa0/1-8
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 10
Switch(config-if-range)#exit

Switch(config)#int range fa0/9-16
Switch(config-if-range)#switchport mode access 
Switch(config-if-range)#switchport access vlan 20
Switch(config-if-range)#exit

Switch(config)#int range fa0/17-23
Switch(config-if-range)#switchport access vlan 30
Switch(config-if-range)#exit

Switch(config)#int fa0/24
Switch(config-if)#switchport mode trunk
Switch(config-if)#do show vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/24, Gig0/1, Gig0/2
10   LEFT                             active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
                                                Fa0/5, Fa0/6, Fa0/7, Fa0/8
20   MIDDLE                           active    Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16
30   RIGHT                            active    Fa0/17, Fa0/18, Fa0/19, Fa0/20
                                                Fa0/21, Fa0/22, Fa0/23
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active    

Switch(config-if)#vlan 40
Switch(config-vlan)#name NATIVE
Switch(config-vlan)#exit
Router
Router#en
Router#conf t

Router(config)#int fa0/0.1
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip address 197.168.1.1 255.255.255.0
Router(config-subif)#exit

Router(config)#int fa0/0.2
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip address 197.168.2.1 255.255.255.0
Router(config-subif)#exit

Router(config)#int fa0/0.3
Router(config-subif)#encapsulation dot1Q 30
Router(config-subif)#ip address 197.168.3.1 255.255.255.0
Router(config-subif)#exit

Router(config)#int fa0/0.4
Router(config-subif)#encapsulation dot1Q 40 native
Router(config-subif)#exit

Router(config)#ip dhcp pool left
Router(dhcp-config)#default-router 192.168.1.1
Router(dhcp-config)#network 192.168.1.0 255.255.255.0
Router(dhcp-config)#exit

Router(config)#ip dhcp pool middle
Router(dhcp-config)#default-router 192.168.2.1
Router(dhcp-config)#network 192.168.2.0 255.255.255.0
Router(dhcp-config)#exit

Router(config)#ip dhcp pool right
Router(dhcp-config)#default-router 192.168.3.1
Router(dhcp-config)#network 192.168.3.0 255.255.255.0
Router(dhcp-config)#exit

Router(config)#int fa0/0
Router(config-if)#no shut

Be First to Comment

Leave a Reply

%d bloggers like this: