TOTAL
Since dec 2006
1'942'871 Visitors
4'218'042 Pages

Nov 2010 Stats
82'909 Visitors
146'476 Pages
196 countries
Full statistics



Help us translate
our tutorials!

JOIN the
OpenManiak Team.
OM TEAM
Director:
Blaise Carrera
Tutorials creation:
Blaise Carrera
Translaters:
Giovanni Fredducci
Angel Chraniotis
Moham. H. Karvan
Alexandro Silva
Blaise Carrera
Andrei Chertolyas
Sergiy Uvarov
Nickola Kolev
Łukasz Nowatkowski
Ivo Raisr
Catalin Bivolaru
Bogdan A. Costea
Kirill Simonov
Oliver Mucafir
JaeYoung Jeon
Seungyoon Lee
Jie Yu & Si Cheng
Tao Wei
YukiAlex
Fumihito Yoshida
Muhammad Takdir
Çağdaş Tülek
Auditors
Leslie Luthi
Joe Anderson
Jennifer Ockwell
Nigel Titley
Alison Rees
Webmaster:
Blaise Carrera
VYATTA - The Easy Tutorial - Case Study 7 - DHCP

Vyatta Case 7 - DHCP
Last Change : Jan 01 2008


Tool
Install
Ergonomy
Forum



Details What is Vyatta?
Screenshots
Prerequisites
Tutorial Vyatta
Vyatta & Cisco Commands
Vyatta/Cisco/Quagga Comparison (Quagga section)
Case Study 1 - Static routes (VC 2.0)
Case Study 2 - OSPF simple (VC 2.0)
Case Study 3 - OSPF advanced (VC 2.0)
Case Study 4 - BGP (VC 3.0)
Case Study 5 - VRRP (VC 2.2)
Case Study 6 - NAT (VC 2.0)
Case Study 7 - DHCP (VC 2.2)
Case Study 8 - IPSec (VC 2.2)
Case Study 9 - Packages (VC 3.0)
Case Study 10 - Bridging (VC 3.0)
Case Study 11 - CDP VC 3.0



⚠️⚠️⚠️
Please check our website about
attractions in Western Switzerland !! (Please use english translation).

⚠️⚠️⚠️
Merci de consulter notre site sur les
activités à faire en Suisse romande !!



1. CASE PRINCIPLE 2. PICTURE 3. CONFIGURATIONS 4. SHOW COMMANDS


1. CASE PRINCIPLE

Vyatta version used: VC 2.2 Aug 30, 2007
DHCP for Dynamic Host Configuration Protocol, is a protocol used by computers called clients, to get an IP address from a server.
In addition to an IP address, the server provides optional settings such as a subnet mask, a default gateway or a DNS server to the client.
To request an IP address, the client first broadcasts on the local subnet to find DHCP servers.
By default, the routers do not forward the broadcasts but they can be configured to forward them to the DHCP server.
The router forwarding the request is called a DHCP relay.

Check the packet analysis section to get information about the DHCP operations request process.


2. PICTURE

vyatta cisco case study VRRP   vyatta cisco case study VRRP Functionalities tested:

(click on the web links to have more details about a protocol)

Interface settings
Telnet access
DHCP server
DHCP relay
 
 
 
 
 
 
 
 
 
 
 
 
 
 


3. CONFIGURATIONS

VYATTA ROUTER A VC2.2 Aug 30, 2007
See the entire configuration
 
CISCO ROUTER A 2621 IOS: 12.2(23a)
See the entire configuration
 
edit interfaces ethernet eth0
  set address 10.0.2.1 prefix-length 24
interface FastEthernet0/0
  ip address 10.0.2.1 255.255.255.0
set system host-name Vyatta-RouterA hostname Cisco-routerA
set service telnet
 
line vty 0 4
  no login
edit system login user vyatta
  set authentification plaintext-password
enable secret password
 
set service dhcp-server shared-network-name mydhcp
edit service dhcp-server shared-network-name mydhcp
  set subnet 10.0.2.0/24
  set subnet 10.0.1.0/24
  edit subnet 10.0.1.0/24
    dns-server 10.0.2.3
    default-router 10.0.1.2
    set start 10.0.1.200 stop 10.0.1.210
    set start 10.0.1.212 stop 10.0.1.222

 
 
service dhcp
 
ip dhcp pool mydhcp
 
 
  network 10.0.1.0 255.255.255.0
 
  dns-server 10.0.2.3
  default-router 192.168.1.1
 
 
ip dhcp excluded-address 10.0.1.0 10.0.1.199
ip dhcp excluded-address 10.0.1.223 10.0.1.255
ip dhcp excluded-address 10.0.1.211
set protocols static route 0.0.0.0/0 next-hop 10.0.2.2
 
ip route 0.0.0.0 0.0.0.0 10.0.2.2
 
 
VYATTA ROUTER B VC2.2 Aug 30, 2007
See the entire configuration
 
CISCO ROUTER B 2621 IOS: 12.4(16)
See the entire configuration
 
edit interfaces ethernet eth0
  set address 10.0.1.2 prefix-length 24
interface FastEthernet0/0
  ip address 10.0.1.2 255.255.255.0
edit interfaces ethernet eth1
  set address 10.0.2.2 prefix-length 24
interface FastEthernet0/1
  ip address 10.0.2.2 255.255.255.0
set system host-name Vyatta-RouterB hostname Cisco-routerB
set service telnet
 
line vty 0 4
  no login
edit system login user vyatta
  set authentification plaintext-password
enable secret password
 
edit service dhcp-relay
  set server 10.0.2.1
set service dhcp-relay interface eth0
set service dhcp-relay interface eth1
ip helper-address 10.0.2.1
  
  
 
DESKTOP:

To force a dhcp renewal:

Linux: dhclient eth0
Windows:
Start -> Run -> cmd
ipconfig /renew


4. SHOW COMMANDS & PACKET ANALYSIS:

1. VYATTA CASE STUDY 2. CISCO CASE STUDY



1. VYATTA CASE STUDY

Vyatta_Router>show version

Baseline Version: vc2-2
Built by: root@vyatta.com
Built on: Thu Aug 23 20:41:03 UTC 2007
Build ID: aa2e45f-1a45b2b-518c9cc-a9aa9f8-4c29b36-6890d5d-200708232041

Cisco-Router#show dhcp leases

IP address Hardware Address Lease expiration Pool Client Name
------------ ------------------- --------------------- ------- -------------
10.0.1.222 00:99:88:77:66:55 2007/09/11 23:59:46 mydhcp Client_Laptop

Cisco-Router#show dhcp statistics

Total DHCP requests for all pools: 11      
Total DHCP responses for all pools: 3      
         
pool   pool size # leased # avail
-----   -------- -------- ------
mydhcp   0 1 -1

Cisco-RouterA#show route

0.0.0.0/0 [static(1)] > to 10.0.2.2 via eth0
10.0.2.0/24 [connected(0)] > to 10.0.2.1 via eth0
127.0.0.0/8 [connected(0)] > to 127.0.0.1 via lo

Cisco-RouterB#show dhcp statisctics

dhcp server is not running

Cisco-RouterB#show route

10.0.1.0/24 [connected(0)] > to 10.0.1.2 via eth0
10.0.2.0/24 [connected(0)] > to 10.0.2.2 via eth1
127.0.0.0/8 [connected(0)] > to 127.0.0.1 via lo

PACKETS ANALYSIS:

Wireshark (on the Desktop) and TCPdump (on the Vyatta routers) are used to capture packets during the DHCP IP address request process.

Desktop: (DHCP client)

The capture above shows clearly the DHCP operations four steps process:

- DHCP Discover:
- DHCP Offer:

- DHCP Request:

- DHCP Acknowledgement:
 
The client broadcasts to find a DHCP server.
The server sends an unicast message to the client with an IP address.
The client broadcasts to say to potential other DHCP servers that it received an IP address.
The server sends an unicast message to the client with optional settings such as the default gateway.
It is interesting to notice, in case you need to set firewall rules, that the packets sent from the client use UDP source port 68 and UDP destination port 67. When sent back from the server to the client, they use UDP source port 67 and UDP destination port 68.

Vyatta-RouterA:
(DHCP server)
tcpdump -n port 67

IP 10.0.2.2.67 > 10.0.2.1.67: BOOTP/DHCP, Request from 00:99:88:77:66:55, length 300
IP 10.0.2.1.67 > 10.0.1.2.67: BOOTP/DHCP, Reply, length 300
IP 10.0.2.2.67 > 10.0.2.1.67: BOOTP/DHCP, Request from 00:99:88:77:66:55, length 329
IP 10.0.2.1.67 > 10.0.1.2.67: BOOTP/DHCP, Reply, length 300

Vyatta-RouterB: (DHCP relay)

tcpdump -n port 67

IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:99:88:77:66:55, length 300
IP 10.0.1.2.67 > 10.0.1.222.68: BOOTP/DHCP, Reply, length 300
IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:99:88:77:66:55, length 329
IP 10.0.1.2.67 > 10.0.1.222.68: BOOTP/DHCP, Reply, length 300


Top of the page      Show Commands menu



2. CISCO CASE STUDY

Cisco-RouterA#show ip route

Gateway of last resort is 10.0.2.2 to network 0.0.0.0

      10.0.0.0/24 is subnetted, 1 subnets
C         10.0.2.0 is directly connected, FastEthernet0/0
S*   0.0.0.0/0 [1/0] via 10.0.2.2
Cisco-RouterA#show ip dhcp binding

IP address
 
Client-ID/
Hardware address
Lease expiration
 
Type
 
10.0.1.200 0100.9988.7766.55 Mar 02 1993 12:45 AM Automatic
Cisco-RouterA#show ip dhcp server statistics

Memory usage 13393
Address pools 1
Database agents 0
Automatic bindings 1
Manual bindings 0
Expired bindings 0
Malformed messages 0
   
Message Received
BOOTREQUEST 0
DHCPDISCOVER 7
DHCPREQUEST 9
DHCPDECLINE 0
DHCPRELEASE 6
DHCPINFORM 0
   
Message Sent
BOOTREPLY 0
DHCPOFFER 7
DHCPACK 8
DHCPNAK 1
Cisco-RouterB#show ip route

Gateway of last resort is not set

      10.0.0.0/24 is subnetted, 2 subnets
C         10.0.2.0 is directly connected, FastEthernet0/1
C         10.0.1.0 is directly connected, FastEthernet0/0

PACKETS ANALYSIS:

Wireshark (on the Desktop) and TCPdump (on the Vyatta routers) are used to capture packets during the DHCP IP address request process.

Desktop client: (DHCP client)

The capture above shows clearly the DHCP operations four steps process:

- DHCP Discover:
- DHCP Offer:

- DHCP Request:

- DHCP Acknowledgement:
 
The client broadcasts to find a DHCP server.
The server sends an unicast message to the client with an IP address.
The clients broadcast to say to potential other DHCP servers that it received an IP address.
The server sends an unicat message to the client with optional settings such as the default gateway.
It is interesting to notice, in case you need to set firewall rules, that the packets sent from the client uss UDP source port 68 and UDP destination port 67. When sent back from the server to the client, they use UDP source port 67 and UDP destination port 68.

Cisco-RouterA: (DHCP Server)

#debug ip dhcp server packety

DHCPD: DHCPDISCOVER received from client 0100.9988.7766.55 through relay 10.0.1.2.
DHCPD: Sending DHCPOFFER to client 0100.9988.7766.55 (10.0.1.200).
DHCPD: unicasting BOOTREPLY for client 0099.8877.6655 to relay 10.0.1.2.
DHCPD: DHCPREQUEST received from client 0100.9988.7766.55.
DHCPD: Sending DHCPACK to client 0100.9988.7766.55 (10.0.1.200).
DHCPD: unicasting BOOTREPLY for client 0099.8877.6655 to relay 10.0.1.2.


The "01" characters before the MAC address represent the Ethernet media type.

Cisco-RouterB: (DHCP Relay)

#debug ip dhcp server packety

DHCPD: setting giaddr to 10.0.1.2.
DHCPD: BOOTREQUEST from 0100.9988.7766.55 forwarded to 10.0.2.1.
DHCPD: forwarding BOOTREPLY to client 0099.8877.6655.
DHCPD: creating ARP entry (10.0.1.200, 0099.8877.6655).
DHCPD: unicasting BOOTREPLY to client 0099.8877.6655 (10.0.1.200).
DHCPD: Finding a relay for client 0100.9988.7766.55 on interface FastEthernet0/0.
DHCPD: setting giaddr to 10.0.1.2.
DHCPD: BOOTREQUEST from 0100.9988.7766.55 forwarded to 10.0.2.1.
DHCPD: forwarding BOOTREPLY to client 0099.8877.6655.
DHCPD: creating ARP entry (10.0.1.200, 0099.8877.6655).
DHCPD: unicasting BOOTREPLY to client 0099.8877.6655 (10.0.1.200).


Top of the page      Show Commands menu