# PXE & NFS with Microsoft DHCP



## pacija (May 24, 2012)

Dear forum members,

I am trying to boot FreeBSD 9.0 i386, as described in handbook: PXE & NFS

My setup is different in a way that I have Windows 2008 R2 DHCP server, which I am not in a situation to replace. I am successfully getting PXE loader from TFTP, but i can not mount root from NFS. I think the problem is related to the fact that loader does not respect DHCP option "017 Root Path" (Windows name for option root-path). No matter what *I* put there *I* get the following line in bootstrap loader:


```
pxe_open: server path: /
```

If *I* export / over NFS isntead of /b/tftpboot/FreeBSD/install/ boot process continues but ends up in single user mode (of course as it can't mount devices from host system fstab etc).

At first *I* thought that Microsoft DHCP does not send the value at all but it does:


```
15:46:49.505748 IP (tos 0x0, ttl 128, id 6066, offset 0, flags [none], proto: UDP
(17), length: 392) dhcp.domain.tld.67 > 255.255.255.255.68: [bad udp cksum 4537!]
BOOTP/DHCP, Reply, length 364, xid 0xdcdb5309, Flags [ none ] (0x0000)
          Your-IP 192.168.218.32
          Server-IP dhcp.domain.tld
          Client-Ethernet-Address 00:19:db:db:53:09 (oui Unknown)
          file "FreeBSD/install/boot/pxeboot"
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Offer
            Subnet-Mask Option 1, length 4: 255.255.255.0
            RN Option 58, length 4: 345600
            RB Option 59, length 4: 604800
            Lease-Time Option 51, length 4: 691200
            Server-ID Option 54, length 4: dhcp.domain.tld
            Default-Gateway Option 3, length 4: gate.domain.tld
            Domain-Name-Server Option 6, length 4: dhcp.domain.tld
            Domain-Name Option 15, length 1: "^@"
            RP Option 17, length 42: "192.168.218.32:/b/tftpboot/FreeBSD/install/^@"
            BF Option 67, length 29: "FreeBSD/install/boot/pxeboot^@"
```

I tried option 17 with IP address and without it also random strings, but *I* always get server path / in loader.

Any help would be appretiated.


----------



## SirDice (May 24, 2012)

I think it might be tripping on the ^@ at the end. Windows ends lines with a CR + LF whereas unix only uses a CR.


----------



## pacija (May 24, 2012)

Thank you for looking into it SirDice. Any idea how to overcome it?

I also noticed that gateway ip address is not set correctly:


```
pxe_open: gateway ip: 0.0.0.0
```


----------



## SirDice (May 24, 2012)

The default gateway is probably easy. Looking at the dump it shows a FQDN hostname (Option 3), not an IP address.


----------



## pacija (May 25, 2012)

I've set it to IP address, it probably resolves it and sends FQDN. Anyway that wouldn't be much of a problem as both server and clients are on the same LAN.


----------



## sakkaba (Jun 8, 2012)

Using a Windows DHCP server is a bad idea. The developers of this server can not read, in particular the RFC2132 paragraphs 3.1 and 3.2.


----------



## sakkaba (Jun 8, 2012)

Sorry, wrong: RFC2132 paragraph *3.19*


----------



## pacija (Jun 17, 2012)

As I said at the beginning of the thread:



			
				pacija said:
			
		

> ...I have Windows 2008 R2 DHCP server, which I am not in a situation to replace...


----------



## wblock@ (Jun 17, 2012)

If the Microsoft DHCP server is not standards-compliant or, more likely, complies with only a Microsoft "standard", then there are only two ways to go:

1. Ask Microsoft how to get their product to work with others.
2. Modify the FreeBSD pxeboot to work around it.

#2 is the one more likely to get useful results.


----------



## pacija (Jun 18, 2012)

I asked the same question on the freebsd-hackers mailing list. It appears that Microsoft DHCP won't send the root path (option 17) unless explicitly asked for by the client, as opposed to ISC-DHCP, which sends it by default to the PXEClient vendor class:


```
match if substring (option vendor-class-identifier, 0, 7) = "PXEClient";
        # removing windows specific options to save space for FreeBSD;
        default dhcp-parameter-request-list 1, 3, 6, 12, 15, 17, 23, 28, 29, \
        31, 33, 40, 41, 42, 144, 150, 208, 209, 210, 211, 230, 60, 43;
```

Now, as for the two ways you suggest wblock@:

I will have to find a way how to make Microsoft DHCP aware that the client is a PXEClient, and instruct it to send the root path option. So far no luck with searching. Hopefully *I* will not have to sign up to Microsoft forums. If anyone knows how to do this please give me a hint.
In the meantime *I* would like to configure FreeBSD pxeboot to set the path statically. Unfortunately *I* do not have enough knowledge on how to do it. I would be grateful if someone gave me a hint, or even better paste me the lines.


----------



## sakkaba (Jun 19, 2012)

RFC-2132:


> ```
> Options containing NVT ASCII data SHOULD NOT include a trailing NULL
> 
> 3.19. Root Path
> ...



HEX-DUMP DHCP-OFFER:

isc-dhcp-server:


```
73 74 61 6c 6c 2f 62 73 64 2f ff
```

MS DHCP:


```
65 62 6f 6f 74 [B]00[/B] ff
```



			
				pacija said:
			
		

> It appears that Microsoft DHCP won't send the root path (option 17) unless explicitly asked for by the client



It's wrong.

You can install freebsd FreeBSD (ISC-DHCP + NSF-s*er*ver) in the HYPER-V and get to work on a different subnet to service PXE clients (if that's possible).


----------

