cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3304
Views
0
Helpful
4
Replies

Switch hostname delivered by DHCP server

isaacalves27
Level 1
Level 1

Hello everyone

We are planning on using APIC-EM PnP on a near future to deploy some hundreds of switches on our network. Everything seems to be working as planned but in order to do a real zero touch deployment I am still missing the hostname configuration. 

The question is: as anyone tried to deliver hostname's to a switch from a DHCP server (Windows, IOS, linux)? Or maybe that is one of the things that it can not be achieved and that has to be configured by hand?

From the switch:
*Jan 2 00:01:38.015: DHCP: No configured hostname - not including Hostname option

...

May 11 11:54:43.368: %DHCP-6-ADDRESS_ASSIGN: Interface Vlan119 assigned DHCP address 172.31.110.20, mask 255.255.255.0, hostname 

I have tried DHCP option 12 bur rather then an information that is supposed to be delivered TO the device is a information that the DHCP server receives FROM the device.

Any clues?

Best regards

Isaac Alves 

4 Replies 4

Paul Chapman
Level 4
Level 4

Hi Isaac -

Option 12 should work, but you need to know the MAC address the switch is using so that your DHCP reservation (or fixed address) will work. The key to option 12 is it is bi-directional.  The client is going to send option 12 to the server, but the server can ignore it and send back a different name in the Offer packet.

Get a packet capture of the DHCP request packet.  Wireshark will show you all the options requested by the client, including vendor specific options. Option 55 lists the options that the client is willing to receive from the server.

I found an article on AutoInstall, a legacy deployment mechanism, which indicates that the config file delivered needs to contain a host entry and if no match is found the device will try a DNS reverse lookup.  Link to article.

PSC

Hello Paul

Thank you very much for helping us.

I have checked the packet request sendt and no option 12 is requested. I have changed the request sendt to use the management vlan mac add and that is working as supposed to but it seems like the switch is not requesting a option 12 so even though the option 12 is configured on the reservation the info about the hostname is not being sendt cause - as far as I can see - it is not being requested by the client.

Option 55 list bellow:

-----------------------------------------------------------------------------

Option: (55) Parameter Request List
Length: 8
Parameter Request List Item: (1) Subnet Mask
Parameter Request List Item: (6) Domain Name Server
Parameter Request List Item: (15) Domain Name
Parameter Request List Item: (44) NetBIOS over TCP/IP Name Server
Parameter Request List Item: (3) Router
Parameter Request List Item: (33) Static Route
Parameter Request List Item: (150) TFTP Server Address
Parameter Request List Item: (43) Vendor-Specific Information

---------------------------------------------------------------------------------------

Hi Isaac -

Here's a capture from a Windows machine I did a while back.  Notice that option 12 is not in the Parameter Request List.

Frame 2: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0
Ethernet II, Src: Vmware_8d:71:71 (00:0c:29:8d:71:71), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68 (68), Dst Port: 67 (67)
Bootstrap Protocol (Discover)
    Message type: Boot Request (1)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x7d7f389f
    Seconds elapsed: 0
    Bootp flags: 0x0000 (Unicast)
    Client IP address: 0.0.0.0
    Your (client) IP address: 0.0.0.0
    Next server IP address: 0.0.0.0
    Relay agent IP address: 0.0.0.0
    Client MAC address: Vmware_8d:71:71 (00:0c:29:8d:71:71)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (Discover)
    Option: (61) Client identifier
    Option: (50) Requested IP Address
    Option: (12) Host Name
    Option: (60) Vendor class identifier
    Option: (55) Parameter Request List
        Length: 12
        Parameter Request List Item: (1) Subnet Mask
        Parameter Request List Item: (15) Domain Name
        Parameter Request List Item: (3) Router
        Parameter Request List Item: (6) Domain Name Server
        Parameter Request List Item: (44) NetBIOS over TCP/IP Name Server
        Parameter Request List Item: (46) NetBIOS over TCP/IP Node Type
        Parameter Request List Item: (47) NetBIOS over TCP/IP Scope
        Parameter Request List Item: (31) Perform Router Discover
        Parameter Request List Item: (33) Static Route
        Parameter Request List Item: (121) Classless Static Route
        Parameter Request List Item: (249) Private/Classless Static Route (Microsoft)
        Parameter Request List Item: (43) Vendor-Specific Information
    Option: (255) End
    Padding: 00000000

On reflection, I don't think that Windows allows hostnames to be set by DHCP, so you may be onto something.  I suggest testing further.  Make sure that the Client MAC shown in your capture is what is in your DHCP reservation.

PSC

Hello Paul

Here is the complete request from the switch. Yeah I think that this can not be done - unless there is a way to change the information that the switch is willing to receive. The reservation is configured correctly cause the switch receives the ip address I have addressed on the reservation and not the first one on the range.

Any opinions?

Frame 170: 339 bytes on wire (2712 bits), 339 bytes captured (2712 bits) on interface 0
Ethernet II, Src: CiscoInc_f2:d7:41 (f8:c2:88:f2:d7:41), Dst: Vmware_08:cd:aa (00:0c:29:08:cd:aa)
Internet Protocol Version 4, Src: 172.31.110.1, Dst: 172.31.54.14
User Datagram Protocol, Src Port: 67 (67), Dst Port: 67 (67)
Bootstrap Protocol (Discover)
Message type: Boot Request (1)
Hardware type: Ethernet (0x01)
Hardware address length: 6
Hops: 1
Transaction ID: 0x00000423
Seconds elapsed: 0
Bootp flags: 0x8000, Broadcast flag (Broadcast)
Client IP address: 0.0.0.0
Your (client) IP address: 0.0.0.0
Next server IP address: 0.0.0.0
Relay agent IP address: 172.31.110.1
Client MAC address: CiscoInc_b7:5f:41 (6c:99:89:b7:5f:41)
Client hardware address padding: 00000000000000000000
Server host name not given
Boot file name not given
Magic cookie: DHCP
Option: (53) DHCP Message Type (Discover)
Length: 1
DHCP: Discover (1)
Option: (57) Maximum DHCP Message Size
Length: 2
Maximum DHCP Message Size: 1152
Option: (61) Client identifier
Length: 27
Option: (55) Parameter Request List
Length: 8
Parameter Request List Item: (1) Subnet Mask
Parameter Request List Item: (6) Domain Name Server
Parameter Request List Item: (15) Domain Name
Parameter Request List Item: (44) NetBIOS over TCP/IP Name Server
Parameter Request List Item: (3) Router
Parameter Request List Item: (33) Static Route
Parameter Request List Item: (150) TFTP Server Address
Parameter Request List Item: (43) Vendor-Specific Information
Option: (60) Vendor class identifier
Option: (255) End

Review Cisco Networking products for a $25 gift card