diff mbox

[OpenWrt-Devel] netifd: Request DHCP option 121 (classless route) by default

Message ID 1447803237-14107-1-git-send-email-baptiste@bitsofnetworks.org
State Superseded
Headers show

Commit Message

Baptiste Jonglez Nov. 17, 2015, 11:33 p.m. UTC
From: Baptiste Jonglez <git@bitsofnetworks.org>

This option is very useful when the gateway configured by DHCP cannot
be in the same subnet as the client.  This happens, for instance, when
using DHCP to hand out addresses in /32 subnets.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
---
 package/network/config/netifd/files/lib/netifd/proto/dhcp.sh | 2 ++
 1 file changed, 2 insertions(+)

Comments

Hans Dedecker Nov. 18, 2015, 9:32 a.m. UTC | #1
Hi,

It's not always desirable to request option 121 by default. Some ISPs
explicitly demand not to request option 121; therefore it's better to
specify the option explicitly in the reqopts parameter if needed.

Bye,
Hans

On Wed, Nov 18, 2015 at 12:33 AM, Baptiste Jonglez <
baptiste@bitsofnetworks.org> wrote:

> From: Baptiste Jonglez <git@bitsofnetworks.org>
>
> This option is very useful when the gateway configured by DHCP cannot
> be in the same subnet as the client.  This happens, for instance, when
> using DHCP to hand out addresses in /32 subnets.
>
> Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
> ---
>  package/network/config/netifd/files/lib/netifd/proto/dhcp.sh | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
> b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
> index 0e88af9..1eb8010 100755
> --- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
> +++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
> @@ -38,6 +38,8 @@ proto_dhcp_setup() {
>                 append dhcpopts "-x $opt"
>         done
>
> +       # Classless route option, see RFC 3442
> +       append dhcpopts "-O 121"
>         [ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
>         [ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" ||
> clientid="-C"
>         [ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
> --
> 1.9.1
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
Baptiste Jonglez Nov. 18, 2015, 10:11 a.m. UTC | #2
Hi,

On Wed, Nov 18, 2015 at 10:32:11AM +0100, Hans Dedecker wrote:
> It's not always desirable to request option 121 by default. Some ISPs
> explicitly demand not to request option 121;

Interesting, do you have any reference?  Reading RFC 2131 (especially the
end of section 4.3.1), it seems to me that a DHCP server that does not
know about option 121 will just ignore the request.

> therefore it's better to specify the option explicitly in the reqopts
> parameter if needed.

That's what we do right now, since our DHCP servers attribute addresses as
/32 subnets; however, it would be much easier if OpenWRT clients worked
out-of-the-box on our network.

> Bye,
> Hans

Thanks,
Baptiste

> On Wed, Nov 18, 2015 at 12:33 AM, Baptiste Jonglez <
> baptiste@bitsofnetworks.org> wrote:
> 
> > From: Baptiste Jonglez <git@bitsofnetworks.org>
> >
> > This option is very useful when the gateway configured by DHCP cannot
> > be in the same subnet as the client.  This happens, for instance, when
> > using DHCP to hand out addresses in /32 subnets.
> >
> > Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
> > ---
> >  package/network/config/netifd/files/lib/netifd/proto/dhcp.sh | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
> > b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
> > index 0e88af9..1eb8010 100755
> > --- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
> > +++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
> > @@ -38,6 +38,8 @@ proto_dhcp_setup() {
> >                 append dhcpopts "-x $opt"
> >         done
> >
> > +       # Classless route option, see RFC 3442
> > +       append dhcpopts "-O 121"
> >         [ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
> >         [ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" ||
> > clientid="-C"
> >         [ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
> > --
> > 1.9.1
> > _______________________________________________
> > openwrt-devel mailing list
> > openwrt-devel@lists.openwrt.org
> > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> >
Hans Dedecker Nov. 18, 2015, 10:28 a.m. UTC | #3
On Wed, Nov 18, 2015 at 11:11 AM, Baptiste Jonglez <
baptiste@bitsofnetworks.org> wrote:

> Hi,
>
> On Wed, Nov 18, 2015 at 10:32:11AM +0100, Hans Dedecker wrote:
> > It's not always desirable to request option 121 by default. Some ISPs
> > explicitly demand not to request option 121;
>
> Interesting, do you have any reference?  Reading RFC 2131 (especially the
> end of section 4.3.1), it seems to me that a DHCP server that does not
> know about option 121 will just ignore the request.
>
This is based on the request we get from ISPs when deploying in their
networks; DHCP servers have support for  option 121 but they don't want all
clients to ask for option 121 by default unless explicitly configured.
They want control over which routes they distribute to which clients by
config

Bye,
Hans


>
> > therefore it's better to specify the option explicitly in the reqopts
> > parameter if needed.
>
> That's what we do right now, since our DHCP servers attribute addresses as
> /32 subnets; however, it would be much easier if OpenWRT clients worked
> out-of-the-box on our network.
>
> > Bye,
> > Hans
>
> Thanks,
> Baptiste
>
> > On Wed, Nov 18, 2015 at 12:33 AM, Baptiste Jonglez <
> > baptiste@bitsofnetworks.org> wrote:
> >
> > > From: Baptiste Jonglez <git@bitsofnetworks.org>
> > >
> > > This option is very useful when the gateway configured by DHCP cannot
> > > be in the same subnet as the client.  This happens, for instance, when
> > > using DHCP to hand out addresses in /32 subnets.
> > >
> > > Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
> > > ---
> > >  package/network/config/netifd/files/lib/netifd/proto/dhcp.sh | 2 ++
> > >  1 file changed, 2 insertions(+)
> > >
> > > diff --git
> a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
> > > b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
> > > index 0e88af9..1eb8010 100755
> > > --- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
> > > +++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
> > > @@ -38,6 +38,8 @@ proto_dhcp_setup() {
> > >                 append dhcpopts "-x $opt"
> > >         done
> > >
> > > +       # Classless route option, see RFC 3442
> > > +       append dhcpopts "-O 121"
> > >         [ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
> > >         [ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" ||
> > > clientid="-C"
> > >         [ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
> > > --
> > > 1.9.1
> > > _______________________________________________
> > > openwrt-devel mailing list
> > > openwrt-devel@lists.openwrt.org
> > > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> > >
>
diff mbox

Patch

diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
index 0e88af9..1eb8010 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -38,6 +38,8 @@  proto_dhcp_setup() {
 		append dhcpopts "-x $opt"
 	done
 
+	# Classless route option, see RFC 3442
+	append dhcpopts "-O 121"
 	[ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
 	[ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
 	[ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"