Add GUI for VLAN configurations

Suggest improvements and new features for Gargoyle.

Moderator: Moderators

User avatar
ericwong
Posts: 430
Joined: Sat Aug 25, 2012 6:15 am
Location: Melbourne, Australia
Contact:

Re: Add GUI for VLAN configurations

Post by ericwong »

psycik wrote:
That's what my friend did. After a bit of playing in gargoyle he switched to openwrt. He tried the combinations of 5t 6t, 5 6t, 5t 6t and included tried tagging some of the other lan ports and killing off all the firewall rules so that he could see in and out traffic on the wan port. To no avail.

How are you connecting to the ONT since you seem to be using DHCP where I've been using PPPoe
There is more to the setting than tagging the ports.... ;)
Please read all the information I posted if you want to understand how it worked. The link I posted gives a very good guide and that is what I had followed.

PPPoe setting is obviously different from DHCP. Sorry but I don't know what is your question nor what you are even trying to achieve. The setting I posted works for my connection.

For my case, my ISP had provided a WIFI router and I merely copied whatever VLAN settings that router uses for its WAN settings. Your ISP should have either provided a router or provided the settings you need.
Eric Wong

PM me if you need to buy Gargoyle router in Australia/NZ, willing to pay me to help you on your Gargoyle configurations or build custom configured ROM with pre-installed app or try to fix your bricked router. Yes, I am looking for job/work.

Chilling_Silence
Posts: 47
Joined: Tue Jul 27, 2010 11:31 pm

Re: Add GUI for VLAN configurations

Post by Chilling_Silence »

Quick update here:
1) The stuff posted by ericwong definitely works, I've tested it and it's 100% solid for putting the routers WAN on to VLAN10.

2) Works with DHCP and PPPoE on VLAN10, not a problem :) Presuming psycik wants VLAN10 for UFB in New Zealand. It's all good!
Try this:

Code: Select all

root@Gargoyle:~# cat /etc/config/network 

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 'eth1'
        option type 'bridge'
        option proto 'static'
        option netmask '255.255.255.0'
        option ipaddr '192.168.20.1'
        option dns '8.8.8.8 8.8.4.4'

config interface 'wan'
        option dns '8.8.8.8 8.8.4.4'
        option peerdns '0'
        option ifname 'eth0.10'
        option proto 'pppoe'
        option username 'user@xtrabb.co.nz'
        option password 'abc123'
        option keepalive '3 5'

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

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

config switch_vlan
        option device 'switch0'
        option vlan '10'
        option ports '5t 6t'
3) It doesn't like applying the changes through UCI, complains about the trunk ports, so it looks like the plugin will have to manipulate /etc/config/network directly which is not quite what I wanted to do, but whatever, it's just gonna turn an ugly workaround even uglier

4) Editing /usr/lib/gargoyle/restart_network.sh and putting a script in there seemed to work just fine for forcing certain networking actions, I'll see if I can get the plugin to inject the VLAN stuff in there.

5) (Putting this down for my own notes) I think I'm gonna have to use UCI to pull the LAN IP, write that to a tempfile along with all the other /etc/config/network guff and just have that file copied over /etc/config/network each time the WebUI reloads the networking. It could be worse, but for a basic "Enable VLAN 10 for UFB in NZ", it should work.

Been _super_ busy, with life in general, but hoping to get a bit more time to spend on this over the next week or two (When I'm not playing DotA)
Wish me luck ;-)

Chilling_Silence
Posts: 47
Joined: Tue Jul 27, 2010 11:31 pm

Re: Add GUI for VLAN configurations

Post by Chilling_Silence »

Well blow me down, it seems to work! :D

I've been lazy and accounted for the following WAN situations:
Static IP (Wired)
DHCP (Wired)
PPPoE (Wired)

Otherwise so far it seems to be working good and I just need to package this up and get somebody, like say psycik, to test it.
I've got limited access to UFB connections (Stuck on VDSL2 myself) but testing with another unit on the WAN that was on VLAN10 was very successful so the theory is there :)

Now to brush up on creating the plugin package file. :mrgreen:

psycik
Posts: 74
Joined: Mon Mar 21, 2011 3:27 pm

Re: Add GUI for VLAN configurations

Post by psycik »

Chilling_Silence wrote:Well blow me down, it seems to work! :D

I've been lazy and accounted for the following WAN situations:
Static IP (Wired)
DHCP (Wired)
PPPoE (Wired)

Otherwise so far it seems to be working good and I just need to package this up and get somebody, like say psycik, to test it.
I've got limited access to UFB connections (Stuck on VDSL2 myself) but testing with another unit on the WAN that was on VLAN10 was very successful so the theory is there :)

Now to brush up on creating the plugin package file. :mrgreen:
I'm going to try downgrading my gargoyle version from 1.8.0 to 1.6 or 1.7 and have another go. But yeah could test it. My 1.8 machine is in use as my gateway at the moment (with a vlan'd cisco 2900) but I'll get my 2.1 machine back soon.

Chilling_Silence
Posts: 47
Joined: Tue Jul 27, 2010 11:31 pm

Re: Add GUI for VLAN configurations

Post by Chilling_Silence »

I've encountered a small problem...

If the WAN is offline, due to it requiring VLAN10, it makes it rather difficult for me to put this ipkg file in a repository somewhere.

Is there anybody who's familiar with the Gargoyle WebGUI who could help me with creating a page for enabling / disabling this function, that basically make an empty file in /etc/config, such as /etc/config/enable_vlan when the user selects that they want VLAN10 override enabled.
Heck there could even be an edit-box that allows them to enter their desired VLAN for the WAN port, and I could just read that out of the enable_vlan file as well?

I could leave the package installed (I'm custom-compiling the firmware too with these changes, as well as creating it as a plugin) then and just check to see if the file exists each time prior to overriding the WAN config with VLAN10.

Anybody available to assist me with that?

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

Re: Add GUI for VLAN configurations

Post by Lantis »

start with the code for the adblock plugin and modify to suit.
https://github.com/ericpaulbishop/gargo ... le-adblock

basically when the person ticks "enable" and then hits "save changes" the plugin calls a script that takes care of the rest. this is very similar to what you want to do.
also it shows how to read values from a config file, another thing you probably want to do.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Chilling_Silence
Posts: 47
Joined: Tue Jul 27, 2010 11:31 pm

Re: Add GUI for VLAN configurations

Post by Chilling_Silence »

Thanks so much Lantis, I'll have a crack at that later, doesn't look all that difficult ! :)

hemmiwt
Posts: 1
Joined: Fri Mar 04, 2016 7:58 am
Location: New Zealand

Re: Add GUI for VLAN configurations

Post by hemmiwt »

@psycik

I had similar problems to you getting my 1043nd v1 router to talk with my fibre ONT. I was running gargoyle v1.8.1 and followed the instructions in this thread religiously.

I downgraded to v1.6.2, used the same settings, and now it works.

KuriKai
Posts: 3
Joined: Sun May 05, 2013 11:03 pm

Re: Add GUI for VLAN configurations

Post by KuriKai »

How did creating the package go?
I'm with 2degrees in NZ and they use vlan10

Chilling_Silence
Posts: 47
Joined: Tue Jul 27, 2010 11:31 pm

Re: Add GUI for VLAN configurations

Post by Chilling_Silence »

In the end I sort of gave up on it. It worked, but it was a pretty ugly hack.

Seeing as the stuff I do doesn't require VLAN10, I kind of gave up. Some friends who are with Spark etc in NZ just rang them and got them to take it off, so they're all on stock Gargoyle, no VLAN for their 100/20 UFB connection. Works fine, takes a few hours for Chorus to action the request.

Post Reply