DHCP Reservation w/DNS

Suggest improvements and new features for Gargoyle.

Moderator: Moderators

SuperDaveAPK
Posts: 1
Joined: Sat May 23, 2015 6:16 am

Re: DHCP Reservation w/DNS

Post by SuperDaveAPK »

To accomplish this you need a router with at least 2 LAN interfaces. Don't get interfaces and switch ports confused. Two totally different things. Finding this with consumer-grade hardware is not easy. However, there is a simple solution. Add another router to the mix and setup a static route between them. Use one router for the adults with DNS of your choosing and the other use OpenDNS or whatever for your content filtering. This link explains it.

http://www.patrikdufresne.com/en/multip ... th-dd-wrt/

ispyisail
Moderator
Posts: 5185
Joined: Mon Apr 06, 2009 3:15 am
Location: New Zealand

Re: DHCP Reservation w/DNS

Post by ispyisail »

Can you explain the static route setup more.

I've never use static routes

Image

ispyisail
Moderator
Posts: 5185
Joined: Mon Apr 06, 2009 3:15 am
Location: New Zealand

Re: DHCP Reservation w/DNS

Post by ispyisail »

I find this interesting

Image

I wonder why this is better than a dynamic setup like this?

Image

nworbnhoj
Posts: 916
Joined: Mon Jul 21, 2014 10:08 am
Location: Australia
Contact:

Re: DHCP Reservation w/DNS

Post by nworbnhoj »

Both configurations can work.

For clarification - the second config could be:
DSL LAN 192.168.10.1
Gargoyle1 WAN 192.168.10.100
Gargoyle2 WAN 192.168.10.101
Gargoyle1 LAN 192.168.5.1
Gargoyle2 LAN 192.168.50.1

However, I would tend to use staticIP on the DSL Router (on the assumption that this network will not be changing much; ie there will not be Gargoyle 3, 4, 5, 6 etc)
DSL LAN 192.168.10.1
Gargoyle1 WAN 192.168.10.2
Gargoyle2 WAN 192.168.10.3

The first configuration is also OK with the advantage that it only requires 2 routers and not 3.
Can you help someone else get Gargoyle up and running?
TL-WDR3600 : Gargoyle 1.9.0 : NBN FixedWireless
TL-WR1043ND-V2 : Gargoyle 1.8.0 : 3G Huawei E160E

Parkcomm
Posts: 4
Joined: Sun Oct 26, 2014 9:58 pm

Re: DHCP Reservation w/DNS

Post by Parkcomm »

It's not hard to to set up two interfaces with separate vlans and separate subnets.

Here is the /etc/config/network on my TP-Link 4 port (consumer grade) router.
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config interface 'lan'
option ifname 'eth0.1'
option force_link '1'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
option dns '192.168.1.1'

config interface 'sub5'
option ifname 'eth0.5'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.5.1'
option netmask '255.255.255.0'

config interface 'wan'
option ifname 'eth0.2'
option proto 'pppoe'
option username 'XXXXXXXX'
option password 'XXXXXXXX'
option keepalive '3 5'

config interface 'wan6'
option ifname '@wan'
option proto 'dhcpv6'

config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'

config switch_vlan
option device 'switch0'
option vlan '1'
option ports '0t 2 3 4'

config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0t 1'

config switch_vlan
option device 'switch0'
option vlan '5'
option ports '0t 5'
Ports 2,3 & 4 are all in one one subnet and port 5 is in its own subnet.

/etc/config/dhcp
config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '1h'
list 'dhcp_option' '44,192.168.1.25'
list 'dhcp_option' '42,192.168.1.1'

config dhcp 'sub5'
option interface 'sub5'
option start 100
option limit 150
option leasetime 1h
list 'dhcp_option' '44,192.168.1.25'
list 'dhcp_option' '42,192.168.1.1'


config dhcp 'wan'
option interface 'wan'
option ignore '1'
Kernel IP routing table:
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.20.22.97 0.0.0.0 UG 0 0 0 pppoe-wan
10.20.22.97 * 255.255.255.255 UH 0 0 0 pppoe-wan
192.168.1.0 * 255.255.255.0 U 0 0 0 br-lan
192.168.5.0 * 255.255.255.0 U 0 0 0 br-sub5
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0.2
TP-Link WDR 4300 - Gargoyle 1.6.2
16 G Extroot / Auto Discovery Privoxy server / Dedicate TOR VLAN / 5G wds

Parkcomm
Posts: 4
Joined: Sun Oct 26, 2014 9:58 pm

Re: DHCP Reservation w/DNS

Post by Parkcomm »

And if you are wondering why port 5 ...

Image

Logical port 5 corresponds to physical port 4 on the switch (right hand port when viewed from the back)

Fromhttp://www.dd-wrt.com/wiki/index.php?ti ... edirect=no
TP-Link WDR 4300 - Gargoyle 1.6.2
16 G Extroot / Auto Discovery Privoxy server / Dedicate TOR VLAN / 5G wds

landersohn
Posts: 13
Joined: Sat May 30, 2015 3:55 pm

Re: DHCP Reservation w/DNS

Post by landersohn »

+1 definitely

Sorry, I just posted the same request, title "IP specific DNS" before I saw this one

nworbnhoj
Posts: 916
Joined: Mon Jul 21, 2014 10:08 am
Location: Australia
Contact:

Re: DHCP Reservation w/DNS

Post by nworbnhoj »

titan13 wrote:I would like to see a feature added in the DHCP settings that would allow a reservation to be made that uses a different DNS server from the main scope.
There is a feature accessible in the OpenWRT uci that may offer a solution to this request:
https://wiki.openwrt.org/doc/uci/dhcp#c ... al_options

This relies on dnsmasq which provides dhcp services for OpenWRT
dnsmasq --dhcp-option=6,208.67.222.222
http://www.thekelleys.org.uk/dnsmasq/do ... q-man.html

Assuming this works, then implementing an interface in Gargoyle is probably not all that difficult. Related to Device Groups
http://www.gargoyle-router.com/phpbb/vi ... =10#p34171
Can you help someone else get Gargoyle up and running?
TL-WDR3600 : Gargoyle 1.9.0 : NBN FixedWireless
TL-WR1043ND-V2 : Gargoyle 1.8.0 : 3G Huawei E160E

Post Reply