Configuration

HostA and Host B connected as the diagram. This workstation configuration mode automatically set the IP address. Initial configuration of the router as follows


RouterA
!
hostname RouterA
!
ip subnet-zero
!
Excluded dhcp ip-address 10.0.0.1 10.0.0.10
!
ip dhcp pool network-10
network 10.0.0.0 255.255.255.0
default-router 10.0.0.1 
dns-server 10.0.0.3 
NetBIOS-name-server 10.0.0.4 
domain-name xyz.net
!
ip dhcp pool 198 network-
network 192.168.3.0 255.255.255.0
default-router 192.168.3.1 
dns-server 10.0.0.3 
NetBIOS-name-server 10.0.0.4 
domain-name xyz.net
!
interface FastEthernet0 / 0
ip address 10.0.0.1 255.255.255.0
no shut
!
interface Serial0 / 0
ip address 192.1.1.2 255.255.255.0
clockrate 64000
!
router rip
version 2
network 10.0.0.0
network 192.1.1.0
!
ip classless
!
end
RouterB
hostname RouterB
!
ip subnet-zero
!
interface FastEthernet0 / 0
ip address 192.168.3.1 255.255.255.0
ip helper-address 192.1.1.2
!
interface Serial0 / 0
ip address 192.1.1.1 255.255.255.0
!
router rip
version 2
network 192.1.1.0
network 192.168.3.0
!
ip classless
no ip http server
!
end

Implementation

1. Configuring RIPv2 running on the router, enabling RIP on all the communication port of the router:


RouterA (config) # router rip
RouterA (config) # version 2
RouterA (config-router) # network 192.1.1.0
RouterA (config-router) # network 10.0.0.0

RouterB (config) # router rip
RouterB (config-router) # version 2
RouterB (config-router) # network 192.1.1.0
RouterB (config-router) # network 192.168.3.0
Check back with ping and show ip route command to ensure that the connection is between RouterA and RouterB. In the router's routing table must have a route A and route 192.168.3.0 is learned via RIP.
RouterA # sh ip route
...

Gateway of last resort is not set

C 10.0.0.0 / 8 is directly connected, FastEthernet0 / 0
C 192.168.1.0/24 is directly connected, Serial0 / 0
R 192.168.3.0/24 [120 / 1] via 192.168.1.1, 00:00:05, Serial0 / 0 

2. RouterA is configured DHCP server for the client in network 10.0.0.0 / 8

-Enable DHCP service on RouterA


RouterA (config) # service dhcp

-Creates a DHCP pool for the network 10.0.0.0, the name of the pool is network-10

RouterA (config) # ip dhcp pool network-10
RouterA (config-dhcp) # network 10.0.0.0 255.255.255.0

Suppose the first 10 addresses are assigned to the servers and routers in the network, so the client is assigned from the address 10.0.0.11 or later, execute the dhcp ip-address Excluded to exclude this address. 
RouterA (config) # ip dhcp-address 10.0.0.1 10.0.0.10 Excluded

3. Back in the DHCP configuration mode and set the parameters such as IP address default gateway address, DNS server, WINS server, and domain name. These parameters will be supplied IP address.

Check DHCP server operation
RouterA (config) # ip dhcp pool network-10
RouterA (config-dhcp) # default-router 10.0.0.1
RouterA (config-dhcp) # dns-server 10.0.0.3
RouterA (dhcp-config) # NetBIOS-name-server 10.0.0.4
RouterA (config-dhcp) # domain-name xyz.net



On the client: To apply the IP address. Host A is assigned the first IP address pool is 10.0.0.11. 

+ Check the command HostA Winipcfg (Win98/WinME) or ipconfig / all to see has received the correct IP address, subnet mask, default gateway, DNS, and WINS server. 

+ Use the command ipconfig / all for Windows XP, Windows 2000.
- WinXP, Win2000: Start / Run / cmd 
- Win9x: Start / Run / command

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright Microsoft Corp 1985-2001.


C: \> ipconfig / release

Windows IP Configuration
Ethernet adapter Local Area Connection 3:

Connection-specific DNS Suffix. :
IP Address. . . . . . . . . . . . : 0.0.0.0
Subnet Mask. . . . . . . . . . . : 0.0.0.0
Default Gateway. . . . . . . . . :


C: \> ipconfig / renew

Windows IP Configuration
Ethernet adapter Local Area Connection 3:

Connection-specific DNS Suffix. : Xyz.net
IP Address. . . . . . . . . . . . : 10.0.0.11
Subnet Mask. . . . . . . . . . . : 255.255.255.0
Default Gateway. . . . . . . . . : 10.0.0.1

C: \> ipconfig / all

Windows IP Configuration
Host Name. . . . . . . . . . . . : Khan
Primary Dns Suffix. . . . . . . :
Node Type. . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Local Area Connection 3:
Connection-specific DNS Suffix. : Xyz.net
Description. . . . : Realtek RTL8139 Family PCI Fast Ethernet NIC # 2
Physical Address. . . . . . . . . : 00-E0-4D-01-29-78
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled. . . . : Yes
IP Address. . . . . . . . . . . . : 10.0.0.11
Subnet Mask. . . . . . . . . . . : 255.0.0.0
Default Gateway. . . . . . . . . : 10.0.0.1
DHCP Server. . . . . . . . . . . : 10.0.0.1
DNS Servers. . . . . . . . . . . : 10.0.0.3
Primary WINS Server. . . . . . . : 10.0.0.4
Lease Obtained. . . . . . . . : Thursday, February 05, 2004 9:08:24 AM
Lease Expires. . . . . . . . : Friday, February 06, 2004 9:08:24 AM

C: \> _

Because HostB located in another network segment is also configured dynamic IP, so we need to create a DHCP pool Monday with the corresponding address and gateway for the network 192.168.3.0/24:


RouterA (config) # ip dhcp pool 198 network-
RouterA (config-dhcp) # network 192.168.3.0 255.255.255.0
RouterA (config-dhcp) # default-router 192.168.3.1
RouterA (config-dhcp) # dns-server 10.0.0.3
RouterA (dhcp-config) # NetBIOS-name-server 10.0.0.4
RouterA (config-dhcp) # domain-name xyz.net

DHCP configuration to complete, but HostB use UDP broadcast to find the IP address. RouterB has not been configured to forward this broadcast. For DHCP operation for RouterB network segment, to configure the FastEthernet port forwarding UDP broadcast RouterB to RouterA.

RouterB (config) # interface FastEthernet 0 / 0
RouterB (config-if) # ip helper-address 192.168.1.2

¤ ip helper-address command can forward many other protocols such as UDP-based DNS, BOOTP request. You can specify the exact protocol transition with the command ip forward-protocol udp [port] 

4. Host B in the implementation of release and renew IP configuration. Check the IP address or Winipcfg command ipconfig / all

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright Microsoft Corp 1985-2001.

C: \ Documents and Settings \ vnpro>
C: \ Documents and Settings \ vnpro> ipconfig / release

Windows IP Configuration
Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix. :
IP address autoconfiguration. . . : 169254173207
Subnet Mask. . . . . . . . . . . : 255.255.0.0
Default Gateway. . . . . . . . . :

C: \ Documents and Settings \ vnpro> ipconfig / renew

Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix. : Xyz.net
IP Address. . . . . . . . . . . . : 192.168.3.2
Subnet Mask. . . . . . . . . . . : 255.255.255.0
Default Gateway. . . . . . . . . : 192.168.3.1

C: \ Documents and Settings \ vnpro> ipconfig / all

Windows IP Configuration
Host Name. . . . . . . . . . . . : Phuong
Primary Dns Suffix. . . . . . . :
Node Type. . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix. : Xyz.net
Description. . . . . . . . : SiS 900-Based PCI Fast Ethernet Adapter
Physical Address. . . . . . . . . : 00-0A-E6-5E-84-77
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled. . . . : Yes
IP Address. . . . . . . . . . . . : 192.168.3.2
Subnet Mask. . . . . . . . . . . : 255.255.255.0
Default Gateway. . . . . . . . . : 192.168.3.1
DHCP Server. . . . . . . . . . . : 192.168.1.2
DNS Servers. . . . . . . . . . . : 10.0.0.3
Primary WINS Server. . . . . . . : 10.0.0.4
Lease Obtained. . . . . . . . : Friday, February 06, 2004 9:22:16 AM
Lease Expires. . . . . . . . : Saturday, February 07, 2004 9:22:16 AM


Note, at this time Host B's IP address is 192.168.3.2 by the first address is set at 192.168.3.1 default-router command and was assigned as the address of RouterB interface FastEthernet. DHCP server has made the first ping 192.168.3.1 addresses to know it exists or not.

To see what IP address has granted corresponding MAC addresses, execute
RouterA # sh ip dhcp conflicts

IP address Detection method Detection time
Ping 192.168.3.1 Mar 01 1993 12:22 AM





RouterA # sh ip dhcp binding

IP address Type Hardware address Lease Expiration
10.0.0.11 0100.e04d.0129.78 Mar 02 1993 12:15 AM Automatic
0100.0ae6.5e84.77 192.168.3.2 Mar 02 1993 12:22 AM Automatic

RouterA know how to assign the address for Host B from pool-198 network without network-10 from the pool because Host B's DHCP request is forwarded using the ip helper-address and this request comes from the FastEthernet interface RouterB 192.168.3.1 address, the address is in a pool-198 network, the DHCP server will respond with an address from this pool.

Lab 1-1: Configuring a DHCP Server and IP helper-address