Re: [OpenWrt-Devel] [PATCH] [dnsmasq] support enforced start-IP, end-IP, netmask

2014-10-17 Thread Bastian Bittorf
* Jo-Philipp Wich j...@openwrt.org [15.10.2014 08:59]:
 So this should work:
 
 config dhcp 'roaming'
   option interface 'voyager'
   option start 192.168.8.1
   option limit 252

wow, this works! thank you - this ipcalc.sh beast really
needs some documentation 8-) John: the patch can be dropped.

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


Re: [OpenWrt-Devel] [PATCH] [dnsmasq] support enforced start-IP, end-IP, netmask

2014-10-14 Thread John Crispin

On 09/10/2014 17:07, Bastian Bittorf wrote:
 [dnsmasq] support enforced start-IP, end-IP, netmask

 there are corner cases where the simple setup via start/end/limit
 option does not fit, in our case we need to hand out

 192.168.2.1 ... 192.168.2.254 with a netmask of /24 but
 the underlying interface has 192.168.0.1/16 so the smart
 autodetection method of the init-script does not work.

 our section looks like:

 config dhcp 'roaming'
 option interface 'voyager'
 option force_netmask 255.255.255.0
 option force_startaddr 192.168.2.1
 option force_endaddr 192.168.2.254

 we use the setup for having an decentralized roaming
 mechanism for an OLSR-mesh-network.
Hi,

this feature already exists. use the netmask option inside the dhcp section

John


 Signed-off-by: Bastian Bittorf bitt...@bluebottle.com
 ---
  package/network/services/dnsmasq/files/dnsmasq.init |5 -
  1 file changed, 4 insertions(+), 1 deletion(-)

 diff --git a/package/network/services/dnsmasq/files/dnsmasq.init 
 b/package/network/services/dnsmasq/files/dnsmasq.init
 index 942acd7..3c0399b 100644
 --- a/package/network/services/dnsmasq/files/dnsmasq.init
 +++ b/package/network/services/dnsmasq/files/dnsmasq.init
 @@ -406,6 +406,9 @@ dhcp_add() {
   config_get leasetime $cfg leasetime
   config_get options $cfg options
   config_get_bool dynamicdhcp $cfg dynamicdhcp 1
 + config_get force_netmask $cfg force_netmask
 + config_get force_startaddr $cfg force_startaddr
 + config_get force_endaddr $cfg force_endaddr
  
   leasetime=${leasetime:-12h}
   start=$(dhcp_calc ${start:-100})
 @@ -413,7 +416,7 @@ dhcp_add() {
   [ $limit -gt 0 ]  limit=$((limit-1))
   eval $(ipcalc.sh ${subnet%%/*} $netmask $start $limit)
   if [ $dynamicdhcp = 0 ]; then END=static; fi
 - xappend 
 --dhcp-range=$networkid,$START,$END,$NETMASK,$leasetime${options:+ $options}
 + xappend 
 --dhcp-range=$networkid,${force_startaddr:-$START},${force_endaddr:-$END},${force_netmask:-$NETMASK},$leasetime${options:+
  $options}
  
   dhcp_option_add $cfg $networkid
  }
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [dnsmasq] support enforced start-IP, end-IP, netmask

2014-10-14 Thread John Crispin
try this

config dhcp 'roaming'
  option interface 'voyager'
  option netmask '255.255.255.0'
  option start 1
  option limit 253



On 14/10/2014 12:25, John Crispin wrote:
 On 09/10/2014 17:07, Bastian Bittorf wrote:
 [dnsmasq] support enforced start-IP, end-IP, netmask

 there are corner cases where the simple setup via start/end/limit
 option does not fit, in our case we need to hand out

 192.168.2.1 ... 192.168.2.254 with a netmask of /24 but
 the underlying interface has 192.168.0.1/16 so the smart
 autodetection method of the init-script does not work.

 our section looks like:

 config dhcp 'roaming'
 option interface 'voyager'
 option force_netmask 255.255.255.0
 option force_startaddr 192.168.2.1
 option force_endaddr 192.168.2.254

 we use the setup for having an decentralized roaming
 mechanism for an OLSR-mesh-network.
 Hi,

 this feature already exists. use the netmask option inside the dhcp section

 John


 Signed-off-by: Bastian Bittorf bitt...@bluebottle.com
 ---
  package/network/services/dnsmasq/files/dnsmasq.init |5 -
  1 file changed, 4 insertions(+), 1 deletion(-)

 diff --git a/package/network/services/dnsmasq/files/dnsmasq.init 
 b/package/network/services/dnsmasq/files/dnsmasq.init
 index 942acd7..3c0399b 100644
 --- a/package/network/services/dnsmasq/files/dnsmasq.init
 +++ b/package/network/services/dnsmasq/files/dnsmasq.init
 @@ -406,6 +406,9 @@ dhcp_add() {
  config_get leasetime $cfg leasetime
  config_get options $cfg options
  config_get_bool dynamicdhcp $cfg dynamicdhcp 1
 +config_get force_netmask $cfg force_netmask
 +config_get force_startaddr $cfg force_startaddr
 +config_get force_endaddr $cfg force_endaddr
  
  leasetime=${leasetime:-12h}
  start=$(dhcp_calc ${start:-100})
 @@ -413,7 +416,7 @@ dhcp_add() {
  [ $limit -gt 0 ]  limit=$((limit-1))
  eval $(ipcalc.sh ${subnet%%/*} $netmask $start $limit)
  if [ $dynamicdhcp = 0 ]; then END=static; fi
 -xappend 
 --dhcp-range=$networkid,$START,$END,$NETMASK,$leasetime${options:+ 
 $options}
 +xappend 
 --dhcp-range=$networkid,${force_startaddr:-$START},${force_endaddr:-$END},${force_netmask:-$NETMASK},$leasetime${options:+
  $options}
  
  dhcp_option_add $cfg $networkid
  }
 ___
 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] [PATCH] [dnsmasq] support enforced start-IP, end-IP, netmask

2014-10-14 Thread Justin Vallon
On 10/14/14 7:07 AM, Bastian Bittorf wrote:
 * John Crispin blo...@openwrt.org [14.10.2014 12:36]:
 try this

 config dhcp 'roaming'
   option interface 'voyager'
   option netmask '255.255.255.0'
   option start 1
   option limit 253
 it does not work. this is my interface:

Do you know: 192.168.0.0/16 with start=257, limit=253 gives range
192.168.1.1-192.168.1.253 (maybe off by one)?


-- 
-Justin
justinval...@gmail.com




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


Re: [OpenWrt-Devel] [PATCH] [dnsmasq] support enforced start-IP, end-IP, netmask

2014-10-14 Thread Jo-Philipp Wich
Hi.

 it does not work. this is my interface: [...]

Actually it should work just fine even without option netmask if you
specify the start as ipaddr:

# ipcalc.sh 192.168.0.1 16 192.168.8.1 252
IP=192.168.0.1
NETMASK=255.255.0.0
BROADCAST=192.168.255.255
NETWORK=192.168.0.0
PREFIX=16
START=192.168.8.1
END=192.168.8.251

So this should work:

config dhcp 'roaming'
  option interface 'voyager'
  option start 192.168.8.1
  option limit 252

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


Re: [OpenWrt-Devel] [PATCH] [dnsmasq] support enforced start-IP, end-IP, netmask

2014-10-10 Thread Thomas Hühn
Hi Basti,

I support your changes to dnsmaq init, as this addresses a real use-case to 
enhance wireless roaming in our Freifunk mesh as well.

Greetings Thomas

On 09.10.2014, at 17:07, Bastian Bittorf bitt...@bluebottle.com wrote:

 [dnsmasq] support enforced start-IP, end-IP, netmask
 
 there are corner cases where the simple setup via start/end/limit
 option does not fit, in our case we need to hand out
 
 192.168.2.1 ... 192.168.2.254 with a netmask of /24 but
 the underlying interface has 192.168.0.1/16 so the smart
 autodetection method of the init-script does not work.
 
 our section looks like:
 
 config dhcp 'roaming'
option interface 'voyager'
option force_netmask 255.255.255.0
option force_startaddr 192.168.2.1
option force_endaddr 192.168.2.254
 
 we use the setup for having an decentralized roaming
 mechanism for an OLSR-mesh-network.
 
 Signed-off-by: Bastian Bittorf bitt...@bluebottle.com
 ---
 package/network/services/dnsmasq/files/dnsmasq.init |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)
 
 diff --git a/package/network/services/dnsmasq/files/dnsmasq.init 
 b/package/network/services/dnsmasq/files/dnsmasq.init
 index 942acd7..3c0399b 100644
 --- a/package/network/services/dnsmasq/files/dnsmasq.init
 +++ b/package/network/services/dnsmasq/files/dnsmasq.init
 @@ -406,6 +406,9 @@ dhcp_add() {
   config_get leasetime $cfg leasetime
   config_get options $cfg options
   config_get_bool dynamicdhcp $cfg dynamicdhcp 1
 + config_get force_netmask $cfg force_netmask
 + config_get force_startaddr $cfg force_startaddr
 + config_get force_endaddr $cfg force_endaddr
 
   leasetime=${leasetime:-12h}
   start=$(dhcp_calc ${start:-100})
 @@ -413,7 +416,7 @@ dhcp_add() {
   [ $limit -gt 0 ]  limit=$((limit-1))
   eval $(ipcalc.sh ${subnet%%/*} $netmask $start $limit)
   if [ $dynamicdhcp = 0 ]; then END=static; fi
 - xappend 
 --dhcp-range=$networkid,$START,$END,$NETMASK,$leasetime${options:+ $options}
 + xappend 
 --dhcp-range=$networkid,${force_startaddr:-$START},${force_endaddr:-$END},${force_netmask:-$NETMASK},$leasetime${options:+
  $options}
 
   dhcp_option_add $cfg $networkid
 }
 -- 
 1.7.10.4
 ___
 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