As we see we have configured the sub-interface (from our router on stick video) and here is our show run so far
R1#show run
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.2
description this will act as DG=10.10.10.100 for VLAN2
encapsulation dot1Q 2
ip address 10.10.10.100 255.255.255.0
!
interface FastEthernet0/0.3
description This Will act as DG=20.20.20.100 for VLAN 3
encapsulation dot1Q 3
ip address 20.20.20.100 255.255.255.0
!
Remember from last video on rouetr on stick we only give IP address to sub-interface , not physical interface f0/0
Now I will configure the DHCP server on R1
Hint : always start with IP DHCP ?
Remember from DHCP server video; it is done on two step process
Step 1) Exclude IP address range
Step 2) Create a scope and give IP address for Default-gatway
Step 1) Exclude the IP address for the Network 10.10.10.0
R1#config t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ip dhco
R1(config)#ip dhcp ?
excluded-address Prevent DHCP from assigning certain addresses
pool Configure DHCP address pools
relay DHCP relay agent parameters
R1(config)#ip dhcp ex
R1(config)#ip dhcp excluded-address ?
A.B.C.D Low IP address
R1(config)#ip dhcp excluded-address 10.10.10.100
R1(config)#
R1(config)#
Step 2) Now I will give the Scope for the network 10.10.10.0
R1(config)#ip dhcp ?
excluded-address Prevent DHCP from assigning certain addresses
pool Configure DHCP address pools
relay DHCP relay agent parameters
R1(config)#ip dhcp poo
R1(config)#ip dhcp pool ?
WORD Pool name
R1(config)#ip dhcp pool LAN10
R1(dhcp-config)#
R1(dhcp-config)#
R1(dhcp-config)#?
default-router Default routers
dns-server Set name server
exit Exit from DHCP pool configuration mode
network Network number and mask
no Negate a command or set its defaults
option Raw DHCP options
R1(dhcp-config)#network 10.10.10.0 255.255.255.0
R1(dhcp-config)#default-router 10.10.10.1
Here is show run so far
R1#show run
ip dhcp excluded-address 10.10.10.100
!
ip dhcp pool LAN10
network 10.10.10.0 255.255.255.0
default-router 10.10.10.1
!
Now I will do same concept for Network 20.20.20.0
Step 1) Exclude the IP address for the Network 20.20.20.0
R1#config t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ip dhco
R1(config)#ip dhcp ?
excluded-address Prevent DHCP from assigning certain addresses
pool Configure DHCP address pools
relay DHCP relay agent parameters
R1(config)#ip dhcp ex
R1(config)#ip dhcp excluded-address ?
A.B.C.D Low IP address
R1(config)#ip dhcp excluded-address 20.20.20.100
R1(config)#
R1(config)#
Step 2) Now I will give the Scope for the network 20.20.20.0
R1(config)#ip dhcp ?
excluded-address Prevent DHCP from assigning certain addresses
pool Configure DHCP address pools
relay DHCP relay agent parameters
R1(config)#ip dhcp poo
R1(config)#ip dhcp pool ?
WORD Pool name
R1(config)#ip dhcp pool LAN20
R1(dhcp-config)#
R1(dhcp-config)#
R1(dhcp-config)#?
default-router Default routers
dns-server Set name server
exit Exit from DHCP pool configuration mode
network Network number and mask
no Negate a command or set its defaults
option Raw DHCP options
R1(dhcp-config)#network 20.20.20.0 255.255.255.0
R1(dhcp-config)#default-router 20.20.20.1
Here is show run so far
R1#show run
ip dhcp excluded-address 10.10.10.100
ip dhcp excluded-address 20.20.20.100
ip dhcp pool LAN10
network 10.10.10.0 255.255.255.0
default-router 10.10.10.1
!
ip dhcp pool LAN20
network 20.20.20.0 255.255.255.0
default-router 20.20.20.1
Now If I go to all PC and make them DHCP client , they will have ip address and will be ping from Network 10.10.10.0 to Network 20.20.20.0
gol
Cisco CCNA DHCP Server with Inter Vlan routing