I'm working on Olinuxino-RT5350.
It is a switch with 5 ports and wifi.
OpenWrt default configuration enables WAN on eth0.2 and LAN on eth0.1.
I would like to enable LAN on both ethernet ports. I tried removing the vlans and configuring only one interface "eth0" on both Ethernet ports. Is it possible ? Do I have to use vlans : 1 vlan containing both ethernet ports ?
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 'eth0'
option proto 'dhcp'
config device 'lan_dev'
option name 'eth0'
option macaddr 'xx:xx:xx:xx:xx:xx'
config interface 'wwan'
option proto 'dhcp'
I have searched the forum but didn't find a similar topic or I might have used the wrong key words...
You could do what you ask, but you should assign the physical port of the wan interface to vlan1 rather than erasing all the switch configuration.
Could you post the default config in /etc/config/network ?
So this is what I supposed. I need to keep at least 1 vlan.
But why can't I use eth0 directly ?
Why should I create a vlan since eth0 has all ports by default ?
Sorry if this sounds like a beginner question, I'm still learning networking/routing/firewall/etc while I'm getting more and more familiar with OpenWrt.
Another question concerning the default config, why do they often/always bridge the lan interface in default configs? A bridge with only one interface?
Because the eth0 is not a physical interface, but a virtual interface on the cpu of the router. In order to make cpu communicate with each physical port of the switch, you need to assign them in the same vlan. This is basically what the config switch_vlan sections do.
In order to have all wired ports in LAN interface do the following modifications
interfaces are virtual and bind ethernet ports to router ports ?
I would be very pleased if you have a link to some documentation / tuorial that could help me understand more about the subject.
Why should I create a vlan since eth0 has all ports by default ?
Because you need a LAN and WAN (hence 2 VLANs) - per your title.
Switch port seem to list only ethernet ports... or is there a port for WiFi ?
If only ethernet ports, then I would use ONLY WiFi over WAN so still no need for VLANs since all ethernet ports will be for LAN, right?
I don't use any Web UI for configuration.
All done through command line but managed to configure it all in one vlan.
WiFi goes over an internal bus to the CPU, which then uses/routes/bridges it, so no “switch port” like there is for the SoC's MACs (Ethernet logical part, “ethN”) and the phys (Ethernet physical part, “LAN jack N”).