Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Oct 2022 17:52:08 +1100
From:      Graham Menhennitt <graham@menhennitt.com.au>
To:        freebsd-ports@freebsd.org
Subject:   dnsmasq pushing static route over DHCP
Message-ID:  <fea99e08-abf0-62a0-d61b-887a7e1cc35e@menhennitt.com.au>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------xBCWpUcAGqkfFy6wqyxwIlPC
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hello all,

I have a machine running dnsmasq to provide DNS and DHCP services to my 
small network. All machines are running FreeBSD 13-stable as of a week 
ago. Dnsmasq is installed from the port and is version 2.87.

I use DHCP options to push the default route to the clients. The 
relevant bit of my dnamasq.conf is:

dhcp-authoritative
dhcp-range=igb0,XXX.2.73.10,XXX.2.73.99,255.255.255.128,12h
dhcp-option=option:router,XXX.2.73.1

That all works correctly.

# route get default
   route to: default
destination: default
       mask: default
    gateway: XXX.2.73.1

Now I would also like to push a static route to clients to give them 
access to another network which is connected via OpenVPN. I've added the 
DHCP option 121:

dhcp-option=option:classless-static-route,XXX.3.73.0/24,XXX.2.73.2

That adds the new static route correctly. But it breaks the default route.

# route get XXX.3.73.1
   route to: XXX.3.73.1
destination: XXX.3.73.0
       mask: 255.255.255.0
    gateway: XXX.2.73.2

# route get default
route: route has not been found

I've tried just "option:static-route" instead (option 33). But that 
doesn't appear to work at all.

Can somebody please give me some clues. I'll happily admit that I don't 
know what I'm doing!

Thanks in advance.

Graham

--------------xBCWpUcAGqkfFy6wqyxwIlPC
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello all,</p>
    <p>I have a machine running dnsmasq to provide DNS and DHCP services
      to my small network. All machines are running FreeBSD 13-stable as
      of a week ago. Dnsmasq is installed from the port and is version
      2.87.</p>
    <p>I use DHCP options to push the default route to the clients. The
      relevant bit of my dnamasq.conf is:</p>
    <p><span style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;">dhcp-authoritative
        </span></span><br>
      <span style="font-family:monospace">dhcp-range=igb0,XXX.2.73.10,XXX.2.73.99,255.255.255.128,12h
      </span><br>
      <span style="font-family:monospace">dhcp-option=option:router,XXX.2.73.1
        <br>
      </span></p>
    <p>That all works correctly.</p>
    <p><span style="font-family:monospace"><span
          style="font-family:monospace"><span
            style="color:#000000;background-color:#ffffff;"># route get
            default
          </span><br>
            route to: default
          <br>
          destination: default
          <br>
                mask: default
          <br>
             gateway: XXX.2.73.1<br>
          <br>
        </span></span>Now I would also like to push a static route to
      clients to give them access to another network which is connected
      via OpenVPN. I've added the DHCP option 121:
    </p>
    <p><span style="font-family:monospace">dhcp-option=option:classless-static-route,XXX.3.73.0/24,XXX.2.73.2</span><br>
      <span style="font-family:monospace"></span><span
        style="font-family:monospace">
        <br>
      </span>That adds the new static route correctly. But it breaks the
      default route.<span style="font-family:monospace"><br>
      </span></p>
    <p><span style="font-family:monospace"># route get XXX.3.73.1
        <br>
          route to: XXX.3.73.1
        <br>
        destination: XXX.3.73.0
        <br>
              mask: 255.255.255.0
        <br>
           gateway: XXX.2.73.2<br>
      </span><br>
      <span style="font-family:monospace"><span
          style="font-family:monospace"><span
            style="color:#000000;background-color:#ffffff;"># route get
            default            </span><br>
          route: route has not been found
          <br>
        </span></span></p>
    <p><span style="font-family:monospace"><span
          style="font-family:monospace"></span></span>I've tried just
      "option:static-route" instead (option 33). But that doesn't appear
      to work at all.</p>
    <p>Can somebody please give me some clues. I'll happily admit that I
      don't know what I'm doing!</p>
    <p>Thanks in advance.</p>
    <p>Graham<br>
    </p>
  </body>
</html>

--------------xBCWpUcAGqkfFy6wqyxwIlPC--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?fea99e08-abf0-62a0-d61b-887a7e1cc35e>