Page 1 of 3
How to create separate network / vlan
Posted: Sat Jan 23, 2016 8:58 pm
by shm0
Hi,
I use WRT1200 as my gargoyle device.
I want to create a separate network/vlan on one of the switch ports.
i tried to switch vlan on with swconfig but then router lost all connections.
Maybe someone can help me out with this?
Thanks

Re: How to create separate network / vlan
Posted: Sat Jan 23, 2016 9:29 pm
by Lantis
You should use the /etc/config/network file to set them up.
Create a new vlan and give it a name. Then create a new network instance and assign it to that vlan.
I'm on the road at the moment but I can provide better instruction later if you need.
If that's the case can you post your entire /etc/config/network?
Make sure to blank out any usernames or passwords that may be in there.
Re: How to create separate network / vlan
Posted: Sat Jan 23, 2016 9:35 pm
by shm0
I first wanted to try to replicate the default behavior.
I guess i have to create vlans one for the switch and one for the wan port?
But do i have to include both cpu ports and set them as tagged?
I also have no serial cable. so i must be absolutely sure.
Port Layout (from openwrt wiki):
wrt1200ac => lan = 0 1 2 3 6 and wan = 4 5
both 5 and 6 are cpu ports; 0-4 are the plugs on the back of the router
sw.port0=lan4 and sw.port3=lan1
Here is the default config:
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 'xxxxxxxxxxx'
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 '208.67.222.222 208.67.220.220'
option ipaddr '192.168.x.x'
config interface 'wan'
option ifname 'eth0'
option dns '208.67.222.222 208.67.220.220'
option peerdns '0'
option proto 'static'
option netmask '255.255.255.0'
option ipaddr '192.168.x.x'
option gateway '192.168.x.x'
config interface 'wan6'
option ifname 'eth0'
option proto 'dhcpv6'
To separate one port can this work?
Code: Select all
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '1 2 3 6t'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0 6t'
config switch_vlan
option device 'switch0'
option vlan '100'
option ports '4 5t'
config interface 'lan'
option ifname 'eth1.1'
option force_link '1'
option type 'bridge'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option dns '208.67.222.222 208.67.220.220'
option ipaddr '192.168.0.254'
config interface 'privat_lan'
option ifname 'eth1.2'
option force_link '1'
option type 'bridge'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option dns '208.67.222.222 208.67.220.220'
option ipaddr '192.168.1.254'
Then add configs needed in etc/dhcp and etc/firewall ?
Re: How to create separate network / vlan
Posted: Sun Jan 24, 2016 2:48 am
by Lantis
That looks pretty close.
One of those vlans will need to be eth1.1, you listed both as 1.2.
I'm sure this was just a typo

.
You are also correct to then make the associated DHCP entries and firewall entries.
If this goes badly, you can always use failsafe reset to restore the router. I'd suggest making a backup before starting these modifications so that you can always go back.
Also with our routers i'm pretty sure that you can do a series of on-off powerups to revert it to the alternative firmware if it got really stuck. The procedure is on the wiki i believe.
Re: How to create separate network / vlan
Posted: Sun Jan 24, 2016 1:03 pm
by shm0
Sorry for that typo was late yesterday
Do i have to edit gargoyle_default_ifs also?
And did you already tried to use vlans on a wrt1* device?
Re: How to create separate network / vlan
Posted: Sun Jan 24, 2016 3:33 pm
by Lantis
Not sure about that. I think that file is used in the creation of some firewall rules maybe.
Nah I've never done it. Have no use for it.
Re: How to create separate network / vlan
Posted: Sun Jan 24, 2016 11:56 pm
by shm0
I bricked it. Power Led starts blinking then is steady. No Lan LEDs light up.
No connection possible. Fail safe doesn't seem to work. Reset Button also doesn't work.

Re: How to create separate network / vlan
Posted: Mon Jan 25, 2016 12:11 am
by Lantis
Try the power off power on 4 times method. It should switch to backup flash.
Re: How to create separate network / vlan
Posted: Mon Jan 25, 2016 12:47 am
by shm0
The wiki states as soon as any other led blinks turn off and on again.
The problem is only power led works.
i tried different timings but no go.
On your device when the power led starts blinking how long does it take to other leds light up?
Re: How to create separate network / vlan
Posted: Mon Jan 25, 2016 1:17 am
by Lantis
It takes a little while. Maybe 30 seconds.
Are you sure fail safe isn't working?
I've put my device into a completely unusable state and recovered it using fail safe.
I had a completely incompatible network config like your situation.