different dhcp range from router address range

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
niftynifler
DD-WRT Novice


Joined: 13 Mar 2012
Posts: 3

PostPosted: Thu Apr 12, 2012 11:24    Post subject: different dhcp range from router address range Reply with quote
Good day all.

Is it possible to set up the DHCP scope in a differant ip range than the router?

The router IP is, 172.19.0.10 and I want the DHCP scope to be 172.19.8.100-110

Seems like DD-WRT blocks that, and only allows you to change the last octet from the ip range.
Sponsor
mjurgens
DD-WRT Novice


Joined: 12 Jan 2011
Posts: 40

PostPosted: Sat Apr 14, 2012 10:45    Post subject: It can be done Reply with quote
You can manually configure DNSMasq to do many things including what you want to do.

So you want to "Use DNSMasq for DHCP" then you can configure DNSMasq either on the Services tab in the "Additional DNSMasq Options" text box or you could totally disable it in the GUI and run DNSmasq using your own config file from a startup script

I found the manpage and the FAQ at http://www.thekelleys.org.uk/dnsmasq/doc.html useful to build my own configuration.


Here is an example config which does a lot more than you want to do so you will need to cut it down:
It also serves DNS. This config uses some external files that I put there from other startup scripts so take care. The file /tmp/inet.dnsmasq.hosts contains a list of hosts and ips and hence I can assign ip addresses using those host names for the dhcp reservations


# ============================ DNS ============================
interface=br0
domain=mydomain.com

# do not use the standard /etc/resolv.conf file
no-resolv

# never forward queries without a domain, only use local informations
domain-needed

# use this local hosts file
addn-hosts=/tmp/inet.dnsmasq.hosts

# add the domain (specified above) to names with a domain
expand-hosts

# use the internet gateway router to pass DNS queries to
# if you wanted you could add additional servers here by adding more server= lines
server=192.168.0.1

# never pass queries using mydomain.com as the domain to the upstream DNS servers
server=/mydomain.com/

# never pass queries using 168.192.in-addr.arpa to the upstream DNS servers. This covers all internal network reverse name queries
server=/168.192.in-addr.arpa/

# send DNS requests to all upstream servers and use the firt one that replies
# obviously only valid if more than one defined
all-servers

# Reject (and log) addresses from upstream nameservers which are in the private IP ranges
stop-dns-rebind

# Set the TTL in responses for requests served from local information in seconds
local-ttl=60

# log these requests
log-dhcp
#log-queries

# log them asynchronously
log-async
#
# ============================ DHCP ============================
# do not ping addresses before allocating them
no-ping

# store dhcp leases in this file
dhcp-leasefile=/tmp/dnsmasq.leases

# only ever give out this many addresses
dhcp-lease-max=100

# Do not ignore dhcp requests from unknown hosts - just give them an answer
dhcp-authoritative


# ------------ DHCP RANGES ------------
dhcp-range=192.168.9.100,192.168.9.149,255.255.255.0,5m # DEFAULT DHCP RANGE
dhcp-range=net:ZERO,192.168.0.100,192.168.0.101,255.255.255.0,1440m
dhcp-range=net:ONE,192.168.1.100,192.168.1.101,255.255.255.0,60m
dhcp-range=net:TWO,192.168.2.100,192.168.2.101,255.255.255.0,1440m
dhcp-range=net:THREE,192.168.3.100,192.168.3.101,255.255.255.0,60m
dhcp-range=net:FIVE,192.168.5.100,192.168.5.101,255.255.255.0,60m

# ------------ DHCP OPTIONS ------------
# DEFAULT OPTIONS
dhcp-option=option:router,127.0.0.1 # default Router which of course is not going to work very well
dhcp-option=6,127.0.0.1 # default DNS

# NET:ZERO
dhcp-option=net:ZERO,option:router,192.168.0.1 # default Router
dhcp-option=net:ZERO,6,192.168.0.254 # default DNS

# NET:ONE
dhcp-option=net:ONE,option:router,192.168.1.1 # default Router
dhcp-option=net:ONE,6,192.168.1.254 # default DNS

# NET:TWO
dhcp-option=net:TWO,option:router,192.168.2.1 # default Router
dhcp-option=net:TWO,6,192.168.2.254 # default DNS

# NET:THREE
dhcp-option=net:THREE,option:router,192.168.3.1 # default Router
dhcp-option=net:THREE,6,192.168.3.254 # default DNS

# NET:FIVE
dhcp-option=net:FIVE,option:router,192.168.5.1 # default Router
dhcp-option=net:FIVE,6,192.168.5.254 # default DNS

# ------------ RESERVED ADDRESSES ------------
# NET:ZERO
dhcp-host=08:00:27:85:CE:6D,net:ZERO,host6


# NET:ONE
# dhcp-host=00:00:00:00:00:00,net:ONE,host5

# NET:TWO
dhcp-host=00:13:72:A3:78:61,net:TWO,host4
dhcp-host=00:18:8b:57:8d:f6,net:TWO,host3

# NET:THREE
dhcp-host=00:07:e0:8c:4d:b1,net:THREE,host1

# NET:FIVE
dhcp-host=00:00:00:00:00:00,net:FIVE,host2
niftynifler
DD-WRT Novice


Joined: 13 Mar 2012
Posts: 3

PostPosted: Wed May 16, 2012 9:01    Post subject: Reply with quote
Great, Thanks for that.

Got it working perfectly.
vinospam
DD-WRT Novice


Joined: 29 Jun 2015
Posts: 5

PostPosted: Tue Jun 30, 2015 16:23    Post subject: Reply with quote
Hi,

I'm trying to build a setup with 2 different DHCP-ranges with DNSmasq on my DD-WRT. That's how I reach your post.

When you put net:ZERO, net:ONE, … in your config, is that arbitrary set in dnsmasq or are that labels already setup in another parts of DD-WRT config (like bridges br0, br1,…)?

Thanks for your help!

[edit] Got it working. My setup is here.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum