What's new

Custom Gateway

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Felix G

New Around Here
First of all, I hope everyone is Safe and Healthy during those days,

Secondly i been a big fan of this forum and you guys had helped me a lot of the years with information that is posted here.

Today i got into a situation that i'm trying to solve that i haven't found an answer for so i decided to finally register for an account and post my question here, the question is mainly to @RMerlin but if anyone got any insights that would be great.

I'm looking to see if it is possible to setup a custom gateway for manual configured DHCP Clients.

I currently have two ISP providers one is directly connected into RT-AC5300 router (WAN Port) running on Asuswrt-Merlin 384.16 and second ISP is connected through a Switch (that is connected to a Lan port on Asus router).

The main ISP that connected to the router, provides Internet for most users that connect to the internet through Wifi or Cable.

The second ISP is used mostly for VOIP Phones and 2-3 computers that require a bigger upload bandwidth that first ISP is unable to provide.

Up until last month i used the Win Server to act as a DHCP server and had created there rules based on MAC address which clients should use what ISP as a gateway. the default gateway was ISP1 and for all VOIP Phone the gateway was ISP2. that worked great for the past 3-4 years. however my Win Server died and due to current COVID-19 situation I can't fix it. so I have activated the DHCP on ASUS router instead and looking into a solution to do the same rules as i had before with the Win DHCP Server. IS IT POSSIBLE?

I know i can manually create a static IP on each and every device that needs to use secondary DHCP however that creates more work in the future to control those devices and etc. and help would greatly be appreciated.
 
Yes it's possible. You could create a custom config file as follows:

/jffs/configs/dnsmasq.conf.add
Code:
dhcp-option=tag:isp2,option:router,1.2.3.4
dhcp-host=60:57:18:5B:58:03,set:isp2

Where 1.2.3.4 is the address of the gateway and 60:57:18:5B:58:03 is the address of a client.

Add extra dhcp-host lines as necessary.
 
Colin thanks for the quick reply!!!

I never played with the configs before but all i need to do to get the above done is as following:

1. Under Administration=>System Click Yes for Enable JFFS custom scripts and configs, not sure if i also need to do Format JFFS partition at next boot
2. Download a backup copy of JFFS partition from Administration=> Restore/Save/Upload Setting
3. open the archive that was downloaded and go to folder \.\configs\
4. create a txt file with the code that you mentioned above and save the file as dnsmasq.conf.add
5. archive back the whole thing
6. upload the new archive Under Administration=> Restore/Save/Upload Setting

can you please confirm if that is the case, just don't want to make any mistakes and better ask as a child to not make any mistakes :)

Also in regards to your code, i wanted to clarify:
1. i would create the first line only once giving it a tag name and custom gateway address and after that create the second line of code multiple times for each new device.
or
2. I would recreate those 2 lines of code multiple time for each new device?

Thank you for clarification.

Also @RMerlin is it possible to add the option of custom gateway information for each entry to be shown under Manually Assigned IP in the future updates in WebUI?
 
You don't need to format the JFFS partition.

You also don't need to go through that long-winded backup/edit/restore process (although I guess that would work). Just make sure that whatever editor you use can create Unix-type files, not DOS-type files (i.e. don't use Windows Notepad).

You can just create or edit files directly on the router (with nano) by enabling SSH LAN access and using a terminal client like PuTTY. Alternatively you could use a Windows GUI client like WinSCP (which has a built-in editor).
 
Guys i would need your assistance once again. when i have implemented the above suggestion.

All the manual IP assignments for those devices got ignored, and instead of those devices get a manual IP they go back to DHCP.

on the good note, all those devices now have the proper gateway.

P.S. any device in the manual IP assignment that wasn't talked about in the /jffs/configs/dnsmasq.conf.add is assigned it's manual IP, so the change is effecting only the devices that are listed in this config
 
Last edited:
How many devices need to be setup with this alternate gateway?

I think there are conflicting dhcp-host statements in the /etc/dnsmasq.conf file from your manually defined clients.

I suggest you remove the manual assignments done in the GUI and then modify your file as follows:
Code:
dhcp-option=tag:isp2,option:router,1.2.3.4
dhcp-host=94:DE:80:C5:79:52,set:isp2,192.168.1.30
dhcp-host=11:22:33:44:55:66,set:isp2,192.168.1.31
dhcp-host=99:88:77:66:55:44,set:isp2,192.168.1.32
So you're assigning the IP addresses here instead.

If you also wanted to override the clients host name you would do this:
Code:
dhcp-option=tag:isp2,option:router,1.2.3.4
dhcp-host=94:DE:80:C5:79:52,set:isp2,hostname1,192.168.1.30
dhcp-host=11:22:33:44:55:66,set:isp2,hostname2,192.168.1.31
dhcp-host=99:88:77:66:55:44,set:isp2,hostname3,192.168.1.32
 
Last edited:
Thanks Colin, that did the job.

regarding your question, i have 24 devices at the moment that require alternative gateway.

and the code within /etc/dnsmasq.conf for dhcp host is as following

dhcp-host=00:15:65:94:32:2F,set:00:15:65:94:32:2F,192.168.11.150
dhcp-host=00:15:65:88:48:46,set:00:15:65:88:48:46,192.168.11.151
dhcp-host=00:15:65:98:F5:F2,set:00:15:65:98:F5:F2,192.168.11.152
dhcp-host=00:15:65:98:F6:75,set:00:15:65:98:F6:75,192.168.11.153
 
regarding your question, i have 24 devices at the moment that require alternative gateway.
OK. That's not too bad to manage by editing a file then (as apposed to using the GUI).

and the code within /etc/dnsmasq.conf for dhcp host is as following

dhcp-host=00:15:65:94:32:2F,set:00:15:65:94:32:2F,192.168.11.150
dhcp-host=00:15:65:88:48:46,set:00:15:65:88:48:46,192.168.11.151
dhcp-host=00:15:65:98:F5:F2,set:00:15:65:98:F5:F2,192.168.11.152
dhcp-host=00:15:65:98:F6:75,set:00:15:65:98:F6:75,192.168.11.153
That's interesting, thanks for the info. I don't use the current Merlin firmware and the way manual assignments are done has changed over time.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Staff online

Top