QOS by IP Range? - Also: Backup DHCP list?

General discussion about Gargoyle, OpenWrt or anything else even remotely related to the project

Moderator: Moderators

Post Reply
raz
Posts: 41
Joined: Sun Feb 21, 2010 11:12 am

QOS by IP Range? - Also: Backup DHCP list?

Post by raz »

Hey there.

Is there a way to assign QOS classification rules to cover more than a single IP?

eg: Destination: 192.168.1.100-192.168.1.105, Fast


Also, is there a way to preserve the DHCP list? This would be extremely useful to add to the "Backup / Restore" section, since doing a full config restore on a different firmware is not recommended.

pbix
Developer
Posts: 1373
Joined: Fri Aug 21, 2009 5:09 pm

Re: QOS by IP Range? - Also: Backup DHCP list?

Post by pbix »

You may use CIDR Notation to specify IP address ranges. Use Google to learn about the specifics of CIDR notation.

Backup/Restore saves DHCP information and also works in general between versions of software on the same router. There have been a few bumps along the way but hopefully those are behind us now. I know I use it when upgrading.
Linksys WRT1900ACv2
Netgear WNDR3700v2
TP Link 1043ND v3
TP-Link TL-WDR3600 v1
Buffalo WZR-HP-G300NH2
WRT54G-TM

1an
Posts: 41
Joined: Wed Aug 11, 2010 7:18 am
Location: Australia

Re: QOS by IP Range? - Also: Backup DHCP list?

Post by 1an »

raz wrote:Also, is there a way to preserve the DHCP list? This would be extremely useful to add to the "Backup / Restore" section, since doing a full config restore on a different firmware is not recommended.
Sounds like you are suggesting a new feature for the System/Backup tab? ... a kind of "hardware independent" backup button, that just backs up those config settings that are hardware independent (eg DHCP table) and therefore safe to transfer between different router models.

I currently do this using WinSCP to copy or restore the files manually. The DHCP table is actually contained in two files: /etc/ethers [MAC addresses and ip addresses], and /etc/hosts[ip addresses and hostnames]. I find it a lot quicker when configuring a router from scratch to use this method to repopulate the DHCP table than to enter the details line by line via the gargoyle interface.
pbix wrote:You may use CIDR Notation to specify IP address ranges. Use Google to learn about the specifics of CIDR notation.
I also had a look on google ... Do I understand correctly that CIDR notation only specifies blocks of addresses where the number of addresses is a power of 2 (ie 2, 4, 8 etc, but not 5 or 6)?

Ian
Buffalo WZR-HP-G300NH = Gargoyle 1.5.3
Linksys WRT54GL v1.2 = Gargoyle 1.3.13
SMC Barricade SMC2804WBRP-G = SMC firmware v2.08

pbix
Developer
Posts: 1373
Joined: Fri Aug 21, 2009 5:09 pm

Re: QOS by IP Range? - Also: Backup DHCP list?

Post by pbix »

1ab,

Sorry but I am not an expert on the ins and outs of CIDR notation but it seems to have the kind of functionality that you note.
Linksys WRT1900ACv2
Netgear WNDR3700v2
TP Link 1043ND v3
TP-Link TL-WDR3600 v1
Buffalo WZR-HP-G300NH2
WRT54G-TM

raz
Posts: 41
Joined: Sun Feb 21, 2010 11:12 am

Re: QOS by IP Range? - Also: Backup DHCP list?

Post by raz »

Sounds like you are suggesting a new feature for the System/Backup tab? ... a kind of "hardware independent" backup button, that just backs up those config settings that are hardware independent (eg DHCP table) and therefore safe to transfer between different router models.
Exactly. Repopulating the DHCP Table and QOS table after each firmware upgrade is a serious PITA. I would be interested in learning more about the method you describe. Do you know of an online resource that discusses it in details?
I also had a look on google ... Do I understand correctly that CIDR notation only specifies blocks of addresses where the number of addresses is a power of 2 (ie 2, 4, 8 etc, but not 5 or 6)?
That's what wikipedia seems to suggest.

ie:

192.168.1.100/31 results in range of 192.168.1.100-192.168.1.101 [2 total addresses]
192.168.1.100/30 results in range of 192.168.1.100-192.168.1.103 [4 total addresses]
192.168.1.100/29 results in range of 192.168.1.100-192.168.1.107 [8 total addresses]

a.b.c.d/n results in range of a.b.c.d-a.b.c.[d+ 2^(32-n) -1]

I'll have to test it in the QOS settings.

1an
Posts: 41
Joined: Wed Aug 11, 2010 7:18 am
Location: Australia

Re: QOS by IP Range? - Also: Backup DHCP list?

Post by 1an »

raz wrote:
Repopulating the DHCP Table and QOS table after each firmware upgrade is a serious PITA. I would be interested in learning more about the method you describe. Do you know of an online resource that discusses it in details?
It's pretty straight foward.

1) Enable SSH access - 1st page after clicking System tab in Gargoyle web interface.
2) Download WinSCP and install (I assume you are using some flavour of windows?)
On first screen click "New"
You will need -
hostname = router_ip_address
user name = root
password = same as you use to access Gargoyle web interface
protocol --> select SCP from dropdown
click Save, then Login

you will get a couple of error messages which you can ignore for now, then you will see a screen with two panes
the left is local computer file system, the right is router's filesystem
navigate the router's file system by double clicking the icon at the top of the right pane, then the etc folder entry. double click the ethers entry to open it in WinSCP's editor, then do the same with the hosts entry.

After that, it is up to you as to what you find easiest. I select all text in the file and copy to an external program (excel is easy). If you put the ethers text first, then hosts to the right, it is easy to match them up on the ip addresses.
Alternatively, you can copy both files to a suitable place on your local filesystem, and restore later to /etc/ as required. If restoring you also need to set permissions (since windows doesn't have the same system) to match the other files in the /etc/ directory.

Give it a try, it's easy!

Ian
Buffalo WZR-HP-G300NH = Gargoyle 1.5.3
Linksys WRT54GL v1.2 = Gargoyle 1.3.13
SMC Barricade SMC2804WBRP-G = SMC firmware v2.08

robnitro
Posts: 84
Joined: Sat Feb 26, 2011 4:50 pm

Re: QOS by IP Range? - Also: Backup DHCP list?

Post by robnitro »

You can also open up the backup file that gargoyle creates (backup.tar.gz) by using 7zip. Inside there go to \etc\config and you will see dhcp and qos.

raz
Posts: 41
Joined: Sun Feb 21, 2010 11:12 am

Re: QOS by IP Range? - Also: Backup DHCP list?

Post by raz »

1an, thanks for the neat instructions! Switched routers today and quickly reloading the DHCP/QOS settings was a breeze!

robnitro, interesting. However, how does one load back these files into the router, apart from SSH?

Post Reply