Page 1 of 1

DHCP Different Gateway

Posted: Tue Sep 20, 2011 10:30 pm
by neighbor
Is there any way to configure the DHCP to hand out a different IP as the gateway? I went into dnsmasq.conf using vi from a ssh session but it seems gargoyle does not use this for DHCP as there were no dhcp values. On a side note, how do you quit vi from openwrt? q! doesn't seem to work.

My current setup uses gateway 192.168.1.1. My gargoyle device is a WZR-G300NH with WAN disabled so it functions as an AP. I need gargoyle to pass out 192.168.1.1 to wireless clients as the gateway rather than its own IP. Is that possible?

For more detail about the current setup, look at post 7 here:
http://www.gargoyle-router.com/phpbb/vi ... 7970#p7970

Re: DHCP Different Gateway

Posted: Thu Sep 22, 2011 8:21 pm
by neighbor
Ok, so a bit of an update. I searched through the files and found one called /etc/config/dhcp

While this file appears to contain the dhcp range and other dnsmasq options, it does not appear to include the gateway. The file /etc/config/network does not appear to include the dhcp assigned gateway aside from the local IP assignment.

Any ideas where the dhcp gateway is stored?

Re: DHCP Different Gateway

Posted: Thu Sep 22, 2011 9:03 pm
by neighbor
Ok, final update. First, entering ":wq" (without the quotes obviously), does write and quit vi.

To change the gateway, this is what I did:
SSH into gargoyle and log in

Code: Select all

cd /etc/config
vi dhcp
I then found the following

Code: Select all

config 'dhcp' 'lan'
          option 'interface' 'lan'
          option 'start' '100'
          option 'limit' '150'
          option 'leasetime' '12h'
and changed it to

Code: Select all

config 'dhcp' 'lan'
          option 'interface' 'lan'
          option 'gateway' '192.168.1.1'
          option 'start' '100'
          option 'limit' '150'
          option 'leasetime' '12h'
It's a bit obvious once I figured it out, but there really isn't much out there on google for it as openwrt users appear to use the dnsmasq file which is a bit different. Anyway, hope this helps someone.

On a side note, does anyone know of a relatively easy way to add this to the web interface? Or perhaps we can make it a request on the next version.