Wnr3500l + tomato Network Structure Analysis

Source: Internet
Author: User

A few months ago started a turn of the wnr3500l, this route known as open source and third-party firmware support is very attractive to me, first began to brush the DD-WRT and then changed to tomato, after switching to tomato, connect to the route through SSH. ifconfig shows a lot of interfaces. Besides the familiar eth0, eht1, and br0, there are more vlan0, vlan1, and so on, after running brctl show br0, we found that vlan0 and eth1 were bound to br0. This made me very interested in its network structure. After searching for a large amount of information, I learned the following:

First, wnr3500l uses the bcm4718 + bcm53115 Combination Scheme. Compare the analysis of rb1_g in the previous article, refer to the following picture, we can see that bcm4718 has only one rgmii channel, therefore, bcm53115 can only be connected through a single port (although bcm53115 supports dual rgmii, see ).

This rgmii port is called eth0 in the system. The other Wireless AP is eth1 in the system, so eth0 and eth1 are two "hard" interfaces, which correspond to actual physical lines, there are only two ports connected to the CPU hardware. Other intefaces are derived from the "virtual" interfaces on the two "hard" interfaces.

Since br0 is composed of vlan0 and eth1, let's end with a look at the two VLANs. The switch chip bcm53115 is capable of VLAN division, which is also the basic condition for its application in this solution. Let's start with it. In bcm53115, as shown above, there are 7 GMAC and 5 GWs. The combination of 5 GMAC and gphy corresponds to 5 physical ports, but one of the other two GMAC is useless, another network channel is directly connected through rgmii and rgmii on bcm4718. So from the logic view, it can be equivalent to a 6portsr switch, where port5 is associated with the eth0 of bcm4718, and other port0-4 is a physical port. In VLAN division, port0 + prot5 is divided into vlan1, port1-4 + port5 is divided into vlan0.
The six ports are divided into two groups. Among them, port5 is shared to the CPU. From the VLAN perspective, it can be regarded as a trunk port (please search for related concepts by yourself, here, you only need to know that both VLANs can pass through it ). Vlan0 corresponds to four LAN ports, and vlan1 corresponds to a separate Wan port.

After Dividing VLANs in bcm53115, the system must have corresponding interfaces. Because tomato is based on Linux, vconfig add eth0 X is generally used to create application interfaces, X indicates the vlan id. Here, tomato creates vlan0 and vlan1 Interfaces Based on eth0, which correspond to vlan0 and vlan1. Then return to eth1. Because the Wireless AP can be regarded as a wireless switch, the wired LAN and wireless LAN must be in the same LAN. Therefore, the bridge is used and br0 is created using brctl, add eth1 (wireless device group) and vlan0 (wired device group. Finally, the system only needs to allocate IP addresses to vlan1 and br0 and adopt routing rules. Because the data exchange between machines in the wired LAN is carried out in vlan0, the data exchange in the wireless LAN is
In AP, data exchange between wired and wireless LAN is in br0. Of course, if pppoe is used for dial-up, the actual network interface provided is ppp0, which is equivalent to vlan1.

You can refer to the figure below (although it is for WRT54G, but it also applies to 3500l) to understand the above section:

For details about the logic view, refer to the following:

The eth0 does not exist. Because the eth0 interface is not used, the system directly uses vlan0, vlan1, and ifconfig derived from eth0. Of course, vlan0 and eth1 are also used in the form of br0. The lan ip address we allocate in the route is actually allocated to br0. If pppoe is used for dial-up, the interface is vlan1, and vlan1 is in the same situation as eth0, because the system uses the ppp0 generated when the dial is successful to connect to the network. Ppp0 uses the public IP provided by the ISP.

The default solution is to bind four LAN ports to one VLAN. In fact, you can set the switch parameter to divide more VLANs, form a multi-Wan port route to connect different subnets or to multiple ports. A total of five ports can be configured with a maximum of 4 Wan + 1 LAN. Of course, this is theoretical. The specific situation depends on the degree of support of the router firmware. The switch configuration method varies with the firmware. You can search for it.

I have always thought that at least two ports are needed on the machine for routing. However, from the analysis of 3500l, a single-port Linux machine works with a VLAN-based switch, the routing function is also available.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.