Where is the switch option menú on OpenWrt 18.06.1?


#1

Hi everyone,

I want create various VLAN in OpenWRT 18.06.1 and I have readed that the first think that I need to do is activate the VLAN support in the "Network -> Switch" option menu but it not appear in my options menu.

Where is this option or how I can show it?

Best regards,

Ramses


#2

Does your hardware have a switch?

If you have CPU ports that go directly to outside, as most x86 boxes do, you create VLANs directly on the port with notation like 'eth0.3' instead of 'eth0'.

Also some high-end chips use a "DSA" type of switch driver, which abstracts the hardware to look like there are separate eth ports that go directly outside. To the user's perspective, think of it as there being no switch.


#3

#4

Hi @mk24,

My router is a GL.iNet GL-AR300M. It have 2 Ethernet ports (LAN/WAN) and 1 WIFI port.

I want create VLAN interfaces on the LAN/WAN Ethernet or WIFI Interface.

I unknow if it has CPU Ports.

How can I know if it has these ports?

But the Network -> Switch option menu not appear in my OpenWRT. Is this correct?

Regards,

Ramses


#5

Hi @vgaetera,

But my problem is that the Network -> Switch option menu not appear in my OpenWRT. Is this correct?

Regards,

Ramses


#6
ls -l /sys/class/net
swconfig list

#7

just add the line:

config switch 'eth1' option name 'eth1'

to my /etc/config/network

then: uci commit network

to find the switch menu under Luci network pane

but of course it doesnt work if the switch is not there ? or am I wrong ?

About the vlan I am still trying to figure out uci set ups in

openwrt/target/linux/ar71xx/base-files/etc/board.d/02_network

wndap360|\
	wp543)
		ucidef_set_interface_lan "eth0"
		;;
	a40|\
	a60|\
	alfa-ap96|\
	alfa-nx|\
	archer-c25-v1|\
	dr344|\
	gl-ar150|\
	gl-ar300m|\
	gl-domino|\
	gl-inet|\
	gl-mifi|\
	jwap003|\
	om2p-hsv4|\
	om2pv4|\
	pb42|\
	pb44|\
	rb-951ui-2hnd|\
	rb-952ui-5ac2nd|\
	routerstation|\
	tl-wr710n|\
	tl-wr720n-v3|\
	tl-wr810n|\
	tl-wr810n-v2|\
	wpe72|\
	wrtnode2q)
		ucidef_set_interfaces_lan_wan "eth1" "eth0"
		;;
	rb-750-r2|\
	rb-750p-pbr2|\
	rb-750up-r2|\
	rb-951ui-2nd)
		ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
		ucidef_add_switch "switch0" \
			"0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"

gl-ar300m doesnt have any. But I am talking about openwrt 18.06 dont now about currrent working version.

Don't know if you can use some kind of strange set up here.

Sorry can't help more I am in your same spot.

Try here [SOLVED] How to use UCI to configure VLANs on a large installation?

And if somebody knowledgeable have spare time to help a lost soul visit here:


#8

The AR9331 chip has an integral 5 port switch in between its CPU port and the Ethernet hardware ports. Router models built with fewer than 5 ports simply leave some of the pins of the AR9331 unconnected. Even with only one connected port, the switch still has to be configured in order to pass traffic through.

If the swconfig command exists on your router, the firstboot scripts should have built out a basic config in /etc/config/network on the first boot. Try using swconfig dev switch0 show to see if / how the switch is configured.


#9

@vgaetera, @mk24, @Pippo, very thanks by your answers.

When I execute the swconfig on the OpenWRT of my router it show this:

root@GL-AR300M:/# swconfig list
Found: switch0 - eth1
root@GL-AR300M:/#

But in LUCI not appear the switch option in the Network menu.

image

I have installed swconfig that is not installed by default.

Best regards,

Ramses


#10
swconfig dev switch0 show

#11

@vgaetera when I execute that command the router show this:

root@GL-AR300M:/# swconfig list
Found: switch0 - eth1
root@GL-AR300M:/#
root@GL-AR300M:/# swconfig dev switch0 show
Global attributes:
        enable_vlan: 0
        mirror_monitor_port: 15
Port 0:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow
Port 1:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:1 link:up speed:100baseT full-duplex auto
Port 2:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:2 link:down
Port 3:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:3 link:down
Port 4:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:4 link:down
VLAN 0:
        vid: 0
        ports: 0 1 2 3 4
root@GL-AR300M:/#

But my first problem is why not appear the Network -> Switch option menú in LUCI?

Regards,

Ramses


#12

Hi, ended up just addind

the lines:
config switch 'eth1’
option name 'eth1'

to my /etc/config/network

then: uci commit network

Or /etc/init.d/network reload

Don’t remeber which one

Then reboot !15C427BD-8D3A-44B2-8717-8EC18CC0AB79


#13

Hi did you try to modify your etc/config/network file ? Did it work ? To me was working but I am talking about more that a month ago using trunk,current non stable release.


#14

I still get the following message: "Switch "eth1" has an unknown topology - the VLAN settings might not be accurate."
Therefore I edited the specific network config for the board:

grep gl-ar300m -A5 -B1 /etc/board.d/02_network

…
	gl-ar150|\
	gl-ar300m)
		ucidef_set_interfaces_lan_wan "eth0" "eth1"
		ucidef_add_switch "switch0" \
			"0@eth1" "1:wan"
		;;
	gl-domino|\
…

But no improvements. Do you have a idea?


#15

Nope

When I was looking into it the wiki was not very informative on

/etc/board.d/02_network

Maybe now they updated the pages. Try to find a router with an architecture like yours and copy it.