<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:329144578;
        mso-list-type:hybrid;
        mso-list-template-ids:-553750510 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Shrew 2.2.2  / Windows 7 / DHCP over IPSec to Fortigate<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Problem:<o:p></o:p></p>
<p class="MsoNormal"><br>
My company is considering using Shrew as its VPN client.   For that to be viable, we need it to properly support DHCP over IPSec.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">However, using Shrew to connect to our Fortigate (FortiOS 5.0.9) firewall/vpn server using the DHCP over IPSEC feature fails.   The Fortigate, in this case, is NOT the actual DHCP server.  But rather it is configured to be a DHCP relay
 server.   When the Fortigate receives the DHCP discover packet from the client, it relays it to the actually DHCP server.   This part works for both Shrew and FortiClient.   In the case of a request originating from the Shrew client however, the DHCP server
 does not respond to the request. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">With the help of Fortinet engineers, we have determined the issue to be caused by the nature of the discover packet sent by Shrew client to the Fortigate.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">To our understanding, <o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-family:Symbol"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">        
</span></span></span><![endif]>Client originated DHCP discover packets should be from (client) port 68 to (broadcast) port 67, whereas<o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-family:Symbol"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">        
</span></span></span><![endif]>Relayed DHCP discover packets should be from (relay server) port 67 to (unicast dhcp server) port 67. 
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">When connecting with FortiClient, the client originated DHCP discover packet is, as described above, a broadcast from port 68 to port 67.<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:.5in"><o:p> </o:p></p>
<p class="MsoNormal">Capture of inbound DHCP Discover from client to Fortigate during FortiClient connection (using Fortigate “diag snif” CLI command):<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:.5in">In:  172.16.254.75.68 -> 255.255.255.255.67: udp 300<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">However, when connecting with Shrew from the same client, the client originated DHCP discover packet is a unicast from port 67 to port 67.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Capture of inbound DHCP Discover from client to Fortigate during Shrew connection attempt (using Fortigate “diag snif” CLI command):<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:.5in">In:  172.16.254.75.67 -> 63.149.110.40.67: udp 253<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:.5in"><o:p> </o:p></p>
<p class="MsoNormal">It is as if the Shrew client is, itself, trying to be a DHCP relay server and assuming the tunnel endpoint (the Fortigate in this case) is the actual DHCP server.  
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">In either case, the Fortigate relays the request to the DHCP server.  In the case of FortiClient connection, the DHCP Discover packet relayed by the Fortigate has the “Relay Agent IP Address” field in the bootp section set to the properly
 scoped Fortigate LAN facing IP address.    Whereas in the case of a Shrew client connection attempt, the “Relay Agent IP Address”  field is set to the client PC’s IP address (172.16.254.111) – which will never be properly scoped.  Hence the actual DHCP server
 does not reply.    Because of the format of the client DHCP discover packet (unicast 67 to 67), the Fortigate assumes the client is actually a relay server itself, and therefore leaves/sets the relay agent to the client’s address. 
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Fragment from Wireshark capture of DHCP discover packet relayed by the Fortigate during a FortiClient connection attempt:<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:.5in">Relay agent IP address: 135.22.247.253 (135.22.247.253)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Fragment from Wireshark capture of DHCP discover packet relayed by the Fortigate during Shrew connection attempt:<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:.5in">Relay agent IP address: 172.16.254.75 (172.16.254.75)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">My thought is that the DHCP packet sent from the Shrew client should properly be a broadcast from port 68 to port 67.  The Fortigate would then properly set the Relay agent IP address to its own address as it does in the FortiClient case.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">More detailed information (actual capture and debug logs) are available upon request.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Please advise.<o:p></o:p></p>
<p class="MsoNormal">Thanks<br>
Rich Mayer<o:p></o:p></p>
<p class="MsoNormal">LGS Innovations<o:p></o:p></p>
<p class="MsoNormal">336-279-3158<o:p></o:p></p>
</div>
</body>
</html>