I got a beginner question in which I hope you can help to clarify.
I've just flashed my wireless router WR841N. Below is the fresh unmodified
/etc/config/network configuration file. In the third verse config interface 'lan', can someone
explain why this interface is configured as a bridge by default, with only one slave interface eth0.1 as member?
Thank you in advance for your time and help sharing knowledge.
A wifi AP is also usually bridged in. Since wifi interfaces are created at runtime with dynamic names, wifi interfaces are attached to a network with option network in their configuration in /etc/config/wireless. In other words do not refer to wifi interfaces in /etc/config/network because the naming may not be consistent.
brctl show shows the kernel bridges that have been set up and their members.
The output of brctl show is as shown below, which is consistent with the configuration in /etc/config/network. What I don't really understand is, what is the purpose of creating a bridge with only one member interface?
root@OpenWrt:~# brctl show
bridge name bridge id STP enabled interfaces
br-lan 7fff.c4715448b9ea no eth0.1
root@OpenWrt:~#
Thanks for your replies mk24.
So in a openwrt wireless router, the wireless interface is dynamically bridged with the LAN,
is that what actually happens behind the scene? Because you can't really see how the communication between wlan0, LAN and WAN is handled internally, by studying the configuration files. I just want to have a deeper understanding of how things works. Hope you and the experts in here can help me out.
It is bridged; but I don't know why you're referring to this scenario as a "dynamic bridge". This is the default LAN config made by the developers for across-device uniformity of OpenWrt. If this was not done, users would have to add/configure switch ports and WiFi cards; as well as enumerate a LAN bridge themselves (likely breaking their connectivity in the process). This is confusing even for some seasoned OpenWrt power users. The OpenWrt developers conveniently set this [usually necessary] LAN bridge up by default.
It works like any other router. The Linux kernel has its IPv4 and IPv6 routing enabled, so the kernel is the Network Operating System (NOS) itself. So, the kernel is the "routing plane"; and everything else is handled via routing rules and the iptables firewall. Simple.
Thanks for taking your time to explain. I am just trying to get a deeper understanding of how things work, and by answering my questions, you are actually helping me to be less confused ;-). I really appreciate that.
Just to add on this answer because I've seen it a few times, but vlans were never called out specifically; using the bridged interface instead of a raw interface gives us the possibility to use and bridge vlans more easily as well.