Worried about replacing the DHCP server with an old IP?
Original model: The server delivers DHCP to the following vlan through R1-Agent, and it runs normally:
Then the DHCP server is too old or the configuration is too weak. If we transfer the DHCP server to the Router, the Router will know which IPs have been assigned to PCs. Should we avoid it when assigning new PCs?
test:
First, configure the system to run according to the original picture:
DHCP server (using Cisco router):
ip dhcp exclude address 192.168.1.1
ip dhcp exclude address 192.168.2.1
!
IP DHCP pool pool_192.168.1.0
Network 192.168.1.0 255.255.255.0
Default router 192.168.1.1
dns server 8.8.8.8
!
IP DHCP pool pool_192.168.2.0
Network 192.168.2.0 255.255.255.0
Default router 192.168.2.1
dns server 8.8.8.8
!
IP routing 192.168.1.0 255.255.255.0 10.1.2.1
IP routing 192.168.2.0 255.255.255.0 10.1.2.1
DHCP Agent R1:
Interface Ethernet0/1.100
Package dot1Q 100
IP address 192.168.1.1 255.255.255.0
ip helper address 10.1.2.2
!
Interface Ethernet0/1.200
Package dot1Q 200
IP address 192.168.2.1 255.255.255.0
ip helper address 10.1.2.2
Software L2:
Interface Ethernet 0/0
Switch port trunk encapsulation dot1q
switch port mode trunking
!
Interface Ethernet 0/1
Switch port access VLAN 100
Switch port mode access
!
Interface Ethernet 0/2
Switch port access VLAN 200
Switch port mode access
!
Then we see PC1 receives DHCP IP 192.168.1.2
Now let us remove DHCP server and try to create DHCP vlan 100 pool on R1-Agent
R1-Agent:
Interface Ethernet0/1.100
Package dot1Q 100
IP address 192.168.1.1 255.255.255.0
!
ip dhcp exclude address 192.168.1.1
!
IP DHCP pool pool_192.168.1.0
Network 192.168.1.0 255.255.255.0
Default router 192.168.1.1
dns server 8.8.8.8
Test request DHCP on PC3
We see it receives 192.168.1.3 => like this no infection 192.168.1.2 on PC1
We tried capturing wireshark and found that the router agent, before granting the IP to PC3, tried to ping IP 192.168.1.2 to see if anyone was using it and found that PC1 already used it, so it no longer granted .1.2.
There is also a notification on R1-Agent that 1.2 already has a user:
Xem tiếp...