dhcp option 82

Answered Question
Jan 29th, 2009
User Badges:
  • Bronze, 100 points or more

Hi every body!

I understand what is option 82 in dhcp but why do we need it ?

Correct Answer by Edison Ortiz about 8 years 5 months ago


The link that I provided has the following:


To solve this problem, a relay agent residing at the switch inserts the relay information option (option 82), which carries information specific to the port


I don't know the field being used. I guess the only way to find out is to sniff the packet.


 

Correct Answer by Edison Ortiz about 8 years 5 months ago


My question is can we assign ip addreses  from same subnet  to two interface(SVI , one for vlan 1 and the other for vlan 2) on the same switch?


You could have 2 IP addresses under the SVI belonging to 2 IP subnets.


interface vlan 1


ip address 192.168.1.1 255.255.255.0


ip address 192.168.2.1 255.255.255.0 secondary


 


When a client on Vlan 1 sends a DHCP request, the giaddr will be of 192.168.1.1 but with the addition of Option 82, the DHCP server can differenciate if the client will belong to 192.168.2.0 or 192.168.1.0 subnet


 


HTH,


 


__


 


Edison.


 

Correct Answer by Edison Ortiz about 8 years 5 months ago

Is option 42 only used in such cases like above?


Option 82, yes :)


Your understanding is correct.

Correct Answer by Edison Ortiz about 8 years 5 months ago

The portion of the document explains one condition for using Option 82


http://www.cisco.com/en/US/docs/ios/12_3t/12_3t4/feature/guide/gdhcpopt.html#wp1054619


HTH,


__


Edison.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (4 ratings)
Loading.
sarahr202 Thu, 01/29/2009 - 21:42
User Badges:
  • Bronze, 100 points or more

HI Edison !

Just want to confirm my understanding.

Let say we have dhcp server with address pools

pool 1: 1.0.0.0/8


pool 2: 2.0.0.0/8


dhcp server--------sw-----hosts

Sw is acting as relay agent for vlan 1 which uses subnet 1.0.0.0/8 and vlan 2 which uses subnet 2.0.0.0/24.

Relay agent has ip address 1.1.1.2/24 (for vlan 1)

Relay agent has ip adress 2.2.2.2/24 (for vlan 2).


when dhcp receives dhcp discover message, it will look at giaddr feild to determine which pool to use.

Is it correct understanding?


The best design practise dictates one-to-correspondence between vlan and subnet.


In the forwarded link, two vlans are using the same subnet . Is option 42 only used in such cases like above?


Thanks a lot!

Correct Answer
Edison Ortiz Fri, 01/30/2009 - 06:34
User Badges:
  • Super Bronze, 10000 points or more
  • Hall of Fame,

    Founding Member

Is option 42 only used in such cases like above?


Option 82, yes :)


Your understanding is correct.

sarahr202 Fri, 01/30/2009 - 19:28
User Badges:
  • Bronze, 100 points or more


 Thanks a lot Edison!

sarahr202 Sat, 01/31/2009 - 07:19
User Badges:
  • Bronze, 100 points or more


 


Hi  Edison !


A just one more question.


 according to your link, DHCP server normally look at giaddr feild to determine the  range  to assign the ip address. In a example. two vlans v1 and v2 are on same same subnet. So when dhcp  server receives dhcp message it coud not figure it out which ip address range to use becuase giaddr in both dhcp messages show the ip addresses from the same subnet. . My question is can we assign ip addreses  from same subnet  to two interface(SVI , one for vlan 1 and the other for vlan 2) on the same switch?


Thanks a lot!


 

Correct Answer
Edison Ortiz Sat, 01/31/2009 - 11:13
User Badges:
  • Super Bronze, 10000 points or more
  • Hall of Fame,

    Founding Member


My question is can we assign ip addreses  from same subnet  to two interface(SVI , one for vlan 1 and the other for vlan 2) on the same switch?


You could have 2 IP addresses under the SVI belonging to 2 IP subnets.


interface vlan 1


ip address 192.168.1.1 255.255.255.0


ip address 192.168.2.1 255.255.255.0 secondary


 


When a client on Vlan 1 sends a DHCP request, the giaddr will be of 192.168.1.1 but with the addition of Option 82, the DHCP server can differenciate if the client will belong to 192.168.2.0 or 192.168.1.0 subnet


 


HTH,


 


__


 


Edison.


 

sarahr202 Sat, 01/31/2009 - 12:50
User Badges:
  • Bronze, 100 points or more


HI Edison!


According to RFC relay option 82, there are two possibles sub options:


 


The initial assignment of DHCP Relay Agent Sub-options is as follows:

DHCP Agent Sub-Option Description
Sub-option Code
--------------- ----------------------
1 Agent Circuit ID Sub-option
2 Agent Remote ID Sub-option


Circuit id is port or interface on the switch


Remote Id:


Let me quote from rfc


 


This sub-option MAY be added by DHCP relay agents which terminate
switched or permanent circuits and have mechanisms to identify the
remote host end of the circuit. The Remote ID field may be used to
encode, for instance:

-- a "caller ID" telephone number for dial-up connection
-- a "user name" prompted for by a Remote Access Server
-- a remote caller ATM address
-- a "modem ID" of a cable data modem
-- the remote IP address of a point-to-point link
-- a remote X.25 address for X.25 connections


MY question is what switch will put in remote id feild so dhcp could find out the range to use


 


Thanks a lot!

Correct Answer
Edison Ortiz Sat, 01/31/2009 - 13:14
User Badges:
  • Super Bronze, 10000 points or more
  • Hall of Fame,

    Founding Member


The link that I provided has the following:


To solve this problem, a relay agent residing at the switch inserts the relay information option (option 82), which carries information specific to the port


I don't know the field being used. I guess the only way to find out is to sniff the packet.


 

sarahr202 Sat, 01/31/2009 - 14:44
User Badges:
  • Bronze, 100 points or more


Thanks Edison and  I admire your honesty and patience. The only way i would pay you back is to to be equally patient and honest with anyone who is starting in this feild like me.


Here is  guess ( got no equipment to verify that though)


Let say dhcp server has two range.


range 1   192.192.192.1-------192.192.192.99


range 2   192.192.192.100----192.192.192.254


 


A layer 3 switch has two vlans vlan 1 and vlan 2 both use the same subnet.


switch  svi for vlan 1 should be configured as


 int svi 1


ip address 192.192.192. 1 25.255.255.0


ip address 192.192.192. 101 255.255.255.0 secondary


Now the question is we could assign the ip address  as a secondary ip from the range 1 for example 192.192.192.2  but then dhcp would not be able to determine the  range for dhcp request message received from vlan 2 ' hosts


My hunch is Giaddr would be set  to ip address 192.192.192.1 and in sub-option feild ,remote id, set the ip address 192.192.192.101. This will  accour when switch receives the dhcp request message on its secondary ip address 192.192.192.101.


When  switch receives the dhcp request from vlan 1's host on its 192.192.192.1, switch set the remote id feild  to 192.192.192.1.


Now  when dhcp receives the dhcp message, it will check the remote id sub option to determine the range.


Thats also means we must make sure the switch has ip addreses from both range on its svi interface.


 


What  is your opinion?


By the way, how many secondary addressses can be configured under single interface?


 


thanks a lot!


 

Edison Ortiz Sat, 01/31/2009 - 18:41
User Badges:
  • Super Bronze, 10000 points or more
  • Hall of Fame,

    Founding Member


Your hunch may be correct but I have no way to verify it at this moment.


BTW, your SVI configuration is a bit flawed :) Those 2 addresses are part of the same subnet.


As for how many secondary addresses can be configured, the documentation says it's unlimited.


http://www.cisco.com/en/US/docs/ios/ipaddr/command/reference/iad_ip.html#wp1011130


 


HTH,


__


 


Edison.

sarahr202 Sat, 01/31/2009 - 21:59
User Badges:
  • Bronze, 100 points or more


HI Edison !


According to your first link, you forwarded to me , the scenario was as foolows.


 A switch has two clients .   One client is connected to port in vlan 1 and the other  client is connected to a port in vlan 2.  Both these vlans are on the same subnet. There are two address range from the same subnet. One vlan 1 is  used to one range the other vlan 2 will use the other range.


Usually, dhcp will look at giaddr feild  to determine the range but here the giaddr is same.


The question  how could we assign two ip addresses from the same subnet  to two svi i.e one for svi1 and one for svi 2?


OPtion # !


We can not assign ip addresses from the same subnet to two int on same switch. Each interface requires  seperate subnet.


option # 2


we can assign  two ip addresses from the same subnet to one interface using " secondary" option.


int svi 1


199.199.199.1  255.255.255.0 ( should be  from first range)


199.199.199.101 255.255.255.0 secondary  ( should be from second range)


I checked on my  2500 router. I find  i can configure two ip addresses on the same  int  from the same subnet using " secondary" option.


 


 


 Any input from you will be appreciated


thanks a lot!


 

Actions

This Discussion