cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7522
Views
0
Helpful
11
Replies

dhcp option 82

sarahr202
Level 5
Level 5

Hi every body!

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

4 Accepted Solutions

Accepted Solutions

Edison Ortiz
Hall of Fame
Hall of Fame

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.

View solution in original post

Is option 42 only used in such cases like above?

Option 82, yes :)

Your understanding is correct.

View solution in original post

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.

 

View solution in original post

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.


 

View solution in original post

11 Replies 11

Edison Ortiz
Hall of Fame
Hall of Fame

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.

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!

Is option 42 only used in such cases like above?

Option 82, yes :)

Your understanding is correct.

 Thanks a lot Edison!

 

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!

 

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.

 

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!

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.


 

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!

 

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.

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!

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card