Doubts in creating second 'guest' network

Report wireless and/or network connectivity problems in this forum.

Moderator: Moderators

Post Reply
cpucpu
Posts: 57
Joined: Fri Nov 18, 2016 1:31 am

Doubts in creating second 'guest' network

Post by cpucpu »

Hi everyone, I'm creating a second 'guest' wireless network, I'm following the instructions found in this thread viewtopic.php?f=14&t=6358&start=10 I'm going for suffix /25 'whatever that means' for maximum guest hosts.

The ultimate purpose is to reduce bandwith to the guest network through quotas, which I think I know how to do in the GUI.

The intented code to write:

Code: Select all

#/etc/config/wireless add a new access point
config wifi-iface
option device 'radio0'
option mode 'ap'
option encryption 'psk2'
option key '12345678'
option ssid 'Guest'
option network 'Guest'

#/etc/config/network add a corresponding entry depending on the max guests allowed
config interface 'Guest'
option _orig_ifname 'wlan0-1'
option _orig_bridge 'false'
option proto 'static'
option ipaddr '192.168.1.249'
option netmask '255.255.255.248

#/etc/config/dhcp match the IP address ranges of each AP
config dhcp 'lan'
option interface 'lan'
option leasetime '12h'
option start '2'
option limit '125'

config dhcp 'guest'
option leasetime '12h'
option interface 'Guest'
option start '130'
option limit '125'
Some doubts:

- If I change

Code: Select all

option ssid 'Guest'
should I change every other "Guest" entry? what about

Code: Select all

config dhcp 'guest'
because that is lowercase

- The 'regular network' ssid name is not being being touched at all here right?

- According to

Code: Select all

option start '2'
I get 192.168.1.1 is for gargoyle GUI. What's the other IP being allocated for?

-I currently have configured my PC as static 192.168.1.100 through gargoyle GUI, no further issues here right?

Waiting for further instructions, ready to go.

Lantis
Moderator
Posts: 7063
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Doubts in creating second 'guest' network

Post by Lantis »

cpucpu wrote:Hi everyone, I'm creating a second 'guest' wireless network, I'm following the instructions found in this thread viewtopic.php?f=14&t=6358&start=10 I'm going for suffix /25 'whatever that means' for maximum guest hosts.
CIDR notation
See here: http://jodies.de/ipcalc?host=192.168.1. ... =24&mask2=
cpucpu wrote: The ultimate purpose is to reduce bandwith to the guest network through quotas, which I think I know how to do in the GUI.

The intented code to write:

Code: Select all

#/etc/config/wireless add a new access point
config wifi-iface
option device 'radio0'
option mode 'ap'
option encryption 'psk2'
option key '12345678'
option ssid 'Guest'
option network 'Guest'

#/etc/config/network add a corresponding entry depending on the max guests allowed
config interface 'Guest'
option _orig_ifname 'wlan0-1'
option _orig_bridge 'false'
option proto 'static'
option ipaddr '192.168.1.249'
option netmask '255.255.255.248

#/etc/config/dhcp match the IP address ranges of each AP
config dhcp 'lan'
option interface 'lan'
option leasetime '12h'
option start '2'
option limit '125'

config dhcp 'guest'
option leasetime '12h'
option interface 'Guest'
option start '130'
option limit '125'
Some doubts:

- If I change

Code: Select all

option ssid 'Guest'
should I change every other "Guest" entry? what about

Code: Select all

config dhcp 'guest'
because that is lowercase
In the network config file you are creating a new Interface called "Guest". You are tagging the wifi network (option network) and a dhcp pool (option interface) to that Interface.
The wifi ssid option is separate and inconsequential.
cpucpu wrote: - The 'regular network' ssid name is not being being touched at all here right?
Correct
cpucpu wrote: - According to

Code: Select all

option start '2'
I get 192.168.1.1 is for gargoyle GUI. What's the other IP being allocated for?
This seems logical to me? if 192.168.1.1 is already taken, we want to start at 192.168.1.2
cpucpu wrote: -I currently have configured my PC as static 192.168.1.100 through gargoyle GUI, no further issues here right?

Waiting for further instructions, ready to go.
Yes, with /25 CIDR you can use 100 for non guests.
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

cpucpu
Posts: 57
Joined: Fri Nov 18, 2016 1:31 am

Re: Doubts in creating second 'guest' network

Post by cpucpu »

Exelent, I'll update this weekend. I tried the documentation but did not really grasp the concepts, now at least I'm more confident. Many thanks.

cpucpu
Posts: 57
Joined: Fri Nov 18, 2016 1:31 am

Re: Doubts in creating second 'guest' network

Post by cpucpu »

Seems to work, except for the fact that devices get ip's in the range 192.168.1.2-127 regardless of the connected network.

I updated to the following files. Older instrucctions weren't deleted, but commented out. Newer instructions were written at the end of the file. I preserved some instructions.

Network

Code: Select all

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd47:37f5:f2ed::/48'

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

config interface 'wan6'
	option ifname 'eth0'
	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 '0 2 3 4 5'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '1 6'

config interface 'wan'
	option ifname 'eth0'
	option proto 'pppoe'
	option username 'miguelmxl@prodigy.net.mx'
	option password 'miguelmxl2'
	option keepalive '3 5'
	option ipv6 '0'

#/etc/config/network add a corresponding entry depending on the max guests allowed
config interface 'Guest'
	option _orig_ifname 'wlan0-1'
	option _orig_bridge 'false'
	option proto 'static'
	option ipaddr '192.168.1.129'
	option netmask '255.255.255.128'
DHCP

Code: Select all

config dnsmasq
	option domainneeded '1'
	option boguspriv '1'
	option filterwin2k '0'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option nonegcache '0'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.auto'
	option localservice '1'
	list server '/.bit/178.32.31.41'
	list server '/.bit/106.187.47.17'
	list server '/.bit/176.58.118.172'
	list server '/.glue/66.244.95.20'
	list server '/.glue/95.211.32.162'
	list server '/.glue/95.142.171.235'
	list server '/.parody/66.244.95.20'
	list server '/.parody/95.211.32.162'
	list server '/.parody/95.142.171.235'
	list server '/.dyn/66.244.95.20'
	list server '/.dyn/95.211.32.162'
	list server '/.dyn/95.142.171.235'
	list server '/.bbs/66.244.95.20'
	list server '/.bbs/95.211.32.162'
	list server '/.bbs/95.142.171.235'
	list server '/.free/66.244.95.20'
	list server '/.free/95.211.32.162'
	list server '/.free/95.142.171.235'
	list server '/.fur/66.244.95.20'
	list server '/.fur/95.211.32.162'
	list server '/.fur/95.142.171.235'
	list server '/.geek/66.244.95.20'
	list server '/.geek/95.211.32.162'
	list server '/.geek/95.142.171.235'
	list server '/.gopher/66.244.95.20'
	list server '/.gopher/95.211.32.162'
	list server '/.gopher/95.142.171.235'
	list server '/.indy/66.244.95.20'
	list server '/.indy/95.211.32.162'
	list server '/.indy/95.142.171.235'
	list server '/.ing/66.244.95.20'
	list server '/.ing/95.211.32.162'
	list server '/.ing/95.142.171.235'
	list server '/.null/66.244.95.20'
	list server '/.null/95.211.32.162'
	list server '/.null/95.142.171.235'
	list server '/.oss/66.244.95.20'
	list server '/.oss/95.211.32.162'
	list server '/.oss/95.142.171.235'
	list server '/.micro/66.244.95.20'
	list server '/.micro/95.211.32.162'
	list server '/.micro/95.142.171.235'
	list addnhosts '/plugin_root/adblock/block.hosts'

#config dhcp 'lan'
#	option interface 'lan'
#	option start '100'
#	option limit '150'
#	option leasetime '12h'
#	option ignore '0'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

#/etc/config/dhcp match the IP address ranges of each AP
config dhcp 'lan'
	option interface 'lan'
	option leasetime '12h'
	option start '2'
	option limit '125'

config dhcp 'guest'
	option interface 'Guest'
	option leasetime '12h'
	option start '130'
	option limit '125'
Wireless

Code: Select all

config wifi-device 'radio0'
	option type 'mac80211'
	option channel '36'
	option hwmode '11a'
	option path 'pci0000:01/0000:01:00.0'
	option htmode 'VHT80'

config wifi-device 'radio1'
	option type 'mac80211'
	option hwmode '11g'
	option path 'platform/qca955x_wmac'
	option htmode 'HT20'
	option channel '1'

config wifi-iface 'ap_g'
	option device 'radio1'
	option mode 'ap'
	option network 'lan'
	option disassoc_low_ack '0'
	option ssid 'Dark-Knight'
	option encryption 'psk2'
	option key '12345678'

#config wifi-iface 'ap_gn_g'
#	option device 'radio1'
#	option mode 'ap'
#	option network 'lan'
#	option disassoc_low_ack '0'
#	option is_guest_network '1'
#	option macaddr 'da:66:62:09:d6:9d'
#	option ssid 'INFINITUM3ewt'
#	option isolate '1'
#	option encryption 'psk2'
#	option key '33bb70810a'

config wifi-iface 'ap_gn_g'
	option device 'radio1'
	option mode 'ap'
	option encryption 'psk2'
	option key '33bb70810a'
	option ssid 'INFINITUM3ewt'
	option network 'Guest'
	option disassoc_low_ack '0'
	option is_guest_network '1'
	option isolate '1'
	option macaddr 'da:66:62:09:d6:9d'
Anything wrong?
Last edited by cpucpu on Sun Dec 18, 2016 6:26 pm, edited 1 time in total.

Lantis
Moderator
Posts: 7063
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Doubts in creating second 'guest' network

Post by Lantis »

Looks ok to me.
I can try doing a similar setup in my test router when I return from vacation.

is_guest_network is a gargoyle only flag which tells the user interface a few things, but doesn't affect the wireless settings per se
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

cpucpu
Posts: 57
Joined: Fri Nov 18, 2016 1:31 am

Re: Doubts in creating second 'guest' network

Post by cpucpu »

I updated my previous post to reflect the newer issue. Basically i am not getting different ip ranges for the guest network.

Also, while DHCP lease time resets on reboot, in my brief testing it seems that i am getting the same ips for smartphones when reconnecting them to the AP. Is it supposed for a device to get a new ip on every (re)connection? What about when changing from regular to guest network? is the ip range supposed to change?

Lantis
Moderator
Posts: 7063
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Doubts in creating second 'guest' network

Post by Lantis »

The dhcp assignments will be cached in /tmp (resets on reboot)
Or they will reset after the timeout period.

Because they are cached, if a device which has a cached assignment joins the guest network it will probably still get its old IP.

You could try clearing the cache, then connecting a device.
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

cpucpu
Posts: 57
Joined: Fri Nov 18, 2016 1:31 am

Re: Doubts in creating second 'guest' network

Post by cpucpu »

It makes sense.

Also I just realized there is no internet access on guest, I might have messed things up somewhere.

Post Reply