OpenWrt Forum Archive

Topic: Add different gateway via DHCP

The content of this topic has been archived on 14 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

hi,

how can i add a host with an different Gateway ip adress to the dhcp server config (dnsmasq)?
or is it possible to compile ISC dhcpd for openwrt?

st0ne

hi St0ne,

let's assume that :
· 00:20:e0:3b:13:af is the mac address of your special client
· 192.168.1.201 is the ip address of this special client
· 192.168.1.254 is the ip address of a special router for this special client

Can you try the following :
· separate your network into 2 distinct pools :

dhcp-range=lan1,192.168.1.101,192.168.1.149,255.255.255.0,12h
dhcp-range=lan2,192.168.1.201,static,255.255.255.0,12h

the static keyword should disable dynamic ip address allocation for the second pool.

· add a router option for your second pool :

dhcp-option=lan2,3,192.168.1.254

the router option is number 3

· put your host in the second pool :

dhcp-host=net:lan2,00:20:e0:3b:13:af,192.168.1.201

--
Nico

Nico wrote:

hi St0ne,

let's assume that :
· 00:20:e0:3b:13:af is the mac address of your special client
· 192.168.1.201 is the ip address of this special client
· 192.168.1.254 is the ip address of a special router for this special client

Can you try the following :
· separate your network into 2 distinct pools :

dhcp-range=lan1,192.168.1.101,192.168.1.149,255.255.255.0,12h
dhcp-range=lan2,192.168.1.201,static,255.255.255.0,12h

the static keyword should disable dynamic ip address allocation for the second pool.

· add a router option for your second pool :

dhcp-option=lan2,3,192.168.1.254

the router option is number 3

· put your host in the second pool :

dhcp-host=net:lan2,00:20:e0:3b:13:af,192.168.1.201

--
Nico

Hi,

I would like to accomplish the above settings, using the UCI frontend for dnsmasq in /etc/config/dhcp.
How can I specify the custom tag to be used within a host configuration (static addresses) to parse the dhcp options that are tracked with this tag to the particular host.

1)
I would like to have 2 ranges(pools) within a IP subnet, lets say: 192.168.1.0/24. All the addresses in the 2 pools will be used for static leases.

dhcp-range=gw1,192.168.1.17,static,255.255.255.240,12h
dhcp-range=gw2,192.168.1.49,static,255.255.255.240,12h

Is this statement correct - I want to allocate two ranges in the same s/24 subnet, but I am no sure how to define the ranges - that's why i tried to use /28 subnet statements in this example.

2)
I would like to specify two options to be used in the two ranges of addresses. These are two Gateways and DNS servers to be announced to the particular clients but in different sequence.

dhcp-option=gw1,3,192.168.1.1,192.168.1.2
dhcp-option=gw1,6,192.168.1.1,192.168.1.2

dhcp-option=gw2,3,192.168.1.2,192.168.1.1
dhcp-option=gw2,6,192.168.1.2,192.168.1.1

3)
Static leases for all the clients, but in accordance to the tag specified in the config, some of them, tagged with gw1 will use GW1, DNS1 as primary,and GW2, DNS2 as secondary and vice versa for the clients tagged with gw2

dhcp-host=net:gw1,00:20:e0:3b:13:af,192.168.1.20
dhcp-host=net:gw2,00:20:e0:3b:13:cd,192.168.1.50

Please, give a little help with the above config, as it seems I am missing something. As well, if there is any way to do the above using uci config of dnsmasq in /etc/config/dhcp

Regards,
dir2cas

ps. I am sorry for posting in the WhiteRussian thread despite my configuration is related to Backfire, but simply this was the thread closest to my problem.

(Last edited by dir2cas on 30 Mar 2011, 21:39)

The discussion might have continued from here.