Re: [OpenWrt-Devel] dnsmasq and --dhcp-relay option ?

2015-04-24 Thread Bruno Randolf
On 04/24/2015 02:26 PM, openwrt-de...@couprie.net wrote:
> The diff is for /etc/init.d/dnsmasq
> 
> This diff works for me, it puts the following change in
> /var/etc/dnsmasq.conf
> 
> dhcp-relay=192.168.200.1,10.255.255.225
> 
> What do i need to change to submit it as a patch ?

Look at https://dev.openwrt.org/wiki/SubmittingPatches

In short:

 - Base your patch on openwrt trunk, git or svn version.

 - Create the patch from the top directory or via "git diff" so it
includes the full path.

 - Add a Signed-off-by line

 - Send with [PATCH] as subject prefix

 - Be careful that your email program does not line-wrap or otherwise
modify the patch. Best to use "git send-email" directly...

Hope that helps,
bruno


> Comments are welome :-)
> 
> Perry
> 
> On 24-04-15 13:21, Kevin Darbyshire-Bryant wrote:
>> On 24/04/2015 11:17, Perry Couprie wrote:
>>> And something like this ?
>>>
>>> --- dnsmasq.orig2015-04-24 12:14:51.453093251 +0200
>>> +++ dnsmasq2015-04-24 12:15:15.121092827 +0200
>>> @@ -416,6 +416,10 @@
>>>  xappend
>>> "--dhcp-range=$networkid,$START,$END,$NETMASK,$leasetime${options:+
>>> $options}"
>>>  
>>>  dhcp_option_add "$cfg" "$networkid"
>>> +
>>> +config_get relay "$cfg" relay
>>> +network_get_ipaddr interface_ip "$networkid"
>>> +xappend "--dhcp-relay=$interface_ip,$relay"
>>>  }
>>>  
>>>  dhcp_option_add() {
>>>
>>> Perry
>>>
>> That syntax won't work in /etc/dnsmasq.conf - it only understands
>> dnsmasq options, not .init/uci script options which would then be
>> passed to dnsmasq by /var/etc/dnsmasq.conf.  If you were talking about
>> extending uci so that it understood additional dnsmasq options then
>> I'm afraid you're beyond my level of knowledge.  Stuff that uci
>> doesn't know about and is relatively static I've put into
>> /etc/dnsmasq.conf manually as /var/etc/dnsmasq.conf references
>> /etc/dnsmasq.conf for just such user customisation purposes.
>>
>> I hope that helps.
>>
>> Kevin
>>
>>
>>
>>> On 24-04-15 07:48, Kevin Darbyshire-Bryant wrote:
 Hi Perry,

 The /etc/dnsmasq.conf file is outside of uci control,  so it doesn't
 get rebuilt at process start/stop and gets preserved across
 reboots/upgrades.  It's an ideal place for tweaks and options that
 the uci interface is not yet aware.  I use it all the time.  Edit
 with your favourite text editor.

 Kevin


 -- 
 Cheers,

 ke...@darbyshire-bryant.me.uk 


 On 24 Apr 2015, at 00:10, Perry Couprie >>> > wrote:

> Can this be done by using uci commands ?
>
> Perry
>
> On 23-04-15 23:20, Kevin Darbyshire-Bryant wrote:
>> On 23/04/2015 21:55, openwrt-de...@couprie.net wrote:
>>> Hi,
>>>
>>> I need the dnsmasq --dhcp-relay option, how do i add this option
>>> to the dnsmasq script ?
>>>
>>> Perry
>>
>> You could edit '/etc/dnsmasq.conf' and add your option/s directly
>> to it.  Does that achieve your aim?
>>
>> Kevin
>>
>>
>> ___
>> openwrt-devel mailing list
>> openwrt-devel@lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
>>>
>>
> 
> 
> 
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] dnsmasq and --dhcp-relay option ?

2015-04-24 Thread openwrt-de...@couprie.net

The diff is for /etc/init.d/dnsmasq

This diff works for me, it puts the following change in 
/var/etc/dnsmasq.conf


dhcp-relay=192.168.200.1,10.255.255.225

What do i need to change to submit it as a patch ?

Comments are welome :-)

Perry

On 24-04-15 13:21, Kevin Darbyshire-Bryant wrote:

On 24/04/2015 11:17, Perry Couprie wrote:

And something like this ?

--- dnsmasq.orig2015-04-24 12:14:51.453093251 +0200
+++ dnsmasq2015-04-24 12:15:15.121092827 +0200
@@ -416,6 +416,10 @@
 xappend 
"--dhcp-range=$networkid,$START,$END,$NETMASK,$leasetime${options:+ 
$options}"


 dhcp_option_add "$cfg" "$networkid"
+
+config_get relay "$cfg" relay
+network_get_ipaddr interface_ip "$networkid"
+xappend "--dhcp-relay=$interface_ip,$relay"
 }

 dhcp_option_add() {

Perry

That syntax won't work in /etc/dnsmasq.conf - it only understands 
dnsmasq options, not .init/uci script options which would then be 
passed to dnsmasq by /var/etc/dnsmasq.conf.  If you were talking about 
extending uci so that it understood additional dnsmasq options then 
I'm afraid you're beyond my level of knowledge. Stuff that uci doesn't 
know about and is relatively static I've put into /etc/dnsmasq.conf 
manually as /var/etc/dnsmasq.conf references /etc/dnsmasq.conf for 
just such user customisation purposes.


I hope that helps.

Kevin




On 24-04-15 07:48, Kevin Darbyshire-Bryant wrote:

Hi Perry,

The /etc/dnsmasq.conf file is outside of uci control,  so it doesn't 
get rebuilt at process start/stop and gets preserved across 
reboots/upgrades.  It's an ideal place for tweaks and options that 
the uci interface is not yet aware.  I use it all the time.  Edit 
with your favourite text editor.


Kevin


--
Cheers,

ke...@darbyshire-bryant.me.uk 


On 24 Apr 2015, at 00:10, Perry Couprie > wrote:



Can this be done by using uci commands ?

Perry

On 23-04-15 23:20, Kevin Darbyshire-Bryant wrote:

On 23/04/2015 21:55, openwrt-de...@couprie.net wrote:

Hi,

I need the dnsmasq --dhcp-relay option, how do i add this option 
to the dnsmasq script ?


Perry


You could edit '/etc/dnsmasq.conf' and add your option/s directly 
to it.  Does that achieve your aim?


Kevin


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel








___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] dnsmasq and --dhcp-relay option ?

2015-04-24 Thread openwrt-de...@couprie.net

Could something likes this be added ?

--- dnsmasq.orig2015-04-24 12:14:51.453093251 +0200
+++ dnsmasq2015-04-24 12:15:15.121092827 +0200
@@ -416,6 +416,10 @@
 xappend 
"--dhcp-range=$networkid,$START,$END,$NETMASK,$leasetime${options:+ 
$options}"


 dhcp_option_add "$cfg" "$networkid"
+
+config_get relay "$cfg" relay
+network_get_ipaddr interface_ip "$networkid"
+xappend "--dhcp-relay=$interface_ip,$relay"
 }

 dhcp_option_add() {

Perry

On 23-04-15 23:20, Kevin Darbyshire-Bryant wrote:

On 23/04/2015 21:55, openwrt-de...@couprie.net wrote:

Hi,

I need the dnsmasq --dhcp-relay option, how do i add this option to 
the dnsmasq script ?


Perry


You could edit '/etc/dnsmasq.conf' and add your option/s directly to 
it.  Does that achieve your aim?


Kevin


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] dnsmasq and --dhcp-relay option ?

2015-04-23 Thread Kevin Darbyshire-Bryant
On 23/04/2015 21:55, openwrt-de...@couprie.net wrote:
> Hi,
>
> I need the dnsmasq --dhcp-relay option, how do i add this option to the 
> dnsmasq script ?
>
> Perry

You could edit '/etc/dnsmasq.conf' and add your option/s directly to it.  Does 
that achieve your aim?

Kevin


smime.p7s
Description: S/MIME Cryptographic Signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] dnsmasq and --dhcp-relay option ?

2015-04-23 Thread openwrt-de...@couprie.net

Hi,

I need the dnsmasq --dhcp-relay option, how do i add this option to the 
dnsmasq script ?


Perry

--dhcp-relay=,[,dnsmasq to do DHCP relay. The local address is an address allocated to 
an interface on the host running dnsmasq. All DHCP requests arriving on 
that interface will we relayed to a remote DHCP server at the server 
address. It is possible to relay from a single local address to multiple 
remote servers by using multiple dhcp-relay configs with the same local 
address and different server addresses. A server address must be an IP 
literal address, not a domain name. In the case of DHCPv6, the server 
address may be the ALL_SERVERS multicast address, ff05::1:3. In this 
case the interface must be given, not be wildcard, and is used to direct 
the multicast to the correct interface to reach the DHCP server.


Access control for DHCP clients has the same rules as for the DHCP 
server, see --interface, --except-interface, etc. The optional interface 
name in the dhcp-relay config has a different function: it controls on 
which interface DHCP replies from the server will be accepted. This is 
intended for configurations which have three interfaces: one being 
relayed from, a second connecting the DHCP server, and a third untrusted 
network, typically the wider internet. It avoids the possibility of 
spoof replies arriving via this third interface.


It is allowed to have dnsmasq act as a DHCP server on one set of 
interfaces and relay from a disjoint set of interfaces. Note that whilst 
it is quite possible to write configurations which appear to act as a 
server and a relay on the same interface, this is not supported: the 
relay function will take precedence.


Both DHCPv4 and DHCPv6 relay is supported. It's not possible to relay 
DHCPv4 to a DHCPv6 server or vice-versa.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel