VYATTA - Semplice guida - Caso Studio 7 - DHCP

Vyatta Case 7 - DHCP
Last Update: Mar 14 2008


Tool
Install
Ergonomy
Forum



Details Cosa è Vyatta?
Screenshots
Prerequisiti
Tutorial Vyatta
Confronto comandi Vyatta & Cisco
Vyatta/Cisco/Quagga confronto (sezione Quagga)
Caso Studio 1 - Static routes (VC 2.0)
Caso Studio 2 - OSPF simple (VC 2.0)
Caso Studio 3 - OSPF advanced (VC 2.0)
Caso Studio 4 - BGP (VC 3.0)
Caso Studio 5 - VRRP (VC 2.2)
Caso Studio 6 - NAT (VC 2.0)
Caso Studio 7 - DHCP (VC 2.2)
Caso Studio 8 - IPSec (VC 2.2)
Caso Studio 9 - Packages (VC 3.0)
Caso Studio 10 - Bridging (VC 3.0)
Caso Studio 11 - CDP (VC 3.0)

Italian translation by Giovanni Fredducci.



⚠️⚠️⚠️
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. CASO STUDIATO 2. FIGURA 3. CONFIGURAZIONE 4. COMANDI


1.CASO STUDIATO

Vyatta versione: VC 2.2 Aug 30, 2007
DHCP (Dynamic Host Configuration Protocol), è un protocollo usato dai computers che assolvono la funzione di client, ed ottengono un indirizzo IP dal computer server.
Inoltre il computer server offre parametri di rete opzionali come il subnet mask, il gateway ed anche i DNS.
La richiesta di un IP parte da client con un messaggio di broadcasts nella local subnet per trovare un DHCP servers.
Di regola, I routers non passano il messaggio di broadcast ma possono essere configurati per rilasciare l’indirizzo IP, cioè essere un DHCP server.
I routers configurati per passare il messaggio di broadcast del client fanno un DHCP relay.

Controlla la sezione “analisi dei pacchetti” per avere maggiori informazioni sulle operazioni di richiesta DHCP.


2. FIGURA

vyatta cisco case study VRRP   vyatta cisco case study VRRP Functionalità testate:

(clicka sul web links per avere più dettagli sui protocolli)

Interface settings
Telnet access
DHCP server
DHCP relay
 
 
 
 
 
 
 
 
 
 
 
 
 
 


3. CONFIGURAZIONE

VYATTA ROUTER A VC2.2 Aug 30, 2007
Vedi l’intera configurazione
 
CISCO ROUTER A 2621 IOS: 12.2(23a)
Vedi l’intera configurazione
 
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
Vedi l’intera configurazione
 
CISCO ROUTER B 2621 IOS: 12.4(16)
Vedi l’intera configurazione
 
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:

Forzare il rinnovo dhcp:

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


4. MOSTRA COMANDI & ANALISI Dei PACCHETTI:

1. VYATTA CASO STUDIO 2. CISCO CASO STUDIO



1. VYATTA CASO STUDIO

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

ANALISI PACCHETTI:

Wireshark (sul Desktop) e TCPdump (sul routers Vyatta ) sono usati per catturare I pacchetti durante la richiesta di IP tramite DHCP.

Desktop: (DHCP client)

I pacchetti catturati mostrano chiaramente i quattro passi per otternere un IP da DHCP server:

- DHCP Discover:
- DHCP Offer:

- DHCP Request:

- DHCP Acknowledgement:
 
Il client broadcasts per trovare un DHCP server.
Il server manda un messaggio di unicast al client con l’indirizzo IP.
Il client broadcasts e dice agli altri potenziali DHCP server che ha ricevuto un indirizzo IP.
Il server invia un messaggio unicast al client con parametric opzionali come ad esempio il gateway.
Da notare che se si configure una regola sul firewall che I pacchetti mandate dal client sulla porta sorgente 68 UDP e la porta di destinazione 67 UDP, quando sarà mandata la risposta dal server al client andranno usate le porte sorgente 67 UDP e la portad i destinazione 68 UDP.

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


Inizio pagina      “Mostra Comandi” menu



2. CISCO CASO STUDIO

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

ANALISI PACCHETTI:

Wireshark (sul Desktop) e TCPdump (sul routers Vyatta ) sono usati per catturare I pacchetti durante la richiesta di IP tramite DHCP.

Desktop client: (DHCP client)

I pacchetti catturati mostrano chiaramente i quattro passi per otternere un IP da DHCP server:

- DHCP Discover:
- DHCP Offer:

- DHCP Request:

- DHCP Acknowledgement:
 
Il client broadcasts per trovare un DHCP server.
Il server manda un messaggio di unicast al client con l’indirizzo IP.
Il client broadcasts e dice agli altri potenziali DHCP server che ha ricevuto un indirizzo IP.
Il server invia un messaggio unicast al client con parametric opzionali come ad esempio il gateway.
Da notare che se si configure una regola sul firewall che I pacchetti mandate dal client sulla porta sorgente 68 UDP e la porta di destinazione 67 UDP, quando sarà mandata la risposta dal server al client andranno usate le porte sorgente 67 UDP e la portad i destinazione 68 UDP.

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.


Il "01" carattere prima del MAC address rappresenta il tipo di Ethernet .

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).


Inizio pagina      “Mostra Comandi” menu