first, the basic concept
Lan:local Area Network's abbreviation, i.e. LAN
our computers and our routes are connected to this port .
Wan:wide Area network abbreviation, the WAN
the network cable that the operator pulls in is connected to the mouth.
The Chinese name of the VLAN (virtual local area network) is
VLANs are typically subdivided into several network segments logically in a local area network to form a VLAN. A local area network can be divided into more than n VLANs, so that VLANs cannot communicate with each other (usually for security reasons). Lan and WAN belong to VLAN II, configure WAN ports and LAN ports
First, download the OPENWRT system to the Development Board (RT5350), then power the board into the OPENWRT system and use the SECURECRT for command operation. (SecureCRT for people who are familiar with Linux embedded development.)
Configuration files in OpenWrt under/etc/config/, WAN and LAN configuration in/etc/config/network
Above is the screenshot after opening the file
Analyze the information in the above file (focus only):
Config interface ' LAN '//Configure LAN Port
Option type ' bridge '//bridging mode
OPTION ifname ' eth0.1 '//Represents vlan1, this is important, the following configuration will be used
Option proto ' static '//static IP
Config device ' Lan_dev '//Configure LAN hardware information
Option MACADDR//Set MAC address
Config interface ' WAN '//Configure WAN Port
Option type ' DHCP '//dhcp mode (DHCP self-Baidu)
Config switch//switch Chinese meaning on the switch, so the following is the Enable VLAN port
Option Enable_vlan ' 1 '//1 indicates the VLAN port is turned on
Config Switch_vlan
Option VLAN ' 1 '//vlan1, and the above option ifname ' eth0.1 ' match, so is configured LAN port
Option Ports ' 0 1 2 3 6t '//0~3 is LAN port, RT5350 has 5 ports
Config Switch_vlan
Option VLAN ' 2 '//vlan2, and the above option ifname ' eth0.2 ' matches, so is configured WAN port
Option ports ' 4 6t '//4 is a WAN port
Well, the above introduction should be able to configure the port as a LAN port or WAN port freely
The network file above is the UCI configuration file, so you can go deep into https://wiki.openwrt.org/doc/uci